public async Task <IActionResult> RemoveMembertypes(MemberTypeLists memberTypeLists) { var deleteMemberTypes = await _db.Membertypies.SingleOrDefaultAsync(m => m.Id == memberTypeLists.Id); _db.Membertypies.Remove(deleteMemberTypes); await _db.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); }
public async Task <IActionResult> Create(MemberTypeLists memberTypeLists) { if (ModelState.IsValid) { _db.Add(memberTypeLists); await _db.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(memberTypeLists)); }
public async Task <IActionResult> Edit(int id, MemberTypeLists memberTypeLists) { if (memberTypeLists.Id != id) { return(NotFound()); } if (ModelState.IsValid) { _db.Update(memberTypeLists); await _db.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(memberTypeLists)); }