コード例 #1
0
        public static void ShareEntityContext(this IIntermediateEntityContainer container, IntermediateEntity entity)
        {
            //You can't share context with a null, right?
            if (entity != null)
            {
                var parent = container.GetParent();

                if (entity.EntityContext != null && parent.EntityContext == null)
                {
                    entity.EntityContext.AttachContext(parent);
                }
                else if (parent.EntityContext != null && entity.EntityContext == null)
                {
                    parent.EntityContext.AttachContext(entity);
                }
            }
        }
コード例 #2
0
 public static void SetEntityContextOnParent(this IIntermediateEntityContainer container, EntityContext context)
 {
     context.AttachContext(container.GetParent());
 }