public static PersistenceSpecification <T> CheckReference <T, TReference>(this PersistenceSpecification <T> spec,
                                                                                  Expression <Func <T, object> > expression,
                                                                                  TReference propertyValue,
                                                                                  params Func <TReference, object>[] propertiesToCompare)
        {
            // Because of the params keyword, the compiler will select this overload
            // instead of the one above, even when no funcs are supplied in the method call.
            if (propertiesToCompare == null || propertiesToCompare.Length == 0)
            {
                return(spec.CheckReference(expression, propertyValue, (IEqualityComparer)null));
            }

            return(spec.CheckReference(expression, propertyValue, new FuncEqualityComparer <TReference>(propertiesToCompare)));
        }
 public static PersistenceSpecification <T> CheckReference <T, TProperty>(this PersistenceSpecification <T> spec,
                                                                          Expression <Func <T, TProperty> > expression,
                                                                          TProperty propertyValue,
                                                                          Action <T, TProperty> propertySetter)
 {
     return(spec.CheckReference(expression, propertyValue, null, propertySetter));
 }
 public static PersistenceSpecification <T> CheckReference <T>(this PersistenceSpecification <T> spec,
                                                               Expression <Func <T, object> > expression,
                                                               object propertyValue)
 {
     return(spec.CheckReference(expression, propertyValue, (IEqualityComparer)null));
 }