public async Task <bool> ModifyTodoItem_Details(TodoItem_Details TodoItem_Details) { _context.Entry(TodoItem_Details).State = EntityState.Modified; try { await _context.SaveChangesAsync(); return(true); } catch (Exception ex) { throw new TODOCustomError($"Erorr While modifying Todod item : {ex.Message}"); } }
public async Task <bool> AddTodoItem_Details(TodoItem_Details TodoItem_Details) { try { await _context.TodoItem_Details.AddAsync(TodoItem_Details); await _context.SaveChangesAsync(); return(true); } catch (Exception ex) { throw new TODOCustomError($"Erorr While adding Todod item : {ex.Message}"); } }
public async Task <ActionResult> AddTodoItem_Details(TodoItem_Details todo_item) { var result = await _todoService.AddTodoItem_Details(todo_item); return(CreatedAtAction(nameof(AddTodoItem_Details), new { id = todo_item.Item_id }, result)); }
public async Task <IActionResult> Modify(TodoItem_Details todo_item) { var result = await _todoService.ModifyTodoItem_Details(todo_item); return(CreatedAtAction(nameof(Modify), new { id = todo_item.Item_id }, result)); }