public InvoiceBusinessLogic(UnitOfWork uow, DetailLineBusinessLogic detailLineBusinessLogic, CustomerBusinessLogic customerBusinessLogic, ProductBusinessLogic productBusinessLogic) { _uow = uow; _detailLineBusinessLogic = detailLineBusinessLogic; _customerBusinessLogic = customerBusinessLogic; _productBusinessLogic = productBusinessLogic; }
public ProductController(IProductBusinessLogic productBusinessLogic, IProductImagesBusinessLogic productImagesBusinessLogic, IMapper mapper) { _mapper = mapper; _productBusinessLogic = productBusinessLogic; _productImagesBusinessLogic = productImagesBusinessLogic; }
public CatalogController(IProductBusinessLogic productBusinessLogic, IProductImagesBusinessLogic productImagesBusinessLogic, IMapper mapper, WebStoreDbContext context) { _mapper = mapper; _context = context; _productBusinessLogic = productBusinessLogic; _productImagesBusinessLogic = productImagesBusinessLogic; }
public void Initialize() { try { Mapper.Configuration.AssertConfigurationIsValid(); } catch (Exception) { Mapper.Initialize(config => { config.AddProfile <RCE.Application.MapperProfile>(); }); } _products = new List <ProductDTO> { new ProductDTO { Id = Guid.NewGuid(), CreatedDate = DateTime.Now, Name = "KAMAZ", TypeId = Guid.NewGuid() }, new ProductDTO { Id = Guid.NewGuid(), CreatedDate = DateTime.Now, Name = "BULDOZER", TypeId = Guid.NewGuid() } }; var mockQueryService = new Mock <IProductQueryService>(); mockQueryService.Setup(service => service.GetAll()).Returns(_products); var mockRepository = new Mock <IProductRepository>(); mockRepository.Setup(service => service.FindById(It.IsAny <Guid>())).Returns(Mapper.Map <Product>(_products[0])); mockRepository.Setup(service => service.Remove(It.IsAny <Guid>())).Callback((Guid id) => { var removeItem = _products.FirstOrDefault(m => m.Id == id); _products.Remove(removeItem); }); mockRepository.Setup(service => service.Save(It.IsAny <Product>())).Callback((Product item) => { if (item.Id == Guid.Empty) { item.Id = Guid.NewGuid(); _products.Add(Mapper.Map <ProductDTO>(item)); } else { var entity = _products.FirstOrDefault(m => m.Id == item.Id); entity.Name = item.Name; entity.TypeId = item.TypeId; } }); _productBusinessLogic = new BaseProductBusinessLogic(mockQueryService.Object, mockRepository.Object); }
public ProductService(DataSource dataSource) { IDataAccessFactory dataAccessFactory; if (dataSource == DataSource.Database) { dataAccessFactory = new DbDataAccessFactory(); } else { dataAccessFactory = new XmlDataAccessFactory(); } _productBusinessLogic = new ProductBusinessLogic(dataAccessFactory); }
public SearchController(IEmployeeBusinessLogic employeeBusinessLogic, UserManager <IdentityUser> userManager, IProductBusinessLogic productBusinessLogic, IProductTypeBusinessLogic productTypeBusinessLogic, IProductMetalBusinessLogic productMetalBusinessLogic, IProductColorBusinessLogic productColorBusinessLogic, IGenderBusinessLogic genderBusinessLogic) { _employeeBusinessLogic = employeeBusinessLogic; _userManager = userManager; _productBusinessLogic = productBusinessLogic; _productTypeBusinessLogic = productTypeBusinessLogic; _productMetalBusinessLogic = productMetalBusinessLogic; _productColorBusinessLogic = productColorBusinessLogic; _genderBusinessLogic = genderBusinessLogic; }
public ProductController(IProductBusinessLogic productBL, IProductManager productM) { _productLogic = productBL; _productManager = productM; }
public ProductService(IProductBusinessLogic productBusinessLogic) { _productBusinessLogic = productBusinessLogic; }
public FilterController(WebStoreDbContext context, IProductBusinessLogic productBusinessLogic, IMapper mapper) { _context = context; _productBusinessLogic = productBusinessLogic; _mapper = mapper; }
public ProductsController(IProductBusinessLogic productBusinessLogic) { _productBusinessLogic = productBusinessLogic; }
public ProductController(IProductBusinessLogic businessLogic) { _businessLogic = businessLogic; }
public ProductController(IProductsService productsService, IProductBusinessLogic productBusinessLogic) { _productsService = productsService; _productBusinessLogic = productBusinessLogic; }
public ProductController(ProductBusinessLogic productLogic) { _productLogic = productLogic; }
public ProductController(IProductBusinessLogic productBusinessLogic) { this.productBusinessLogic = productBusinessLogic; }
public ProductController(IProductBusinessLogic productBL) { _productBL = productBL; }