public void DeleteObj(SheduleTask model) { var res = _context.Tasks.FirstOrDefault(a => a.Title == model.Title); if (res != null) { _context.Tasks.Remove(res); _context.SaveChanges(); } }
public IActionResult Update([FromBody] SheduleTask model) { try { // update user _taskService.Update(model); return(Ok()); } catch (Exception ex) { // return error message if there was an exception return(BadRequest(new { message = ex.Message })); } }
public void Update(SheduleTask task) { _context.Tasks.Update(task); _context.SaveChanges(); }
public SheduleTask Create(SheduleTask task) { _context.Tasks.Add(task); _context.SaveChanges(); return(task); }
public IActionResult DeleteObj([FromBody] SheduleTask model) { _taskService.DeleteObj(model); return(Ok()); }
public IActionResult GetByDate([FromBody] SheduleTask model) { var tasks = _taskService.GetByDate(model.DateTime); return(Ok(tasks)); }