Beispiel #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)));
     }
 }
Beispiel #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)));
     }
 }
Beispiel #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));
 }
Beispiel #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);
        }
Beispiel #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);
        }
 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);
        }
 public KanbanUSService(IMongoDBContext context)
 {
     _user = context.Database().GetCollection <KanbanUserStory>("userStoryKanban5");
 }
Beispiel #17
0
 public ListService(IMongoDBContext context)
 {
     _list = context.Database().GetCollection <List>("ListCollections2");
 }
Beispiel #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");
 }
Beispiel #20
0
 public TokenService(IMongoDBContext context)
 {
     _token = context.Database().GetCollection <Token>("Token");
 }
Beispiel #21
0
 public UsersService(IMongoDBContext context)
 {
     _user = context.Database().GetCollection <User>("Users");
 }
Beispiel #22
0
 public UsersService(IMongoDBContext context)
 {
     //   var client = new MongoClient(settings.ConnectionString);
     //   var database = client.GetDatabase(settings.DatabaseName);
     _user = context.Database().GetCollection <User>("Users");
 }
 public EpicIdZoneService(IMongoDBContext context)
 {
     //var client = new MongoClient(settings.ConnectionString);
     //var database = client.GetDatabase(settings.DatabaseName);
     _epic = context.Database().GetCollection <EpicsIdZone>("EpicsIdZoneCollection");
 }
Beispiel #24
0
 public ArticleService(IMongoDBContext context)
 {
     _collection = context.Database().GetCollection <Article>("Article");
 }
Beispiel #25
0
 public TaskService(IMongoDBContext context)
 {
     _user = context.Database().GetCollection <Tasks>("Tasks");
 }
Beispiel #26
0
 public EpicService(IMongoDBContext context)
 {
     _epic = context.Database().GetCollection <Epic>("EpicCollection");
 }
Beispiel #27
0
 public OrderController(IMongoDBContext mongoDBContext, IPermissionService permissionService)
 {
     _mongoDBContext    = mongoDBContext;
     _permissionService = permissionService;
     _orderDto          = _mongoDBContext.Database().GetCollection <OrderDto>(typeof(Core.Domain.Orders.Order).Name);
 }
Beispiel #28
0
 public AssignmentService(IMongoDBContext context)
 {
     _collection = context.Database().GetCollection <Assignment>("Assignment");
 }
Beispiel #29
0
 public LoggerActivityService(IMongoDBContext context)
 {
     _logger = context.Database().GetCollection <LoggerActivity>("LoggerActivityCollection");
 }
 public virtual IMongoQueryable <MessageTemplateDto> GetCategoryMessageTemplate()
 {
     return(_mongoDBContext.Database().GetCollection <MessageTemplateDto>(typeof(Core.Domain.Catalog.CategoryTemplate).Name).AsQueryable());
 }