public void Update(int id, LkpClassVw obj) { var tab = _mapper.Map <LkpClass>(obj); _interface.Update(id, tab); _interface.SaveChanges(); }
public void Insert(LkpClassVw obj) { var tab = _mapper.Map <LkpClass>(obj); _interface.Add(tab); _interface.SaveChanges(); }
public async Task <IActionResult> Post(LkpClassVw obj) { if (!ModelState.IsValid) { Response.StatusCode = 400; return(Ok(new Res(false, "State not valid", obj))); } _service.Insert(obj); return(Ok(new Res(true, "Complite", await _service.GetAll()))); }
public void Put(int id, LkpClassVw obj) { _service.Update(id, obj); // return Ok(new Res(true, "Complite", _service.GetAll())); }