public CustomerController(UnitOfWork unitOfWork, IEmailGateway emailGateway) { _unitOfWork = unitOfWork; _customerRepository = new CustomerRepository(unitOfWork); _industryRepository = new IndustryRepository(unitOfWork); _emailGateway = emailGateway; }
public HttpResponseMessage IndustryOfClient(int id) { IndustryRepository _repo = new IndustryRepository(); try { IEnumerable <int> list = _repo.IndustriesOfClient(id); return(Request.CreateResponse(HttpStatusCode.OK, list)); } catch (Exception ex) { return(Request.CreateResponse(HttpStatusCode.BadRequest)); } }
public HttpResponseMessage ListIndustries() { IndustryRepository _repo = new IndustryRepository(); try { IEnumerable <Industry> list = _repo.ListOfIndustries(); return(Request.CreateResponse(HttpStatusCode.OK, list)); } catch (Exception ex) { return(Request.CreateResponse(HttpStatusCode.BadRequest)); //return StatusCode(HttpStatusCode.BadRequest); } }
public Customer CreateCustomer(string industryName = null, CustomerStatus?status = null) { using (var unitOfWork = new UnitOfWork()) { Industry industry = new IndustryRepository(unitOfWork).GetByName(industryName ?? "Cars").Value; var customer = new Customer((CustomerName)"Customer Name", (Email)"*****@*****.**", null, industry); if (status == CustomerStatus.Gold) { customer.Promote(); customer.Promote(); } new CustomerRepository(unitOfWork).Save(customer); unitOfWork.Commit(); return(customer); } }
public UnitOfWork(ApplicationDbContext context) { _context = context; GigsRepository = new GigRepository(context); InfluencerRepository = new InfluencerRepository(context); SpecificIndustryRepository = new SpecificIndustryRepository(context); FavouriteGigRepository = new FavouriteGigRepository(context); FavouriteInfluencerRepository = new FavouriteInfluencerRepository(context); ApplicationUserRepository = new ApplicationUserRepository(context); BasicPackageRepository = new BasicPackageRepository(context); AdvancedPackageRepository = new AdvancedPackageRepository(context); PremiumPackageRepository = new PremiumPackageRepository(context); FileUploadRepository = new FileUploadRepository(context); MembershipTypeRepository = new MembershipTypeRepository(context); AuroraWalletRepository = new AuroraWalletRepository(context); NotificationsRepository = new NotificationsRepository(context); UserNotificationsRepository = new UserNotificationsRepository(context); WalletRepository = new WalletRepository(context); AuctionRepository = new AuctionRepository(context); IndustryRepository = new IndustryRepository(context); OrderRepository = new OrderRepository(context); ShoppingCartRepository = new ShoppingCartRepository(context); }
public IndustryBusiness(IUnitOfWork _unitOfWork) { unitOfWork = _unitOfWork; industryRepository = new IndustryRepository(unitOfWork); }
public IndustryController(IndustryRepository industryRepository) { _industryRepository = industryRepository; }
// Ctor public IndustryService(IndustryRepository IndustryRepository) { this._IndustryRepository = IndustryRepository; }