public Customer Update(Customer customer) { DbEntityEntry entry = context.Entry(customer); entry.State = EntityState.Modified; context.SaveChanges(); return customer; }
public Customer Update(Customer customer) { Validator.Validate(customer); var updatedCustomer = _customerRepository.Update(customer); return updatedCustomer; }
public Customer Create(Customer customer) { Validator.Validate(customer); var savedCustomer = _customerRepository.Save(customer); return savedCustomer; }
// // GET: /Customer/Details/5 public ActionResult Details(int id) { if (id == null) { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); } Customer customer = new Customer(); if (customer == null) { return HttpNotFound(); } return View(customer); }
public static Local GetLocal() { Customer customer = new Customer(); customer.Nome = "Vinícius Oliveira"; customer.Telefone = "4999517803"; customer.Endereco = "João Severiano Waltrick"; customer.Cidade = "Lages"; Local local = new Local(); local.Entrada = DateTime.Now; local.Saida = DateTime.Now.AddDays(2); local.Salario = 900; local.Customer = customer; return local; }
public static Customer GetCustomer() { Customer customer = new Customer(); customer.Nome = "Vinícius Oliveira"; customer.Telefone = "4999517803"; customer.Endereco = "João Severiano Waltrick"; customer.Cidade = "Lages"; customer.Locais = new List<Local>() { new Local() { Entrada = DateTime.Now, Saida = DateTime.Now.AddDays(2), Salario = 900, } }; return customer; }
public Customer Save(Customer customer) { var newCustomer = context.Customers.Add(customer); context.SaveChanges(); return newCustomer; }