Пример #1
0
        public async Task <IActionResult> Get
        (
            string alias = null,
            [FromQuery] string[] tags            = null,
            [Whitelist(10, 20, 30)] int?pageSize = 10,
            [FromQuery, Range(0, int.MaxValue)] int?pageIndex = 0,
            [FromQuery] string sortBy = null,
            [FromQuery] string sortAs = null
        )
        {
            Paged <Location> result = await this.mediator.Send(new GetLocationsQuery(alias, tags, pageSize, pageIndex, sortBy, sortAs));

            return(Ok(result.Adapt(this.mapper)));
        }
Пример #2
0
        public async Task <IActionResult> Get
        (
            string name,
            double?cost,
            int?duration,
            [Whitelist(10, 20, 30)] int?pageSize = 10,
            [FromQuery, Range(0, int.MaxValue)] int?pageIndex = 0,
            [FromQuery] string sortBy = null,
            [FromQuery] string sortAs = null
        )
        {
            Paged <TaskType> result = await this.mediator.Send(new GetTaskTypesQuery(name, cost, duration, pageSize, pageIndex, sortBy, sortAs));

            return(Ok(result.Adapt(this.mapper)));
        }
Пример #3
0
        public async Task <IActionResult> Get
        (
            string name,
            int?type,
            DateTimeOffset?intervalStart,
            DateTimeOffset?intervalEnd,
            int?status,
            [Whitelist(10, 20, 30)] int?pageSize = 10,
            [FromQuery, Range(0, int.MaxValue)] int?pageIndex = 0,
            [FromQuery] string sortBy = null,
            [FromQuery] string sortAs = null
        )
        {
            Paged <Domain.Entities.Task> result = await this.mediator.Send(new GetTasksQuery(name, type, intervalStart, intervalEnd, status, pageSize, pageIndex, sortBy, sortAs));

            return(Ok(result.Adapt(this.mapper)));
        }