コード例 #1
0
 public OrderBusinessContext()
 {
     orderDataBaseContext   = new OrderDatabaseContext();
     addressDatabaseContext = new AddressDatabaseContext();
     cartDataBaseContext    = new CartDatabaseContext();
     productDatabaseContext = new ProductDatabaseContext();
 }
コード例 #2
0
        public BaseTest()
        {
            DbContextOptionsBuilder <OrderDatabaseContext> orderBuilder = new DbContextOptionsBuilder <OrderDatabaseContext>();
            var connectionString = "server=localhost;userid=root;password=123456;database=Product;";

            orderBuilder.UseMySql(connectionString);
            //.UseInternalServiceProvider(serviceProvider); //burası postgress ile sıkıntı çıkartmıyor, fakat mysql'de çalışmıyor test esnasında hata veriyor.

            _orderDatabaseContext = new OrderDatabaseContext(orderBuilder.Options);
            //_context.Database.Migrate();

            //Configuration
            iHttpContextAccessor = new HttpContextAccessor {
                HttpContext = new DefaultHttpContext()
            };
            _orderSettings = Options.Create(new OrderSettings()
            {
                FileUploadFolderPath = @"C:\Users\haltunbas\Documents\GitHub\ProductV2\Product.Api\Product.Api\wwwroot\upload\"
            });

            _orderService        = new OrderService(_orderDatabaseContext, _orderSettings, iHttpContextAccessor);
            _orderItemService    = new OrderItemService(_orderDatabaseContext, _orderSettings, iHttpContextAccessor);
            orderSchemaService   = new OrderSchemaService(_orderDatabaseContext, _orderSettings, iHttpContextAccessor);
            _orderAddressService = new OrderAddressService(_orderDatabaseContext, _orderSettings, iHttpContextAccessor);
        }
コード例 #3
0
 public OrderService(OrderDatabaseContext orderDatabaseContext, IOptions <OrderSettings> orderSettings, IHttpContextAccessor iHttpContextAccessor)
 {
     _ordertSettings         = orderSettings;
     _orderDatabaseContext   = orderDatabaseContext;
     _orderRepository        = new OrderRepository(orderDatabaseContext, orderSettings, iHttpContextAccessor);
     _orderItemRepository    = new OrderItemRepository(orderDatabaseContext, orderSettings, iHttpContextAccessor);
     _orderAddressRepository = new OrderAddressRepository(orderDatabaseContext, orderSettings, iHttpContextAccessor);
 }
コード例 #4
0
 public OrderSchemaService(OrderDatabaseContext orderDatabaseContext, IOptions <OrderSettings> productSettings, IHttpContextAccessor iHttpContextAccessor)
 {
     _orderDatabaseContext = orderDatabaseContext;
     _schemaRepository     = new OrderSchemaRepository(_orderDatabaseContext, productSettings, iHttpContextAccessor);
 }
コード例 #5
0
 public OrderItemService(OrderDatabaseContext orderDatabaseContext, IOptions <OrderSettings> productSettings, IHttpContextAccessor iHttpContextAccessor)
 {
     _ordertSettings       = productSettings;
     _orderDatabaseContext = orderDatabaseContext;
     _orderItemRepository  = new OrderItemRepository(orderDatabaseContext, productSettings, iHttpContextAccessor);
 }