public static Library.Customer Map(Entities.Customer customer) => new Library.Customer { Id = customer.Id, FirstName = customer.FirstName, LastName = customer.LastName, PhoneNumber = customer.PhoneNumber, PurOrder = customer.PurOrder.Select(Map).ToList() };
public void AddCustomer(Library.Customer customer) { Entities.Customer entity = Mapper.Map(customer); _dbContext.Add(entity); }