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(); } }
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; }
public GenericRepository(IDbContextFactory factory) { if (factory == null) { throw new ArgumentNullException("factory"); } this.Context = factory.GetDbContext(); }
public RepositoryBase(IDbContextFactory contextFactory, IExecutionContext executionContext) { context = contextFactory.GetDbContext <TDbContext>(); dbSet = context.Set <TModel>(); this.executionContext = executionContext; var modelInterfaces = typeof(TModel).GetInterfaces(); }
public UnitOfWork(IDbContextFactory factory) { if (factory == null) { throw new ArgumentException("IDbContextFactory is null!."); } this._factory = factory; this._context = factory.GetDbContext(); }
public GenericRepository(IDbContextFactory factory) { if (factory == null) { throw new ArgumentException("IDbContextFactory is null!."); } this._factory = factory; this._context = factory.GetDbContext(); }
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>(); }
public GenericRepository(IDbContextFactory contextFactory) { _context = contextFactory.GetDbContext <TDbContext>(); _dbSet = _context.Set <TEntity>(); }
public CountryContext(IDbContextFactory dbContextFactory) { _dbContext = dbContextFactory.GetDbContext(); }
public SqlSchemaInitializer(IDbContextFactory <TContext> dbContextFactory) { m_DbContext = dbContextFactory.GetDbContext(); }
public UserContext(IDbContextFactory dbContextFactory) { _dbContext = dbContextFactory.GetDbContext(); }
/// <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(); }
public PostContext(IDbContextFactory dbContextFactory) { _dbContext = dbContextFactory.GetDbContext(); }
public UnitOfWork(IDbContextFactory dbFactory) { _dbContext = dbFactory.GetDbContext(); }
public override SchemaDbContext GetDbContext() { return(m_DbContextFactory.GetDbContext()); }
public SysConfigService(IDbContextFactory dbContextFactory, RepositoryOptions <SysConfigService> options) { _dbContext = dbContextFactory.GetDbContext(options.DbName); }
/// <summary> /// 带有 DbContext子类 接口工厂方法的 构造函数; /// </summary> /// <param name="t"></param> public ControlFactory(IDbContextFactory <K> t) : this(() => { return(t.GetDbContext()); }) { }
public UnitOfWork(IDbContextFactory contextFactory) { _context = contextFactory.GetDbContext <TDbContext>(); }
public EFDbContext GetDbContext() { return(factory.GetDbContext()); }
/// <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); } }
public DelRepo(IDbContextFactory factory) { this.mDbContext = factory.GetDbContext(); }
/// <summary> /// 設定此Unit of work(UOF)的Context。 /// </summary> /// <param name="context">設定UOF的context</param> public EFUnitOfWork(IDbContextFactory databaseFactory) { _databaseFactory = databaseFactory; _context = _context ?? _databaseFactory.GetDbContext(); }
public RepositoryBase(IDbContextFactory factory) : this(factory.GetDbContext()) { }
public DbBasedAuthService(IDbContextFactory dbContextFactory, RepositoryOptions <DbBasedAuthService> options) { _dbContext = dbContextFactory.GetDbContext(options.DbName); }