public async Task <IActionResult> Edit(int id, [Bind("Id,CountryId,LanguageId,Name")] MstcountryLangMap mstcountryLangMap) { if (id != mstcountryLangMap.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(mstcountryLangMap); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MstcountryLangMapExists(mstcountryLangMap.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["CountryId"] = new SelectList(_context.Country, "Id", "Code", mstcountryLangMap.CountryId); ViewData["LanguageId"] = new SelectList(_context.Language, "Id", "Name", mstcountryLangMap.LanguageId); return(View(mstcountryLangMap)); }
public async Task <IActionResult> Create([Bind("Id,CountryId,LanguageId,Name")] MstcountryLangMap mstcountryLangMap) { if (ModelState.IsValid) { _context.Add(mstcountryLangMap); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["CountryId"] = new SelectList(_context.Country, "Id", "Code", mstcountryLangMap.CountryId); ViewData["LanguageId"] = new SelectList(_context.Language, "Id", "Name", mstcountryLangMap.LanguageId); return(View(mstcountryLangMap)); }