Exemplo n.º 1
0
        public async Task <IHttpActionResult> Put(LogPagingGetVm vm)
        {
            var count = await this.BusinessService.GetLogsCountAsync(vm.SearchTerm);

            var logs = await this.BusinessService.GetLogsWithPagingAsync(vm.PageIndex, vm.PageSize, vm.IsDescending, vm.SearchTerm);

            vm.Logs = await this.MappingService.EntityToGetVmAsync(logs);

            vm.Count = count;
            return(Ok(vm));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Put(string id, [FromBody] LogPagingGetVm vm)
        {
            var count = await this.logQueryService.GetLogsCountAsync(vm.SearchTerm);

            var logs = await this.logQueryService.GetLogsWithPagingAsync(vm.PageIndex, vm.PageSize, vm.IsDescending, vm.SearchTerm);

            var logMappingService = new LogMappingService();

            vm.Logs = await logMappingService.EntityToGetVmAsync(logs);

            vm.Count = count;
            return(Ok(vm));
        }