示例#1
0
 public static Business.Library.Customer MapCustomer(Entities.Customers customer)
 {
     return(new Business.Library.Customer(customer.FirstName, customer.LastName)
     {
         ID = customer.Id
     });
 }
示例#2
0
        public static Entities.Orders MapOrder(Business.Library.Order order)
        {
            Entities.Customers customer = MapCustomer(order.OCustomer);
            Entities.Locations location = MapLocation(order.OLocation);

            return(new Entities.Orders
            {
                Customer = customer,
                Location = location,
                CustomerId = customer.Id,
                LocationId = location.Id,
                CreatedAt = order.Date,
                Id = order.ID,
                Total = order.Total,
            });
        }
 public void RemoveCustomer(Business.Library.Customer customer)
 {
     Entities.Customers entity = Mapper.MapCustomer(customer);
     _context.Remove(entity);
 }
 public void AddCustomer(Business.Library.Customer customer)
 {
     Entities.Customers entity = Mapper.MapCustomer(customer);
     _context.Add(entity);
 }