public async Task<ActionResult> Skapa(Partner Partner) { if (ModelState.IsValid) { //Ingen fil är vald. db.Partners.Add(Partner.AssignValues()); await db.SaveChangesAsync(); return RedirectToAction("Index", "Home"); } return View(Partner); }
public async Task<ActionResult> Redigera(Partner Partner) { if (ModelState.IsValid) { db.Entry(Partner.AssignValues()).State = EntityState.Modified; await db.SaveChangesAsync(); return RedirectToAction("Index"); } return View(Partner); }