示例#1
0
 public ShippingApiService(IMongoDBContext mongoDBContext)
 {
     _mongoDBContext    = mongoDBContext;
     _warehouseDto      = _mongoDBContext.Database().GetCollection <WarehouseDto>(typeof(Core.Domain.Shipping.Warehouse).Name);
     _deliveryDateDto   = _mongoDBContext.Database().GetCollection <DeliveryDateDto>(typeof(Core.Domain.Shipping.DeliveryDate).Name);
     _pickupPointDto    = _mongoDBContext.Database().GetCollection <PickupPointDto>(typeof(Core.Domain.Shipping.PickupPoint).Name);
     _shippingMethodDto = _mongoDBContext.Database().GetCollection <ShippingMethodDto>(typeof(Core.Domain.Shipping.ShippingMethod).Name);
 }
 public Task <IMongoQueryable <StateProvinceDto> > Handle(GetQuery <StateProvinceDto> request, CancellationToken cancellationToken)
 {
     if (string.IsNullOrEmpty(request.Id))
     {
         return(Task.FromResult(_mongoDBContext.Database().GetCollection <StateProvinceDto>(typeof(Domain.Directory.StateProvince).Name).AsQueryable()));
     }
     else
     {
         return(Task.FromResult(_mongoDBContext.Database().GetCollection <StateProvinceDto>(typeof(Domain.Directory.StateProvince).Name).AsQueryable().Where(x => x.Id == request.Id)));
     }
 }
 public Task <IMongoQueryable <MessageTemplateDto> > Handle(GetMessageTemplateQuery request, CancellationToken cancellationToken)
 {
     if (string.IsNullOrEmpty(request.Id))
     {
         return(Task.FromResult(_mongoDBContext.Database().GetCollection <MessageTemplateDto>(request.TemplateName).AsQueryable()));
     }
     else
     {
         return(Task.FromResult(_mongoDBContext.Database().GetCollection <MessageTemplateDto>(request.TemplateName).AsQueryable().Where(x => x.Id == request.Id)));
     }
 }
示例#4
0
 public Task <IMongoQueryable <LanguageDto> > Handle(GetQuery <LanguageDto> request, CancellationToken cancellationToken)
 {
     if (string.IsNullOrEmpty(request.Id))
     {
         return(Task.FromResult(_mongoDBContext.Database().GetCollection <LanguageDto>(typeof(Core.Domain.Localization.Language).Name).AsQueryable()));
     }
     else
     {
         return(Task.FromResult(_mongoDBContext.Database().GetCollection <LanguageDto>(typeof(Core.Domain.Localization.Language).Name).AsQueryable().Where(x => x.Id == request.Id)));
     }
 }
示例#5
0
 public async Task <PictureDto> Handle(GetPictureByIdQuery request, CancellationToken cancellationToken)
 {
     return(await _mongoDBContext.Database()
            .GetCollection <PictureDto>(typeof(Domain.Media.Picture).Name)
            .AsQueryable()
            .FirstOrDefaultAsync(x => x.Id == request.Id));
 }
示例#6
0
 public Task <IMongoQueryable <ManufacturerDto> > Handle(GetQuery <ManufacturerDto> request, CancellationToken cancellationToken)
 {
     if (string.IsNullOrEmpty(request.Id))
     {
         return(Task.FromResult(
                    _mongoDBContext.Database()
                    .GetCollection <ManufacturerDto>
                        (typeof(Domain.Catalog.Manufacturer).Name)
                    .AsQueryable()));
     }
     else
     {
         return(Task.FromResult(_mongoDBContext.Database()
                                .GetCollection <ManufacturerDto>(typeof(Domain.Catalog.Manufacturer).Name)
                                .AsQueryable()
                                .Where(x => x.Id == request.Id)));
     }
 }
        public IActionResult RunScript(string query)
        {
            if (string.IsNullOrEmpty(query))
                return Json(new { Result = false, Message = "Empty query!" });

            try
            {
                var bscript = new BsonJavaScript(query);
                var operation = new EvalOperation(_mongoDBContext.Database().DatabaseNamespace, bscript, null);
                var writeBinding = new WritableServerBinding(_mongoDBContext.Database().Client.Cluster, NoCoreSession.NewHandle());
                var result = operation.Execute(writeBinding, CancellationToken.None);
                var xx = result["_ns"];
                return Json(new { Result = true, Message = result.ToString() });
            }
            catch (Exception ex)
            {
                return Json(new { Result = false, Message = ex.Message });
            }
        }
        public ProductAttributeApiService(IMongoDBContext mongoDBContext, IProductAttributeService productAttributeService,
                                          ICustomerActivityService customerActivityService, ILocalizationService localizationService)
        {
            _mongoDBContext          = mongoDBContext;
            _productAttributeService = productAttributeService;
            _customerActivityService = customerActivityService;
            _localizationService     = localizationService;

            _productAttribute = _mongoDBContext.Database().GetCollection <ProductAttributeDto>(typeof(Core.Domain.Catalog.ProductAttribute).Name);
        }
        public CustomerRoleApiService(IMongoDBContext mongoDBContext, ICustomerService customerService,
                                      ICustomerActivityService customerActivityService, ILocalizationService localizationService)
        {
            _mongoDBContext          = mongoDBContext;
            _customerService         = customerService;
            _customerActivityService = customerActivityService;
            _localizationService     = localizationService;

            _customerRole = _mongoDBContext.Database().GetCollection <CustomerRoleDto>(typeof(Core.Domain.Customers.CustomerRole).Name);
        }
