public async Task<ActionResult> AddTranslation(ArchiveTranslation t) { if (ModelState.IsValid) { db.AddTranslation(t); await db.SaveChangesAsync(); return RedirectToAction("Index"); } return View(t); }
//public async Task<ActionResult> AddTranslation() public ActionResult AddTranslation() { var archive = db.Set<Archive>().FirstOrDefault(); var t = new ArchiveTranslation { ArchiveId = archive.Id }; ViewBag.Languages = LanguageDefinitions.GenerateAvailableLanguageDDL(archive.Translations.Select(tr => tr.LanguageCode)); return View(t); }