public IEnumerable <TodoListViewModel> GetTodoLists() { var enumerable = _todoListService.GetAllTodoLists(); return(enumerable.Where(x => x.ApplicationUserEntityId == User.Identity.GetUserId()).Select( list => new TodoListViewModel() { ApplicationUserEntityId = list.ApplicationUserEntityId, Id = list.Id, Name = list.Name })); }
public IActionResult GetUserTodoList([FromHeader] int userID, [FromQuery] int?priority, [FromQuery] bool completed) { IActionResult result = null; try { var todos = todoListService.GetAllTodoLists(userID, priority, completed); result = Ok(todos); } catch (Exception e) { //Log result = BadRequest(e); } return(result); }
/* * GET * api/todolist */ public IEnumerable <TodoList> Index() { return(_service.GetAllTodoLists()); }
public async Task <IActionResult> GetTodoLists(long projectId) { return(Ok(await _todoService.GetAllTodoLists(projectId))); }