Exemple #1
0
 private string GetPrimaryKeyValue <TEntity>(TEntity entity)
 => modelDataStorage_.GetPrimaryKey(entity.GetType())?.Property.GetValue(entity)?.ToString();
Exemple #2
0
 public IEnumerable <IUpdatedEntity> DetectChanges(IEnumerable <ITrackedInternalEntity <object> > entities)
 {
     return(entities.Select(e => new UpdatedEntity(tableNameProvider_.GetTableName(e.Entity.GetType()), e.Entity.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance)
                                                   .Where(t => !t.GetGetMethod().IsVirtual)
                                                   .Where(p => !CompareBoxedValues(p.GetValue(e.Entity), e.Snapshot.GetType().GetProperty(p.Name).GetValue(e.Snapshot)))
                                                   .Select(p => new EntityUpdate(p.Name, p.GetValue(e.Entity))), CreateIdentifier(e.Entity, modelDataStorage_.GetPrimaryKey(e.Entity.GetType()).Property))));
 }