public VacationContext init()
        {
            if (context == null)
            {
                var    optionsBuilder     = new DbContextOptionsBuilder <VacationContext>();
                string mySqlConnectionStr = "server=localhost; port=3306; database=vacationtask; user=root; password=; Persist Security Info=False; Connect Timeout=300";
                optionsBuilder.UseMySql(mySqlConnectionStr);

                _context = new VacationContext(optionsBuilder.Options);
                return(_context);
            }

            return(context);
        }
Example #2
0
 public VacationRepository(IDbFactory dbFactory)
 {
     this.dbFactory = dbFactory;
     this._context  = dbFactory.init();
 }
 public EmployeeRepository(VacationContext context) : base(context)
 {
 }
Example #4
0
 //public IDbFactory DbFactory { get; }
 public UnitOfWork(IDbFactory dbFactory, VacationContext context)
 {
     this.dbFactory = dbFactory;
     this._context  = dbFactory.init();
 }
 public EmployeeRequestRepository(IDbFactory dbfactory)
 {
     this.dbFactory = dbfactory;
     this._context  = dbFactory.init();
 }
 public EmployeeBalanceRepository(IDbFactory dbFactory)
 {
     this.dbFactory = dbFactory;
     this._context  = dbFactory.init();
 }
 public VacationController(VacationContext context)
 {
     _context = context;
 }
Example #8
0
 //public IDbFactory DbFactory { get; }
 public UnitOfWork(IDbFactory dbFactory)
 {
     this.dbFactory = dbFactory;
     this._context  = dbFactory.init();
 }
Example #9
0
 public CompanyHolidayRepository(VacationContext context) : base(context)
 {
 }
 public RepositoryBase(VacationContext context)
 {
     _dbContext = context;
 }
 public VacationPolicyRepository(VacationContext context) : base(context)
 {
 }
Example #12
0
 public QueryHandler(VacationContext db) => _db = db;
Example #13
0
 public VacationRequestRepository(VacationContext context) : base(context)
 {
 }