public IActionResult Edit([FromBody] KpiViewModel model) { IActionResult response; if (_kpi.IsUse(model.Id)) { response = BadRequest(UtilityService.InitialResultError(string.Format(MessageValue.IsUseMessageFormat, MessageValue.KpiMessage), (int)System.Net.HttpStatusCode.BadRequest)); } else { response = Ok(_kpi.Edit(model)); } return(response); }
public void Edit(int id, string KpiName) { try { var response = _Kpi.Edit(new Master.Bll.Models.KpiViewModel { Id = id, KpiNameTh = KpiName }); Console.WriteLine(response); } catch (Exception ex) { Assert.True(false, ex.Message); } }