public static ICompareFluentInterface FromMemento(EngineMemento memento) { if (memento == null) { throw new ArgumentNullException(nameof(memento)); } var validationResults = new List <ValidationResult>(); if (!Validator.TryValidateObject(memento, new ValidationContext(memento), validationResults)) { throw new ExtendedValidationException("memento", memento, validationResults); } var f = new FluentInterface(); if (memento.Entities == null) { return(f); } if (memento.Entities.Count == 0) { return(f); } foreach (var entityMemento in memento.Entities) { IKeyProvider <Entity> keyProvider; if (entityMemento.KeyUseGuid) { keyProvider = AsKey.UseGuid; } else { keyProvider = AsKey.UseAttributes(entityMemento.KeyAttributeNames.ToArray()); } if (entityMemento.AttributesToSkip?.Count > 0) { var skipAttributeCriteria = Skip.Attributes(entityMemento.AttributesToSkip.ToArray()); f.Entity(entityMemento.EntityName, keyProvider, skipAttributeCriteria, entityMemento.OnlyActive); } else { f.Entity(entityMemento.EntityName, keyProvider, entityMemento.OnlyActive); } } return(f); }
public static ICompareFluentInterface Entity(string entityName, IKeyProvider <Entity> keyProvider, Action <QueryExpression> filterCriteria) { var f = new FluentInterface(); return(f.Entity(entityName, keyProvider, filterCriteria)); }
public static ICompareFluentInterface Entity(string entityName, IKeyProvider <Entity> keyProvider, ISkipAttributeCriteria skipAttributeCriteria, bool onlyActiveRecords) { var f = new FluentInterface(); return(f.Entity(entityName, keyProvider, skipAttributeCriteria, onlyActiveRecords)); }
public static ICompareFluentInterface Entity(string entityName, IKeyProvider <Entity> keyProvider) { var f = new FluentInterface(); return(f.Entity(entityName, keyProvider)); }