내가 컬렉션의 일부 특정 항목의 발생을 확인하고자하고 같이 일을 생각하지만점검
public static bool ContainsAny<T>(this IEnumerable<T> collection, IEnumerable<T> otherCollection)
{
if (otherCollection == null)
throw new ArgumentNullException("otherCollection", ExceptionResources.NullParameterUsed);
if (collection == null)
throw new ArgumentNullException("collection", ExceptionResources.ExtensionUsedOnNull);
else
return Enumerable.Any<T>(otherCollection, new Func<T, bool>(((Enumerable)collection).Contains<T>));
}
내가 싶어하지 않습니다 지정된 컬렉션에 otherCollection 항목이 포함되어 있으면 true이고 그렇지 않으면 false입니다. 하지만 system.collections.generic.iEnumerable> T>를 system.linq.Enumberable로 변환 할 수 없다는 오류가 있습니다. 내 실수는 어디 갔지?
컬렉션이 비어 있거나 null이 아닐 때 원하는 대답을 생각해야합니다. 외모만큼 사소한 것은 아닙니다. –