public void AccountManagerContextTest() { var _configuration = new ConfigurationBuilder() .SetBasePath(AssemblyProperties.AssemblyDirectory) .AddJsonFile("appsettings.json") .Build(); var optionsBuilder = new DbContextOptionsBuilder <AccountManagerContext>(); optionsBuilder.UseSqlServer(_configuration.GetConnectionString("AccountManagerLocalDB")); var dbContext = new AccountManagerContext(optionsBuilder.Options); Assert.IsNotNull(dbContext); }
public BalanceDataService(DbContextOptionsBuilder <AccountManagerContext> optionsBuilder) { dbContext = new AccountManagerContext(optionsBuilder.Options); // custom mapper var config = new MapperConfiguration(cfg => { cfg.CreateMap <Balance, BalanceDTO>() .ForMember(dest => dest.MonthSort, source => source.MapFrom(source => source.Date.Month)) .ForMember(dest => dest.MonthName, source => source.MapFrom(source => (new DateTimeFormatInfo()).GetMonthName(source.Date.Month))) .ReverseMap(); }); mapper = config.CreateMapper(); }
private void SeedDB() { using AccountManagerContext context = new AccountManagerContext(_options); var accounts = new List <Account> { new Account { ID = 1, DomainName = "domain1", AccountName = "Account1", Password = "******" }, new Account { ID = 2, DomainName = "domain1", AccountName = "Account2", Password = "******" }, new Account { ID = 3, DomainName = "domain2", AccountName = "Account1", Password = "******" }, new Account { ID = 4, DomainName = "domain2", AccountName = "Account3", Password = "******" }, }; context.Account.AddRange(accounts); context.SaveChanges(); }
public SubscriptionRepository(AccountManagerContext context) { _context = context; }
public DatabaseService(AccountManagerContext dbContext) { _dbContext = dbContext; }
public AccountDetailRepository(AccountManagerContext dbContext) : base(dbContext) { }
public ExpenseRepository(AccountManagerContext context) { _context = context; }
public SettingsController() { Context = new AccountManagerContext(); }
public CreditNoteRepository(AccountManagerContext context) { _context = context; }
public PaymentDetailsRepository(AccountManagerContext context) { _context = context; }
public HomeController() { Context = new AccountManagerContext(); }
public AccountRepository(AccountManagerContext dataContext) : base(dataContext) { }
public TaxInformationRepository(AccountManagerContext context) { _context = context; }
public EmployeeRepository(AccountManagerContext context) { _context = context; }
public UnitOfWork(AccountManagerContext dataContext) { _dataContext = dataContext; }
public CustomerRepository(AccountManagerContext context) { _context = context; }
public MainController() { Context = new AccountManagerContext(); }
public RepositoryBase(AccountManagerContext dataContext) { _dataContext = dataContext; _dbset = dataContext.Set <TEntity>(); }
public ExpenseService(AccountManagerContext context, IMapper mapper, ICloudService cloudService) { this.context = context; this.mapper = mapper; this.cloudService = cloudService; }
public TransactionRepository(AccountManagerContext dataContext) : base(dataContext) { }
public VoucherRepository(AccountManagerContext context) { _context = context; }
public InvoiceLineRepository(AccountManagerContext context) { _context = context; }
public HolidayRepository(AccountManagerContext context) { _context = context; }
public EstimateLineRepository(AccountManagerContext context) { _context = context; }
public CategoryService(AccountManagerContext context, IMapper mapper) { this.context = context; this.mapper = mapper; }
public SalesReceiptLineRepository(AccountManagerContext context) { _context = context; }
public SupplierRepository(AccountManagerContext context) { _context = context; }
public PaymentBillingRepository(AccountManagerContext context) { _context = context; }
public AccountRepository(AccountManagerContext context) { _context = context; }
public Repository(AccountManagerContext acContext) { _db = acContext; }