Exemple #1
0
 public UnitOfWork(IDataContextAsync dataContext, IServiceProvider serviceProvider)
 {
     _serviceProvider = serviceProvider;
     _dataContext     = dataContext;
     _repositories    = new Dictionary <string, dynamic>();
 }
 public RepositorySupplierOffer(IDataContextAsync context, IUnitOfWorkAsync unitOfWork) : base(context, unitOfWork)
 {
 }
        /// <summary>Make a repository of type T.</summary>
        /// <typeparam name="T">Type of repository to make.</typeparam>
        /// <param name="dbContext">
        ///     The <see cref="Ef6.DataContext" /> with which to initialize the repository.
        /// </param>
        /// <param name="factory">
        ///     Factory with <see cref="Ef6.DataContext" /> argument. Used to make the repository.
        ///     If null, gets factory from <see cref="_repositoryFactories" />.
        /// </param>
        /// <param name="unitOfWorkAsync">
        ///     The <see cref="IUnitOfWorkAsync" /> which is passed to the constructor of the <see cref="IRepository{T}" />.
        /// </param>
        /// <returns></returns>
        protected virtual T MakeRepository <T>(Func <IDataContextAsync, IUnitOfWorkAsync, dynamic> factory, IDataContextAsync dbContext, IUnitOfWorkAsync unitOfWorkAsync)
        {
            var repositoryFactory = factory ?? _repositoryFactories.GetRepositoryFactory <T>();

            if (repositoryFactory == null)
            {
                throw new NotImplementedException("No factory for repository type, " + typeof(T).FullName);
            }

            var repository = repositoryFactory(dbContext, unitOfWorkAsync);

            Repositories[typeof(T)] = repository;

            return(repository);
        }
 public RepositoryItemType(IDataContextAsync context, IUnitOfWorkAsync unitOfWork) : base(context, unitOfWork)
 {
 }
 public RepositoryProcurement(IDataContextAsync context, IUnitOfWorkAsync unitOfWork)
     : base(context, unitOfWork)
 {
 }
Exemple #6
0
 public ComplaintRepository(IDataContextAsync context, IUnitOfWork unitOfWork) : base(context, unitOfWork)
 {
 }
Exemple #7
0
 public RepositoryAsync(IDataContextAsync <DbContext> dataContext, RepositoryOptions options)
     : base(dataContext, options)
 {
 }
 public UnitOfWork(IDataContextAsync context)
 {
     _context = (FaceDetectionContext)context;
 }
 public EntityFrameorkUnitOfWork(IDataContextAsync dataContext)
 {
     _dataContext  = dataContext;
     _repositories = new Dictionary <string, dynamic>();
 }
 public EFRepositoryString(IDataContextAsync context, IUnitOfWorkAsync unitOfWork)
     : base(context, unitOfWork)
 {
 }
 public UnitOfWork(IDataContextAsync context, ICurrentUser currentUser)
 {
     _context     = context;
     _currentUser = currentUser;
 }
Exemple #12
0
 public RepositoryAsync(IDataContextAsync <DbContext> dataContext, IConfiguration configuration)
     : this(dataContext, new RepositoryOptions() { Configuration = configuration })
 {
 }
Exemple #13
0
 public UnitOfWork(IDataContextAsync dataContext)
 {
     _dataContext = dataContext;
 }
Exemple #14
0
 public EntityRepository(IDataContextAsync context, IObjectMapper mapper) : base(context, mapper)
 {
 }
Exemple #15
0
 public RepositoryAsync(IDataContextAsync <DbContext> dataContext)
     : this(dataContext, new RepositoryOptions())
 {
 }
Exemple #16
0
 public BusinessRuleBase(IDataContextAsync dataContext)
     : base(dataContext)
 {
 }
Exemple #17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UnitOfWork" /> class.
 /// </summary>
 /// <param name="dataContext">The data context.</param>
 public UnitOfWork(IDataContextAsync dataContext)
 {
     this.dataContextAsync = dataContext;
     this.repositories     = new Dictionary <string, dynamic>();
 }
Exemple #18
0
 public LevelRepository(IDataContextAsync context, IUnitOfWorkAsync unitOfWork)
     : base(context, unitOfWork)
 {
 }
Exemple #19
0
 public UnitOfWork()
 {
     this._dataContext  = OMFAppContext.DataContextCreator();
     this._repositories = new Dictionary <string, object>();
 }
 public RepositoryAttributeValue(IDataContextAsync context, IUnitOfWorkAsync unitOfWork) : base(context, unitOfWork)
 {
 }
Exemple #21
0
 public UnitOfWork(IDataContextAsync dataContext)
 {
     this._dataContext  = dataContext;
     this._repositories = new Dictionary <string, object>();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CategoryRepository"/> class.
 /// </summary>
 /// <param name="context">
 /// The context.
 /// </param>
 /// <param name="unitOfWork">
 /// The unit of work.
 /// </param>
 public CategoryRepository(IDataContextAsync context, IUnitOfWorkAsync unitOfWork)
     : base(context, unitOfWork)
 {
 }
Exemple #23
0
 public Repository(IDataContextAsync context) : base(context)
 {
 }
 public void SetContext(IDataContextAsync DataContext)
 {
     this._dataContext = DataContext;
 }
Exemple #25
0
 public RepositoryTemplateAttribute(IDataContextAsync context, IUnitOfWorkAsync unitOfWork) : base(context, unitOfWork)
 {
 }
Exemple #26
0
 public Class1()
 {
     context = (IDataContextAsync)new docXEntities();
     uow = new UnitOfWork(context);
 }
Exemple #27
0
 public HomeController()
 {
     _applicationDataContextAsync = new ApplicationDataContext("ExistingDbCodeFirstDemo");
     _unitOfWork = new UnitOfWork(_applicationDataContextAsync);
     _existingTableRepository = new Repository <ExistingTable>(_applicationDataContextAsync, _unitOfWork);
 }
Exemple #28
0
 public Repository(IDataContextAsync context)
 {
     _context = context;
     _dbSet   = context.Set <TEntity>();
 }
Exemple #29
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SupplierRepository"/> class.
 /// </summary>
 /// <param name="context">
 /// The context.
 /// </param>
 /// <param name="unitOfWork">
 /// The unit of work.
 /// </param>
 public SupplierRepository(IDataContextAsync context, IUnitOfWorkAsync unitOfWork)
     : base(context, unitOfWork)
 {
 }
Exemple #30
0
 public UnitOfWork(IDataContextAsync dataContext)
 {
     _dataContext         = dataContext;
     _commandRepositories = new Dictionary <string, dynamic>();
 }
Exemple #31
0
 public CustomerRepository2(IDataContextAsync context, IObjectMapper mapper) : base(context, mapper)
 {
 }