public ActionResult Create(Client client, int ArtistId, int StyleId) { _db.Clients.Add(client); if (ArtistId != 0 || StyleId != 0) { _db.ArtistClientStyle.Add(new ArtistClientStyle() { StyleId = StyleId, ArtistId = ArtistId, ClientId = client.ClientId }); } _db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Create(Artist Artist) { _db.Artists.Add(Artist); _db.SaveChanges(); return(RedirectToAction("Index")); }