Format:
Recent snippets matching tags of compare
public static void Copy(string sourceDirName, string destDirName, bool excludeSubdirectories) { // Style #1: fluent Guard.MethodArgument("sourceDirName").IsNotNullOrEmpty(sourceDirName); Guard.MethodArgument("destDirName").IsNotNullOrEmpty(destDirName, "The destination directory is required!"); // Style #2: lambdas and expressions Guard.Argument.IsNotNullOrWhiteSpace(()=>sourceDirName); Guard.Argument.IsNotNullOrWhiteSpace(()=>destDirName, "The destination directory is required!");
84 Views
1 comments
/// <summary> /// Implements a projection strategy that select an "identity" property from an object /// and uses the default comparer to implement IEqualityComparer<typeparamref name="T"/> /// </summary> /// <typeparam name="T">Type of object to extract identity from</typeparam> /// <typeparam name="TRet">Type of the extracted identity value</typeparam> public class IdentityProjectionEqualityComparer<T, TRet> : IEqualityComparer<T> where TRet : IComparable<TRet> { private readonly Func<T, TRet> _projector; private readonly IEqualityComparer<TRet> _comparer;
176 Views
2 comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
