Example #1
0
 public IActionResult Index()
 {
     try
     {
         var customer = new Customer {
             Id = _customer.Id
         };
         var product = new Product {
             Id = _product.Id
         };
         var model = new RentalProducts.DAL.Models.ViewModels.ViewModels
         {
             Orders    = _uow.orderRepository.List.Where(o => o.CustomerId == _customer.Id),
             Customers = _uow.customerRepository.List.Where(c => c.Id == customer.Id),
             Products  = _uow.productRepository.List
         };
         EventLogger.WriteLog("Get Orders List", _context);
         return(View(model));
     }
     catch (Exception ex)
     {
         Logger.WriteLog(ex, _context);
         return(BadRequest());
     }
 }
Example #2
0
 public IActionResult Index()
 {
     try
     {
         RentalProducts.DAL.Models.ViewModels.ViewModels viewModel = new RentalProducts.DAL.Models.ViewModels.ViewModels
         {
             Products  = _uow.productRepository.List,
             Customers = _uow.customerRepository.List
         };
         EventLogger.WriteLog("Get Products List", _context);
         return(View(viewModel));
     }
     catch (Exception ex)
     {
         Logger.WriteLog(ex, _context);
         return(BadRequest());
     }
 }