public void Update(int id, LkpSectionVw obj) { var vw = _mapper.Map <LkpSection>(obj); _lkpSectionRepo.Update(id, vw); _lkpSectionRepo.SaveChanges(); }
public void Insert(LkpSectionVw obj) { var vw = _mapper.Map <LkpSection>(obj); _lkpSectionRepo.Add(vw); _lkpSectionRepo.SaveChanges(); }
public async Task <IActionResult> Post(LkpSectionVw obj) { /* try * { * if (!ModelState.IsValid) * { * Response.StatusCode = 400; * var xx = Json(new Res(isDone: false, message: "sssss", obj)); * return Json(new Res(false, "State not valid", obj)); * }*/ _lkpSectionService.Insert(obj); return(Ok(_lkpSectionService.GetAll())); /* } * catch (Exception e) * { * Console.WriteLine(e); * throw; * }*/ }
public IActionResult Put(int id, LkpSectionVw obj) { _lkpSectionService.Update(id, obj); return(Ok(_lkpSectionService.GetById(id))); }