public void Create(CreateCustomerDTO dto) { CustomerDbEntity Customer = new CustomerDbEntity(); Customer.Name = dto.Name; Customer.Email = dto.Email; Customer.Phone = dto.Phone; _DB.Customers.Add(Customer); _DB.SaveChanges(); }
public void Create(CreateCustomerDto dTO) { var Customer = new CustomerDbEntity() { Name = dTO.Name, Address = dTO.Address, Phone = dTO.Phone, }; _DB.Customers.Add(Customer); _DB.SaveChanges(); }
public static CustomerEntity ToDomain(this CustomerDbEntity customerEntity) { return(new CustomerEntity() { CustomerId = customerEntity.CustomerId, CreateDate = customerEntity.CreateDate, StoreId = customerEntity.StoreId, FirstName = customerEntity.FirstName, LastName = customerEntity.LastName, Email = customerEntity.Email, AddressId = customerEntity.AddressId, LastUpdated = customerEntity.LastUpdated, Rentals = customerEntity.Rentals.ToDomain(), Payments = customerEntity.Payments.ToDomain() }); }
public CustomerRepository(CustomerDbEntity context) { _context = context; // _context.Database.Connection.Open(); }