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();
        }
Esempio n. 2
0
        public void Create(CreateCustomerDto dTO)
        {
            var Customer = new CustomerDbEntity()
            {
                Name    = dTO.Name,
                Address = dTO.Address,
                Phone   = dTO.Phone,
            };

            _DB.Customers.Add(Customer);
            _DB.SaveChanges();
        }
Esempio n. 3
0
 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()
     });
 }
Esempio n. 4
0
 public CustomerRepository(CustomerDbEntity context)
 {
     _context = context;
     //  _context.Database.Connection.Open();
 }