public IEnumerable <string> SignUp(string email, string password, string firstName, string lastName, string phone, string country, string pin, bool interestStayUpdate, bool interestHelpOthers, bool interestConnectExpert, bool expert, string expertiseDomain, string organizationType, string organizationName, string jobTitle)
 {
     using (var db = _dbContext.GetDbContext())
     {
         return(db.USP_Account_InsertUpdate(email, password, firstName, lastName, phone, country, pin, interestStayUpdate, interestHelpOthers, interestConnectExpert, expert, expertiseDomain, organizationType, organizationName, jobTitle).ToList());
     }
 }
        public void ExecuteResetProcessedLogFileJob(int logFileId)
        {
            using (IDbContext dbContext = _dbContextFactory.GetDbContext())
            {
                ISetLogFileUnprocessedCommand cmd = new SetLogFileUnprocessedCommand(dbContext
                                                                                     , new JobRegistrationService()
                                                                                     );

                dbContext.BeginTransaction();
                cmd.Execute(logFileId);
                dbContext.Commit();
            }
        }
Ejemplo n.º 3
0
 public SuperMarketEntityDb(IDbContextFactory dbContextFactory)
 {
     _dbContext = dbContextFactory.GetDbContext();
     // Buradan istediğiniz gibi EntityFramework'ü konfigure edebilirsiniz.
     //_dbContext.Configuration.LazyLoadingEnabled = false;
     //_dbContext.Configuration.ValidateOnSaveEnabled = false;
     //_dbContext.Configuration.ProxyCreationEnabled = false;
 }
Ejemplo n.º 4
0
 public GenericRepository(IDbContextFactory factory)
 {
     if (factory == null)
     {
         throw new ArgumentNullException("factory");
     }
     this.Context = factory.GetDbContext();
 }
Ejemplo n.º 5
0
        public RepositoryBase(IDbContextFactory contextFactory, IExecutionContext executionContext)
        {
            context = contextFactory.GetDbContext <TDbContext>();
            dbSet   = context.Set <TModel>();
            this.executionContext = executionContext;

            var modelInterfaces = typeof(TModel).GetInterfaces();
        }
Ejemplo n.º 6
0
 public UnitOfWork(IDbContextFactory factory)
 {
     if (factory == null)
     {
         throw new ArgumentException("IDbContextFactory is null!.");
     }
     this._factory = factory;
     this._context = factory.GetDbContext();
 }
Ejemplo n.º 7
0
 public GenericRepository(IDbContextFactory factory)
 {
     if (factory == null)
     {
         throw new ArgumentException("IDbContextFactory is null!.");
     }
     this._factory = factory;
     this._context = factory.GetDbContext();
 }
Ejemplo n.º 8
0
        public virtual TContext GetDbContext()
        {
            var result = m_dbContextFactory.GetDbContext();

            if (GlobalConfiguration.Logger != null)
            {
                result.Database.Log = GlobalConfiguration.Logger;
            }
            return(result);
        }
 public virtual void Delete(T item)
 {
     using (var ctx = dbContextFactory.GetDbContext())
     {
         ctx.Set <T>().Remove(item);
         ctx.SaveChanges();
     }
 }
        protected override void ConfigureRequestContainer(TinyIoCContainer container, NancyContext context)
        {
            base.ConfigureRequestContainer(container, context);

            IAppSettings settings = container.Resolve <IAppSettings>();

            // register database context per request
            IDbContextFactory dbContextFactory = container.Resolve <IDbContextFactory>();

            container.Register <IDbContext>(dbContextFactory.GetDbContext());

            // validators
            container.Register <IUserValidator, UserValidator>();

            // repositories
            container.Register <ILogFileRepository, LogFileRepository>();
            container.Register <IProjectRepository, ProjectRepository>();
            container.Register <IRequestRepository, RequestRepository>();
            container.Register <IProjectRequestAggregateRepository, ProjectRequestAggregateRepository>();
            container.Register <IUserRepository, UserRepository>();

            // commands
            container.Register <ICreateLogFileCommand, CreateLogFileCommand>();
            container.Register <ICreateProjectCommand, CreateProjectCommand>();
            container.Register <ICreateProjectRequestAggregateCommand, CreateProjectRequestAggregateCommand>();
            container.Register <ICreateRequestBatchCommand, CreateRequestBatchCommand>();
            container.Register <ICreateUserCommand, CreateUserCommand>();
            container.Register <IDeleteLogFileCommand, DeleteLogFileCommand>();
            container.Register <IDeleteProjectCommand, DeleteProjectCommand>();
            container.Register <IDeleteProjectRequestAggregateCommand, DeleteProjectRequestAggregateCommand>();
            container.Register <IDeleteUserCommand, DeleteUserCommand>();
            container.Register <IProcessLogFileCommand, ProcessLogFileCommand>();
            container.Register <ISetLogFileUnprocessedCommand, SetLogFileUnprocessedCommand>();
            container.Register <IUpdateUserPasswordCommand, UpdateUserPasswordCommand>();

            // services
            container.Register <IJobRegistrationService, JobRegistrationService>();
            container.Register <IUserService, UserService>();

            container.Register <IUserMapper, UserMapper>();
        }