示例#10
0
        public SpecificationAttributeApiService(IMongoDBContext mongoDBContext, ISpecificationAttributeService specificationAttributeService,
                                                ILocalizationService localizationService, ICustomerActivityService customerActivityService)
        {
            _mongoDBContext = mongoDBContext;
            _specificationAttributeService = specificationAttributeService;
            _localizationService           = localizationService;
            _customerActivityService       = customerActivityService;

            _specificationAttribute = _mongoDBContext.Database().GetCollection <SpecificationAttributeDto>(typeof(Core.Domain.Catalog.SpecificationAttribute).Name);
        }
 public CustomerApiService(IMongoDBContext mongoDBContext, ICustomerService customerService, IGenericAttributeService genericAttributeService,
                           ICustomerActivityService customerActivityService, ILocalizationService localizationService)
 {
     _mongoDBContext          = mongoDBContext;
     _customerService         = customerService;
     _genericAttributeService = genericAttributeService;
     _customerActivityService = customerActivityService;
     _localizationService     = localizationService;
     _vendor = _mongoDBContext.Database().GetCollection <VendorDto>(typeof(Core.Domain.Vendors.Vendor).Name);
 }
        public ManufacturerApiService(IMongoDBContext mongoDBContext, IManufacturerService manufacturerService, IUrlRecordService urlRecordService, IPictureService pictureService,
                                      ICustomerActivityService customerActivityService, ILocalizationService localizationService)
        {
            _mongoDBContext          = mongoDBContext;
            _manufacturerService     = manufacturerService;
            _urlRecordService        = urlRecordService;
            _pictureService          = pictureService;
            _customerActivityService = customerActivityService;
            _localizationService     = localizationService;

            _manufacturer = _mongoDBContext.Database().GetCollection <ManufacturerDto>(typeof(Core.Domain.Catalog.Manufacturer).Name);
        }
        public CategoryApiService(IMongoDBContext mongoDBContext, ICategoryService categoryService, IUrlRecordService urlRecordService, IPictureService pictureService,
                                  ICustomerActivityService customerActivityService, ILocalizationService localizationService)
        {
            _mongoDBContext          = mongoDBContext;
            _categoryService         = categoryService;
            _urlRecordService        = urlRecordService;
            _pictureService          = pictureService;
            _customerActivityService = customerActivityService;
            _localizationService     = localizationService;

            _category = _mongoDBContext.Database().GetCollection <CategoryDto>(typeof(Core.Domain.Catalog.Category).Name);
        }
