public UserService(ImsContext context, UserManager <User> userManager, SignInManager <User> signInManager, IJwtGenerator jwtGenerator) { _context = context; _signInManager = signInManager; _userManager = userManager; _jwtGenerator = jwtGenerator; }
public TransactionBehaviour(ImsContext dbContext, IImsIntegrationEventService orderingIntegrationEventService, ILogger <TransactionBehaviour <TRequest, TResponse> > logger) { _dbContext = dbContext ?? throw new ArgumentException(nameof(ImsContext)); _imsIntegrationEventService = orderingIntegrationEventService ?? throw new ArgumentException(nameof(orderingIntegrationEventService)); _logger = logger ?? throw new ArgumentException(nameof(ILogger)); }
public ImsIntegrationEventService(IEventBus eventBus, ImsContext imsContexts, IntegrationEventLogContext eventLogContext, Func <DbConnection, IIntegrationEventLogService> integrationEventLogServiceFactory, ILogger <ImsIntegrationEventService> logger) { _imsContext = imsContexts ?? throw new ArgumentNullException(nameof(imsContexts)); _integrationEventLogServiceFactory = integrationEventLogServiceFactory ?? throw new ArgumentNullException(nameof(integrationEventLogServiceFactory)); _eventBus = eventBus ?? throw new ArgumentNullException(nameof(eventBus)); _eventLogService = _integrationEventLogServiceFactory(_imsContext.Database.GetDbConnection()); _logger = logger ?? throw new ArgumentNullException(nameof(logger)); }
private void ImportCurrencies(ImsContext context) { var currencies = GetJson <Dictionary <string, string> >(Path.Combine(_contentRootPath, "Infrastructure", "Data", "Import", "currencies.json")); foreach (var currency in currencies) { context.Set <InvestmentTool>().Add(new InvestmentTool(currency.Key, currency.Value, string.Empty, InvestmentToolType.Currency.EnumId)); } context.SaveChanges(); }
private void ImportEmtias(ImsContext context) { var emtias = GetJson <List <GoldSeed> >(Path.Combine(_contentRootPath, "Infrastructure", "Data", "Import", "emtias.json")); foreach (var emtia in emtias) { var country = context.Set <Country>().FirstOrDefault(c => c.Code == "TR"); var investmentTool = new InvestmentTool(emtia.Name, emtia.Title, "", InvestmentToolType.Emtia.EnumId); context.Set <InvestmentTool>().Add(investmentTool); } context.SaveChanges(); }
private void ImportStocks(ImsContext context) { var stocks = GetJson <List <StockSeed> >(Path.Combine(_contentRootPath, "Infrastructure", "Data", "Import", "stocks.json")); foreach (var stock in stocks) { var country = context.Set <Country>().FirstOrDefault(c => c.Code == "TR"); var investmentTool = new InvestmentTool(stock.Code, stock.Name, "", InvestmentToolType.Stock.EnumId); context.Set <InvestmentTool>().Add(investmentTool); } context.SaveChanges(); }
private void ImportCountries(ImsContext context) { var countries = GetJson <List <CountrySeed> >(Path.Combine(_contentRootPath, "Infrastructure", "Data", "Import", "countries.json")); foreach (var country in countries) { var currency = context.Set <InvestmentTool>().FirstOrDefault(i => i.InvestmentToolTypeId == InvestmentToolType.Currency.EnumId && i.Code == country.CurrencyCode); context.Set <Country>().Add(new Country(country.CountryCode, country.CountryName, currency?.Id)); } context.SaveChanges(); }
public BranchService(ImsContext _context, IHttpContextAccessor httpContextAccessor) : base(_context, httpContextAccessor) { }
public StudentService(ImsContext context, IHttpContextAccessor httpContextAccessor) : base(context, httpContextAccessor) { }
public CourseService(ImsContext _context, IHttpContextAccessor httpContextAccessor) : base(_context, httpContextAccessor) { }
public async Task SeedAsync(ImsContext context, IOptions <ApplicationSettings> settings, ILogger <ImsContextSeed> logger) { _logger = logger; var contentRootPath = Directory.GetCurrentDirectory(); var policy = CreatePolicy(logger, nameof(ImsContextSeed)); await policy.ExecuteAsync(async() => { var useCustomizationData = settings.Value.UseCustomizationData; using (context) { context.Database.Migrate(); foreach (var storeType in Enumeration.GetAll <StoreType>()) { if (!context.StoreTypes.Any(x => x.EnumId == storeType.EnumId)) { await context.StoreTypes.AddAsync(storeType); await context.SaveChangesAsync(); } } foreach (var accountType in Enumeration.GetAll <AccountType>()) { if (!context.AccountTypes.Any(x => x.EnumId == accountType.EnumId)) { await context.AccountTypes.AddAsync(accountType); await context.SaveChangesAsync(); } } foreach (var directionType in Enumeration.GetAll <DirectionType>()) { if (!context.DirectionTypes.Any(x => x.EnumId == directionType.EnumId)) { await context.DirectionTypes.AddAsync(directionType); await context.SaveChangesAsync(); } } foreach (var investmentToolType in Enumeration.GetAll <InvestmentToolType>()) { if (!context.InvestmentToolTypes.Any(x => x.EnumId == investmentToolType.EnumId)) { await context.InvestmentToolTypes.AddAsync(investmentToolType); await context.SaveChangesAsync(); } } foreach (var transactionType in Enumeration.GetAll <TransactionType>()) { if (!context.TransactionTypes.Any(x => x.EnumId == transactionType.EnumId)) { await context.TransactionTypes.AddAsync(transactionType); await context.SaveChangesAsync(); } } //ImportCurrencies(context); //ImportCountries(context); //ImportStocks(context); //ImportGolds(context); //ImportEmtias(context); } }); }
public FieldService(ImsContext _context, IHttpContextAccessor httpContextAccessor) : base(_context, httpContextAccessor) { }
public BaseService(ImsContext context, IHttpContextAccessor httpContextAccessor) { _context = context; _httpContextAccessor = httpContextAccessor; _entity = _context.Set <T>(); }
public GuardianTypeService(ImsContext context, IHttpContextAccessor httpContextAccessor) : base(context, httpContextAccessor) { }
public StudentIdTypeService(ImsContext _context, IHttpContextAccessor httpContextAccessor) : base(_context, httpContextAccessor) { }
public RequestManager(ImsContext context) { _context = context ?? throw new ArgumentNullException(nameof(context)); }
public BatchFeeTypeService(ImsContext _context, IHttpContextAccessor httpContextAccessor) : base(_context, httpContextAccessor) { }