Exemple #1
0
        public async Task <IEnumerable <TaskModel> > Get([FromQuery] TasksParameters parameters)
        {
            if (!parameters.HasValues())
            {
                return(await _taskService.GetAllAsync());
            }

            if (parameters.HasOnlyKeys())
            {
                var task = await _taskService.GetAsync(parameters.Id, parameters.ProjectId);

                return(new List <TaskModel> {
                    task
                });
            }

            return(await _taskService.GetWithParameters(parameters));
        }