Exemple #1
0
        public ActionResult GetAllCustomers()
        {
            _logger.Info("Getting customers");

            List <Customer> allCustomers = _customerAccountService.GetCustomers()
                                           .Select(x => new Customer {
                Id = x.Id, Name = x.Name, Surname = x.Surname, Email = x.Email, IsActive = x.IsActive
            })
                                           .Distinct().ToList();

            _logger.InfoFormat("Users found: [{0}]", allCustomers.Count);

            return(PartialView("../Admin/_Search", allCustomers));
        }
 public IActionResult GetCustomers()
 {
     try {
         return(Ok(_customerAccountService.GetCustomers()));
     }
     catch (Exception Ex) {
         _loggerManager.LogError(Ex.InnerException.ToString());
         return(StatusCode(500, "Internal server error"));
     }
 }