Exemplo n.º 1
0
        List <Contracts.Customer> ICustomerService.GetAll()
        {
            var customers = _customerRepositary.GetAll();

            return((from c in customers
                    select new Contracts.Customer
            {
                CustomerId = c.CustomerId,
                FirstName = c.FirstName,
                LastName = c.LastName,
                Email = c.Email,
                PhoneNumber = c.PhoneNumber,
                Status = c.Status.Value
            }).ToList());
        }
 public IEnumerable <Customer> GetAll()
 {
     try
     {
         var CustomerList = _repo.GetAll().ToList();
         if (CustomerList.Count == 0)
         {
             _log4net.Info("Empty List");
             throw new System.ArgumentNullException("Empty List");
         }
         else
         {
             return(CustomerList);
         }
     }
     catch (Exception e)
     {
         _log4net.Error("Error in GetAll");
         throw e;
     }
 }