public ActionResult Create() { var customer = new VWCustomer() { IsNew = true, Customer = new Customer() }; return(View("Maint", customer)); }
public ActionResult Edit(Guid id) { var customer = new VWCustomer() { IsNew = false }; customer.Customer = _db.Customers.FirstOrDefault(x => x.Id.Equals(id)); customer.Contacts = _db.CustomerContactRelations.Where(x => x.Customer == id).Select(x => _db.Contacts.FirstOrDefault(y => y.Id == x.Contact)).ToList(); return(View("Maint", customer)); }