示例#14
0
 public CommonApiService(IMongoDBContext mongoDBContext, IPictureService pictureService)
 {
     _mongoDBContext   = mongoDBContext;
     _pictureService   = pictureService;
     _languageDto      = _mongoDBContext.Database().GetCollection <LanguageDto>(typeof(Core.Domain.Localization.Language).Name);
     _currencyDto      = _mongoDBContext.Database().GetCollection <CurrencyDto>(typeof(Core.Domain.Directory.Currency).Name);
     _storeDto         = _mongoDBContext.Database().GetCollection <StoreDto>(typeof(Core.Domain.Stores.Store).Name);
     _countryDto       = _mongoDBContext.Database().GetCollection <CountryDto>(typeof(Core.Domain.Directory.Country).Name);
     _stateProvinceDto = _mongoDBContext.Database().GetCollection <StateProvinceDto>(typeof(Core.Domain.Directory.StateProvince).Name);
     _pictureDto       = _mongoDBContext.Database().GetCollection <PictureDto>(typeof(Core.Domain.Media.Picture).Name);
 }
        public ProductApiService(IMongoDBContext mongoDBContext, IProductService productService, ICategoryService categoryService, IManufacturerService manufacturerService,
                                 IPictureService pictureService, ISpecificationAttributeService specificationAttributeService, IUrlRecordService urlRecordService,
                                 IBackInStockSubscriptionService backInStockSubscriptionService, ICustomerActivityService customerActivityService, ILocalizationService localizationService)
        {
            _mongoDBContext                 = mongoDBContext;
            _productService                 = productService;
            _categoryService                = categoryService;
            _manufacturerService            = manufacturerService;
            _pictureService                 = pictureService;
            _specificationAttributeService  = specificationAttributeService;
            _urlRecordService               = urlRecordService;
            _backInStockSubscriptionService = backInStockSubscriptionService;
            _customerActivityService        = customerActivityService;
            _localizationService            = localizationService;

            _product = _mongoDBContext.Database().GetCollection <ProductDto>(typeof(Core.Domain.Catalog.Product).Name);
        }
示例#16
0
 public KanbanUSService(IMongoDBContext context)
 {
     _user = context.Database().GetCollection <KanbanUserStory>("userStoryKanban5");
 }
示例#17
0
 public ListService(IMongoDBContext context)
 {
     _list = context.Database().GetCollection <List>("ListCollections2");
 }
示例#18
0
 public ReportService(IMongoDBContext context)
 {
     _report = context.Database().GetCollection <Report>("test10");
 }
 public PrivateSpaceService(IMongoDBContext context)
 {
     //var client = new MongoClient(settings.ConnectionString);
     //var database = client.GetDatabase(settings.DatabaseName);
     _privateSpace = context.Database().GetCollection <PrivateSpace>("PrivateSpaceCollection");
 }
示例#20
0
 public TokenService(IMongoDBContext context)
 {
     _token = context.Database().GetCollection <Token>("Token");
 }
示例#21
0
 public UsersService(IMongoDBContext context)
 {
     _user = context.Database().GetCollection <User>("Users");
 }
示例#22
0
 public UsersService(IMongoDBContext context)
 {
     //   var client = new MongoClient(settings.ConnectionString);
     //   var database = client.GetDatabase(settings.DatabaseName);
     _user = context.Database().GetCollection <User>("Users");
 }
示例#23
0
 public EpicIdZoneService(IMongoDBContext context)
 {
     //var client = new MongoClient(settings.ConnectionString);
     //var database = client.GetDatabase(settings.DatabaseName);
     _epic = context.Database().GetCollection <EpicsIdZone>("EpicsIdZoneCollection");
 }
示例#24
0
 public ArticleService(IMongoDBContext context)
 {
     _collection = context.Database().GetCollection <Article>("Article");
 }
示例#25
0
 public TaskService(IMongoDBContext context)
 {
     _user = context.Database().GetCollection <Tasks>("Tasks");
 }
示例#26
0
 public EpicService(IMongoDBContext context)
 {
     _epic = context.Database().GetCollection <Epic>("EpicCollection");
 }
示例#27
0
 public OrderController(IMongoDBContext mongoDBContext, IPermissionService permissionService)
 {
     _mongoDBContext    = mongoDBContext;
     _permissionService = permissionService;
     _orderDto          = _mongoDBContext.Database().GetCollection <OrderDto>(typeof(Core.Domain.Orders.Order).Name);
 }
示例#28
0
 public AssignmentService(IMongoDBContext context)
 {
     _collection = context.Database().GetCollection <Assignment>("Assignment");
 }
示例#29
0
 public LoggerActivityService(IMongoDBContext context)
 {
     _logger = context.Database().GetCollection <LoggerActivity>("LoggerActivityCollection");
 }
示例#30
0
 public virtual IMongoQueryable <MessageTemplateDto> GetCategoryMessageTemplate()
 {
     return(_mongoDBContext.Database().GetCollection <MessageTemplateDto>(typeof(Core.Domain.Catalog.CategoryTemplate).Name).AsQueryable());
 }