protected EntityConfiguration <TEntity> AddCollection <TElement>(Expression <Func <TEntity, ICollection <TElement> > > accessor, string displayName, IEqualityComparer <TElement> comparer = null) { PropertyInfo property = ChangeDetector.GetProperty(accessor); detector.AddCollection(property, displayName, comparer); return(this); }
protected EntityConfiguration <TEntity> Add <TProp>(Expression <Func <TEntity, TProp> > accessor, IEqualityComparer <TProp> comparer = null) { var propertyInfo = ChangeDetector.GetProperty <TEntity, TProp>(accessor); detector.Add <TEntity, TProp>(propertyInfo, null, null, comparer); return(this); }
protected EntityConfiguration <TEntity> Add <TProp>(Expression <Func <TEntity, TProp> > accessor, Func <TEntity, string> displayName, Func <TEntity, TProp, string> formatter, IEqualityComparer <TProp> comparer = null) { var propertyInfo = ChangeDetector.GetProperty <TEntity, TProp>(accessor); detector.Add(propertyInfo, displayName, formatter, comparer); return(this); }
public IPropertyChange GetChange <TProp>(Expression <Func <TDerived, TProp> > accessor, TDerived original, TDerived updated) { PropertyInfo property = ChangeDetector.GetProperty(accessor); Snapshot originalSnapshot = detector.TakeSnapshot(original, property); Snapshot updatedSnapshot = detector.TakeSnapshot(updated, property); return(detector.GetChange(property, originalSnapshot, updatedSnapshot)); }
public bool HasChange <TProp>(Expression <Func <TEntity, TProp> > accessor, TEntity original, TEntity updated) { PropertyInfo property = ChangeDetector.GetProperty(accessor); Snapshot originalSnapshot = detector.TakeSnapshot(original, property); Snapshot updatedSnapshot = detector.TakeSnapshot(updated, property); return(detector.HasChange(property, originalSnapshot, updatedSnapshot)); }
private IPropertyChange getChange <TProp>(Expression <Func <TEntity, TProp> > accessor) { PropertyInfo property = ChangeDetector.GetProperty(accessor); if (property == null) { return(null); } return(changes.Where(c => c.Property == property).SingleOrDefault()); }
public DerivedEntityChangeDetector(ChangeDetector detector) { this.detector = detector; }
private EntityConfiguration(ChangeDetector detector) { this.detector = detector; }
internal ICollectionChange <TElement> GetCollectionChanges <TElement>(Expression <Func <TEntity, ICollection <TElement> > > accessor, CollectionSnapshotLookup original, TEntity updated, ElementState state) { PropertyInfo property = ChangeDetector.GetProperty(accessor); return(detector.GetCollectionChanges <TElement>(property, original, updated, state)); }
public EntityConfiguration() { this.detector = new ChangeDetector(); }