예제 #1
0
        public void CreateAInvalidCustomerCpfTest()
        {
            Customer customer = new Customer();
            customer.Cpf = "000.000.000";

            Validator.Validate(customer);
        }
예제 #2
0
 public Customer Update(Customer customer)
 {
     DbEntityEntry entry = context.Entry(customer);
     entry.State = EntityState.Modified;
     context.SaveChanges();
     return customer;
 }
예제 #3
0
        public Customer Update(Customer customer)
        {
            Validator.Validate(customer);

            var updatedCustomer = _customerRepository.Update(customer);

            return updatedCustomer;
        }
예제 #4
0
        public Customer Create(Customer customer)
        {
            Validator.Validate(customer);

            var savedCustomer = _customerRepository.Save(customer);

            return savedCustomer;
        }
예제 #5
0
        public void CreateAInvalidCustomerNameTest()
        {
            Customer customer = new Customer();

            Validator.Validate(customer);
        }
예제 #6
0
 public Customer Save(Customer customer)
 {
     var newCustomer = context.Customers.Add(customer);
     context.SaveChanges();
     return newCustomer;
 }