public PagedView <View.ToDo> GetPaged(ToDoGetBinding binding) { using (var context = GetMainContext()) { return(context.ToDos.WhereUser(UserId) .WhereIf(binding.IsDone.HasValue, x => x.IsDone == binding.IsDone.Value) .OrderByDescending(x => x.Created) .Select(x => new View.ToDo(x)) .ToPagedView(binding)); } }
public IActionResult Get([FromQuery] ToDoGetBinding binding) => Ok(_toDoHandler.GetPaged(binding));