public UserService(ImsContext context, UserManager <User> userManager, SignInManager <User> signInManager, IJwtGenerator jwtGenerator)
 {
     _context       = context;
     _signInManager = signInManager;
     _userManager   = userManager;
     _jwtGenerator  = jwtGenerator;
 }
Beispiel #2
0
 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));
 }
Beispiel #3
0
 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));
 }
Beispiel #4
0
        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();
        }
Beispiel #5
0
        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();
        }
Beispiel #6
0
        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();
        }
Beispiel #7
0
        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)
 {
 }
Beispiel #10
0
 public CourseService(ImsContext _context, IHttpContextAccessor httpContextAccessor)
     : base(_context, httpContextAccessor)
 {
 }
Beispiel #11
0
        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);
                }
            });
        }
Beispiel #12
0
 public FieldService(ImsContext _context, IHttpContextAccessor httpContextAccessor)
     : base(_context, httpContextAccessor)
 {
 }
Beispiel #13
0
 public BaseService(ImsContext context, IHttpContextAccessor httpContextAccessor)
 {
     _context             = context;
     _httpContextAccessor = httpContextAccessor;
     _entity = _context.Set <T>();
 }
 public GuardianTypeService(ImsContext context, IHttpContextAccessor httpContextAccessor) : base(context, httpContextAccessor)
 {
 }
Beispiel #15
0
 public StudentIdTypeService(ImsContext _context, IHttpContextAccessor httpContextAccessor)
     : base(_context, httpContextAccessor)
 {
 }
Beispiel #16
0
 public RequestManager(ImsContext context)
 {
     _context = context ?? throw new ArgumentNullException(nameof(context));
 }
 public BatchFeeTypeService(ImsContext _context, IHttpContextAccessor httpContextAccessor)
     : base(_context, httpContextAccessor)
 {
 }