internal void ResetServices() { HasCachedObjects = false; bool asReadOnly = !Context.ObjectTrackingEnabled; IdentityManager = IdentityManager.CreateIdentityManager(asReadOnly); ChangeTracker = ChangeTracker.CreateChangeTracker(this, asReadOnly); factoryMap = new Dictionary <MetaDataMember, IDeferredSourceFactory>(); }
// Methods internal CommonDataServices(DataContext context, MetaModel model) { Context = context; Model = model; bool asReadOnly = !context.ObjectTrackingEnabled; IdentityManager = IdentityManager.CreateIdentityManager(asReadOnly); ChangeTracker = ChangeTracker.CreateChangeTracker(this, asReadOnly); ChangeDirector = ChangeDirector.CreateChangeDirector(context); factoryMap = new Dictionary <MetaDataMember, IDeferredSourceFactory>(); }
internal object GetCachedObject(MetaType type, object[] keyValues) { if (type == null) { throw Error.ArgumentNull("type"); } if (!type.IsEntity) { return(null); } return(IdentityManager.Find(type, keyValues)); }
public bool RemoveCachedObjectLike(MetaType type, object instance) { if (type == null) { throw Error.ArgumentNull("type"); } if (!type.IsEntity) { return(false); } return(IdentityManager.RemoveLike(type, instance)); }
internal object GetCachedObjectLike(MetaType type, object instance) { if (type == null) { throw Error.ArgumentNull("type"); } if (!type.IsEntity) { return(null); } return(IdentityManager.FindLike(type, instance)); }
public object InsertLookupCachedObject(MetaType type, object instance) { if (type == null) { throw Error.ArgumentNull("type"); } HasCachedObjects = true; if (!type.IsEntity) { return(instance); } return(IdentityManager.InsertLookup(type, instance)); }