// ========================================
 // constructor
 // ========================================
 internal PersistenceMaintainer(
     EntityInterceptor entityInterceptor, EntityContainer container, PersistentState state
     )
 {
     _entityInterceptor = entityInterceptor;
     _container         = container;
     _state             = state;
 }
示例#2
0
        private object CreateTransientEntity(Type type)
        {
            var interceptor = new EntityInterceptor(type, this, PersistentState.Transient);

            interceptor.NeedRealInvocation = true;
            var ret = _proxyGenerator.CreateClassProxy(type, interceptor);

            interceptor.Target             = ret;
            interceptor.NeedRealInvocation = false;

            /// 呼んでも何もしないので呼ばない
            /// MaintainStrongReference(ret, PersistentState.Transient);
            return(ret);
        }
示例#3
0
        private object CreateEntity(Type type, string id, PersistentState state)
        {
            var interceptor = new EntityInterceptor(type, this, state);

            interceptor.Id = id;

            interceptor.NeedRealInvocation = true;
            var ret = _proxyGenerator.CreateClassProxy(type, interceptor);

            interceptor.Target             = ret;
            interceptor.NeedRealInvocation = false;

            _idToObjMap.Add(id, new WeakReference(ret));
            MaintainStrongReference(ret, state);
            return(ret);
        }