/// <summary> /// Determines whether the property is, or belongs to, the entity's key. /// </summary> /// <param name="property">The property.</param> /// <returns> /// <c>true</c> if the property is, or belongs to, the entity's key; otherwise, <c>false</c>. /// </returns> private bool IsPropertyAKey(AuditEntityProperty property) { if (_objectStateEntry.EntityKey == null || _objectStateEntry.EntityKey.EntityKeyValues == null) return false; return _objectStateEntry.EntityKey.EntityKeyValues .Select(k => k.Key) .Contains(property.PropertyName); }
private static AuditEntity CreateAuditEntity() { var entity = new AuditEntity(); entity.AuditEntityAction = AuditEntityAction.Add; entity.EntityIdentifier = Guid.NewGuid().ToString(); entity.EntityType = Guid.NewGuid().ToString(); entity.AuditEntityProperties = new Collection<AuditEntityProperty>(); for (var i = 0; i >= 3; i++) { var property = new AuditEntityProperty(); property.PropertyName = Guid.NewGuid().ToString(); property.NewValue = Guid.NewGuid().ToString(); entity.AuditEntityProperties.Add(property); } return entity; }
private static AuditEntityProperty CreateAuditEntityProperty() { var property = new AuditEntityProperty(); property.NewValue = Guid.NewGuid().ToString(); property.OriginalValue = Guid.NewGuid().ToString(); property.PropertyName = Guid.NewGuid().ToString(); return property; }