public ActionResult Edit(GigFormViewModel gigFormViewModel) { //mapping vm to db obj and save in DB Gig gig = null; var currentlyloggedUserId = User.Identity.GetUserId(); gig = dbContext.Gigs.Where(e => e.Id == gigFormViewModel.Id && e.ArtistId == currentlyloggedUserId).SingleOrDefault(); if (gigFormViewModel != null) { gig.Modifiy(gigFormViewModel.Venue, gigFormViewModel.GetDateTime(), gigFormViewModel.Genere); //dbContext.Gigs.Attach(gig); dbContext.SaveChanges(); } List <Gig> gigsLsList = dbContext.Gigs.ToList(); return(RedirectToAction("ViewMyUpCommingGigs", "Gigs")); }