private void Notify(EntityChange change) { foreach (Type eventKeyClass in _eventMap.Keys) { /* // check if the eventKeyClass is the entity class, or a superclass of it if (eventKeyClass.IsAssignableFrom(change.EntityRef)) { // create an entity ref based on the eventKeyClass, regardless of the actual entity class //EntityRefBase entityRef = EntityRefFactory.CreateReference(eventKeyClass, change.EntityOID, change.Version); //EventsHelper.Fire(_eventMap[change.EntityClass], null, new EntityChangeEventArgs(entityRef, change.ChangeType)); } * */ } }
private static Dictionary<string, PropertyData> WriteProperties(EntityChange entityChange) { var propertiesData = new Dictionary<string, PropertyData>(); var entityClass = EntityRefUtils.GetClass(entityChange.EntityRef); foreach (var prop in entityChange.PropertyChanges) { var pi = entityClass.GetProperty(prop.PropertyName); // special handling of extended properties collections // note that we need to check pi != null because it may represent a field-access "property" // which has no corresponding .NET property if (pi != null && AttributeUtils.HasAttribute<ExtendedPropertiesCollectionAttribute>(pi)) { var extendedProps = WriteExtendedProperties(prop, entityChange.ChangeType); foreach (var extendedProp in extendedProps) { propertiesData.Add(extendedProp.Key, extendedProp.Value); } } else { var propertyData = WriteProperty(prop.OldValue, prop.NewValue, entityChange.ChangeType); propertiesData.Add(prop.PropertyName, propertyData); } } return propertiesData; }