/// <summary> /// Initializes a new instance of the <see cref="EntityManagerFactory" /> class. /// </summary> /// <param name="configuration"> /// The persistence configuration. /// </param> /// <param name="context"> /// The context. /// </param> /// <param name="disposeContext"> /// Indicating whether this entity manager factory owns the database context. /// </param> /// <exception cref="ArgumentNullException"> /// If <paramref name="configuration" /> is null. /// </exception> /// <exception cref="ArgumentNullException"> /// If <paramref name="context" /> is null. /// </exception> private EntityManagerFactory(PersistenceConfiguration configuration, IContext context, bool disposeContext = true) { if (configuration == null) { throw new ArgumentNullException(nameof(configuration)); } if (context == null) { throw new ArgumentNullException(nameof(context)); } this.factoryContext = new FactoryContext(configuration, context, disposeContext); }
/// <summary> /// Initializes a new instance of the <see cref="EntityContext" /> class. /// </summary> /// <param name="factoryContext"> /// The factory context. /// </param> /// <param name="bindingContext"> /// The binding context. /// </param> internal EntityContext(FactoryContext factoryContext, BindingContext bindingContext) : base(bindingContext) { this.factoryContext = factoryContext; this.configuration = new PersistenceConfiguration(factoryContext.Configuration, this); }
/// <summary> /// Initializes a new instance of the <see cref="EntityManager" /> class. /// </summary> /// <param name="factoryContext"> /// The entity manager factory context. /// </param> /// <param name="bindingContext"> /// The binding context. /// </param> internal EntityManager(FactoryContext factoryContext, BindingContext bindingContext) { this.DefaultBehaviors = Behaviors.CreateLazy; this.entityContext = new EntityContext(factoryContext, bindingContext); }
/// <summary> /// Initializes a new instance of the <see cref="EntityManager" /> class. /// </summary> /// <param name="factoryContext"> /// The entity manager factory context. /// </param> internal EntityManager(FactoryContext factoryContext) : this(factoryContext, factoryContext.Configuration.Binding) { }