public async Task <IActionResult> Create(RadiusMasterCreateViewModel model) { if (ModelState.IsValid) { var store = new radiusmaster { id = model.id , name = model.name // , profilephoto=model.profilephoto , isdeleted = false , isactive = false }; await _RadiusMasterServices.CreateAsync(store); TempData["success"] = "Record Saved successfully"; return(RedirectToAction(nameof(Index))); } else { return(View()); } }
//------ public void Updatestatus(radiusmaster obj) { _context.radiusmaster.Update(obj); _context.SaveChanges(); }
//public radiusmaster GetById(int id) => // _context.radiusmaster.Where(x => x.id == id).FirstOrDefault(); public async Task UpdateAsync(radiusmaster obj) { _context.radiusmaster.Update(obj); await _context.SaveChangesAsync(); }
public async Task CreateAsync(radiusmaster obj) { await _context.radiusmaster.AddAsync(obj); await _context.SaveChangesAsync(); }