public IActionResult Put(int id, Perilakukerja data) { using (var db = new OcphDbContext(this._dbsetting)) { var result = db.Perilaku.Update(x => new { x.perilaku }, data, x => x.idperilaku == id); return(Ok(result)); } }
public IActionResult Post(Perilakukerja data) { using (var db = new OcphDbContext(this._dbsetting)) { var resultId = db.Perilaku.InsertAndGetLastID(data); if (resultId > 0) { data.idperilaku = resultId; } return(Ok(data)); } }