Ejemplo n.º 11
0
 public GenericRepository(IDbContextFactory contextFactory)
 {
     _context = contextFactory.GetDbContext <TDbContext>();
     _dbSet   = _context.Set <TEntity>();
 }
Ejemplo n.º 12
0
 public CountryContext(IDbContextFactory dbContextFactory)
 {
     _dbContext = dbContextFactory.GetDbContext();
 }
 public SqlSchemaInitializer(IDbContextFactory <TContext> dbContextFactory)
 {
     m_DbContext = dbContextFactory.GetDbContext();
 }
Ejemplo n.º 14
0
 public CountryContext(IDbContextFactory dbContextFactory)
 {
     _dbContext = dbContextFactory.GetDbContext();
 }
Ejemplo n.º 15
0
 public UserContext(IDbContextFactory dbContextFactory)
 {
     _dbContext = dbContextFactory.GetDbContext();
 }
Ejemplo n.º 16
0
 /// <summary>
 /// NOTE: repository getters instantiate repositories as needed (lazily)...
 ///       i wish I knew of IoC "way" of wiring up repository getters...
 /// </summary>
 /// <param name="dbContextFactory"></param>
 public UnitOfWork(IDbContextFactory dbContextFactory)
 {
     _dbContext = dbContextFactory.GetDbContext();
 }
Ejemplo n.º 17
0
 public PostContext(IDbContextFactory dbContextFactory)
 {
     _dbContext = dbContextFactory.GetDbContext();
 }
Ejemplo n.º 18
0
 public UnitOfWork(IDbContextFactory dbFactory)
 {
     _dbContext = dbFactory.GetDbContext();
 }
Ejemplo n.º 19
0
 public PostContext(IDbContextFactory dbContextFactory)
 {
     _dbContext = dbContextFactory.GetDbContext();
 }
 public override SchemaDbContext GetDbContext()
 {
     return(m_DbContextFactory.GetDbContext());
 }
Ejemplo n.º 21
0
 public SysConfigService(IDbContextFactory dbContextFactory, RepositoryOptions <SysConfigService> options)
 {
     _dbContext = dbContextFactory.GetDbContext(options.DbName);
 }
Ejemplo n.º 22
0
 /// <summary>
 /// 带有 DbContext子类 接口工厂方法的 构造函数;
 /// </summary>
 /// <param name="t"></param>
 public ControlFactory(IDbContextFactory <K> t) : this(() => { return(t.GetDbContext()); })
 {
 }
Ejemplo n.º 23
0
 public UserContext(IDbContextFactory dbContextFactory)
 {
     _dbContext = dbContextFactory.GetDbContext();
 }
Ejemplo n.º 24
0
 public UnitOfWork(IDbContextFactory contextFactory)
 {
     _context = contextFactory.GetDbContext <TDbContext>();
 }
Ejemplo n.º 25
0
 public EFDbContext GetDbContext()
 {
     return(factory.GetDbContext());
 }
Ejemplo n.º 26
0
        /// <summary>
        /// Gets the registration by email.
        /// </summary>
        /// <param name="email">The email.</param>
        /// <returns></returns>
        /// <exception cref="ApplicationException">Repository GetRegistrationByEmail</exception>
        public IUserRegistration GetRegistrationByEmail(string email)
        {
            try
            {
                using (
                    var dbContext = (PitalyticsEntities)dbContextFactory.GetDbContext())
                {
                    var aRecord = AccountQueries.getRegistrationByEmail(dbContext, email);

                    return(aRecord);
                }
            }
            catch (Exception e)
            {
                throw new ApplicationException("Repository GetRegistrationByEmail", e);
            }
        }
Ejemplo n.º 27
0
 public DelRepo(IDbContextFactory factory)
 {
     this.mDbContext = factory.GetDbContext();
 }
Ejemplo n.º 28
0
 /// <summary>
 /// 設定此Unit of work(UOF)的Context。
 /// </summary>
 /// <param name="context">設定UOF的context</param>
 public EFUnitOfWork(IDbContextFactory databaseFactory)
 {
     _databaseFactory = databaseFactory;
     _context         = _context ?? _databaseFactory.GetDbContext();
 }
Ejemplo n.º 29
0
 public RepositoryBase(IDbContextFactory factory) : this(factory.GetDbContext())
 {
 }
Ejemplo n.º 30
0
 public DbBasedAuthService(IDbContextFactory dbContextFactory, RepositoryOptions <DbBasedAuthService> options)
 {
     _dbContext = dbContextFactory.GetDbContext(options.DbName);
 }