/// <summary>
        /// Initializes a new instance of the <see cref="PersistenceFactoryBase" /> class.
        /// </summary>
        /// <param name="contextManagerFactory">The context manager factory.</param>
        protected PersistenceFactoryBase(IAmbientContextManagerFactory contextManagerFactory)
        {
            var factoryMethod = contextManagerFactory == null
                                    ? new Func<AmbientContextManagerBase>(CreateDefaultAmbientContextManager)
                                    : new Func<AmbientContextManagerBase>(contextManagerFactory.Create);

            _AmbientContextManager = new Lazy<AmbientContextManagerBase>(factoryMethod);
        }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PersistenceFactoryBase" /> class.
        /// </summary>
        /// <param name="contextManagerFactory">The context manager factory.</param>
        protected PersistenceFactoryBase(IAmbientContextManagerFactory contextManagerFactory)
        {
            var factoryMethod = contextManagerFactory == null
                                    ? new Func <AmbientContextManagerBase>(CreateDefaultAmbientContextManager)
                                    : new Func <AmbientContextManagerBase>(contextManagerFactory.Create);

            _AmbientContextManager = new Lazy <AmbientContextManagerBase>(factoryMethod);
        }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PersistenceFactory" /> class.
 /// </summary>
 /// <param name="contextManagerFactory">The context manager factory.</param>
 /// <param name="persistenceOptions">The persistence options.</param>
 public PersistenceFactory(IAmbientContextManagerFactory contextManagerFactory, PersistenceOptions persistenceOptions)
     : base(contextManagerFactory)
 {
     _PersistenceOptions = persistenceOptions ?? new PersistenceOptions();
 }
Example #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PersistenceFactory" /> class.
 /// </summary>
 /// <param name="contextManagerFactory">The context manager factory.</param>
 public PersistenceFactory(IAmbientContextManagerFactory contextManagerFactory)
     : this(contextManagerFactory, null)
 {
 }
Example #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EfPersistenceFactory" /> class.
 /// </summary>
 /// <param name="dbContextFactory">The db context factory.</param>
 /// <param name="contextManagerFactory">The context manager factory.</param>
 public EfPersistenceFactory(IDbContextFactory dbContextFactory, IAmbientContextManagerFactory contextManagerFactory)
     : base(contextManagerFactory)
 {
     _DbContextFactory = dbContextFactory;
 }
Example #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EfPersistenceFactory" /> class.
 /// </summary>
 /// <param name="contextManagerFactory">The context manager factory.</param>
 public EfPersistenceFactory(IAmbientContextManagerFactory contextManagerFactory)
     : this(null, contextManagerFactory)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="PersistenceFactory" /> class.
 /// </summary>
 /// <param name="contextManagerFactory">The context manager factory.</param>
 /// <param name="persistenceOptions">The persistence options.</param>
 public PersistenceFactory(IAmbientContextManagerFactory contextManagerFactory, PersistenceOptions persistenceOptions)
     : base(contextManagerFactory)
 {
     _PersistenceOptions = persistenceOptions ?? new PersistenceOptions();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="PersistenceFactory" /> class.
 /// </summary>
 /// <param name="contextManagerFactory">The context manager factory.</param>
 public PersistenceFactory(IAmbientContextManagerFactory contextManagerFactory)
     : this(contextManagerFactory, null)
 {
 }