public ActionResult Create([Bind(Include = "Id,Number")] Contract contract) { if (ModelState.IsValid) { contract.Id = Guid.NewGuid(); db.ContractSet.Add(contract); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(contract)); }
public ActionResult Create([Bind(Include = "Id, Name, FullName, LegalAddress, INN, OKPO")] Contractor contractor) { if (ModelState.IsValid) { contractor.Id = Guid.NewGuid(); db.ContractorSet.Add(contractor); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(contractor)); }
public ActionResult Create([Bind(Include = "Id,Name,IsActive,Alias")] Node node) { if (ModelState.IsValid) { node.Id = Guid.NewGuid(); db.NodeSet.Add(node); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(node)); }