Beispiel #1
0
        internal void ResetServices()
        {
            HasCachedObjects = false;
            bool asReadOnly = !Context.ObjectTrackingEnabled;

            IdentityManager = IdentityManager.CreateIdentityManager(asReadOnly);
            ChangeTracker   = ChangeTracker.CreateChangeTracker(this, asReadOnly);
            factoryMap      = new Dictionary <MetaDataMember, IDeferredSourceFactory>();
        }
Beispiel #2
0
        // 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>();
        }
Beispiel #3
0
 internal object GetCachedObject(MetaType type, object[] keyValues)
 {
     if (type == null)
     {
         throw Error.ArgumentNull("type");
     }
     if (!type.IsEntity)
     {
         return(null);
     }
     return(IdentityManager.Find(type, keyValues));
 }
Beispiel #4
0
 public bool RemoveCachedObjectLike(MetaType type, object instance)
 {
     if (type == null)
     {
         throw Error.ArgumentNull("type");
     }
     if (!type.IsEntity)
     {
         return(false);
     }
     return(IdentityManager.RemoveLike(type, instance));
 }
Beispiel #5
0
 internal object GetCachedObjectLike(MetaType type, object instance)
 {
     if (type == null)
     {
         throw Error.ArgumentNull("type");
     }
     if (!type.IsEntity)
     {
         return(null);
     }
     return(IdentityManager.FindLike(type, instance));
 }
Beispiel #6
0
 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));
 }