public IActionResult Post(ToDoListVM todolistVM) { var push = _todolistService.Create(todolistVM); if (push > 0) { return(Ok(push)); } return(BadRequest("Added Row Failed!")); }
public IActionResult Post(ToDoListVM toDoListVM) { var data = _toDoListService.Create(toDoListVM); if (data > 0) { return(Ok(data)); } return(BadRequest("Failed")); }
public ActionResult Create(ToDoListDto model) { var result = _toDoListService.Create(model); if (result.HasError) { return(View("Edit", model)); } return(RedirectToAction("List")); }
public async Task <IActionResult> Create([Bind("Id,Name")] ToDoList toDoToDoList) { if (ModelState.IsValid) { await _toDoListService.Create(toDoToDoList); this.AddAlertSuccess($"{toDoToDoList.Name} created."); return(RedirectToAction(nameof(Index))); } return(View(toDoToDoList)); }
public IActionResult AddList(ToDoList entity) { entity.isValid = true; _toDoListService.Create(entity); return(RedirectToAction("Index")); }