public IActionResult Post([FromBody] TaskLogAPI item) { if (item == null) { return(BadRequest()); } TaskLog TaskLog = TaskLogAPI.To(item); try { TaskLog = new TaskLogBF(DB).Create(TaskLog); return(CreatedAtRoute( "TaskLogRoute", new { controller = "TaskLog", id = TaskLog.ID }, TaskLogAPI.From(TaskLog))); } catch (Exception ex) { return(BadRequest(ex)); } }
public IActionResult Put(long id, [FromBody] TaskLogAPI item) { if (item == null) { return(BadRequest()); } try { TaskLog updateItem = new TaskLogBF(DB).Update(TaskLogAPI.To(item)); return(new ObjectResult(TaskLogAPI.From(updateItem))); } catch (Exception ex) { return(BadRequest(ex)); } }