From 853aab9704c5c453727c0a3fc9a3d84359732d3f Mon Sep 17 00:00:00 2001 From: Halil ibrahim Kalkan Date: Thu, 21 Feb 2019 16:49:49 +0300 Subject: [PATCH] Remove unused GetListPagedAsync --- .../Volo/Blogging/Blogs/IBlogAppService.cs | 2 -- .../Volo/Blogging/Blogs/BlogAppService.cs | 11 ----------- .../Volo/Blogging/Blogs/IBlogRepository.cs | 3 --- .../Volo/Blogging/Blogs/EfCoreBlogRepository.cs | 12 ------------ .../Volo/Blogging/BlogsController.cs | 8 -------- .../Volo/Blogging/Blogs/MongoBlogRepository.cs | 12 ------------ .../Pages/Blog/Posts/Detail.cshtml.cs | 1 - 7 files changed, 49 deletions(-) diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Blogs/IBlogAppService.cs b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Blogs/IBlogAppService.cs index fffc9cdd5b..fbac86d827 100644 --- a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Blogs/IBlogAppService.cs +++ b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Blogs/IBlogAppService.cs @@ -8,8 +8,6 @@ namespace Volo.Blogging.Blogs { public interface IBlogAppService : IApplicationService { - Task> GetListPagedAsync(PagedAndSortedResultRequestDto input); - Task> GetListAsync(); Task GetByShortNameAsync(string shortName); diff --git a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Blogs/BlogAppService.cs b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Blogs/BlogAppService.cs index 790d47dff2..f06864a2d6 100644 --- a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Blogs/BlogAppService.cs +++ b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Blogs/BlogAppService.cs @@ -18,17 +18,6 @@ namespace Volo.Blogging.Blogs _blogRepository = blogRepository; } - public async Task> GetListPagedAsync(PagedAndSortedResultRequestDto input) - { - var blogs = await _blogRepository.GetListAsync(input.Sorting, input.MaxResultCount, input.SkipCount ); - - var totalCount = await _blogRepository.GetTotalCount(); - - var dtos = ObjectMapper.Map, List>(blogs); - - return new PagedResultDto(totalCount, dtos); - } - public async Task> GetListAsync() { var blogs = await _blogRepository.GetListAsync(); diff --git a/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Blogs/IBlogRepository.cs b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Blogs/IBlogRepository.cs index 62ef6be7b3..27e01a0262 100644 --- a/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Blogs/IBlogRepository.cs +++ b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Blogs/IBlogRepository.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.Threading.Tasks; using Volo.Abp.Domain.Repositories; @@ -9,8 +8,6 @@ namespace Volo.Blogging.Blogs { Task FindByShortNameAsync(string shortName); - Task> GetListAsync(string sorting, int maxResultCount, int skipCount); - Task GetTotalCount(); } } diff --git a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/Blogs/EfCoreBlogRepository.cs b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/Blogs/EfCoreBlogRepository.cs index e0e70578b1..5c9b43e8ed 100644 --- a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/Blogs/EfCoreBlogRepository.cs +++ b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/Blogs/EfCoreBlogRepository.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Dynamic.Core; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; @@ -23,15 +20,6 @@ namespace Volo.Blogging.Blogs return await DbSet.FirstOrDefaultAsync(p => p.ShortName == shortName); } - public async Task> GetListAsync(string sorting, int maxResultCount, int skipCount) - { - var auditLogs = await DbSet.OrderBy(sorting ?? "creationTime desc") - .PageBy(skipCount, maxResultCount) - .ToListAsync(); - - return auditLogs; - } - public async Task GetTotalCount() { return await DbSet.CountAsync(); diff --git a/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/BlogsController.cs b/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/BlogsController.cs index 9fbb70f849..084afb958a 100644 --- a/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/BlogsController.cs +++ b/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/BlogsController.cs @@ -4,7 +4,6 @@ using Microsoft.AspNetCore.Mvc; using Volo.Abp; using Volo.Abp.Application.Dtos; using Volo.Abp.AspNetCore.Mvc; -using Volo.Abp.Auditing; using Volo.Blogging.Blogs; using Volo.Blogging.Blogs.Dtos; @@ -23,13 +22,6 @@ namespace Volo.Blogging } [HttpGet] - public async Task> GetListPagedAsync(PagedAndSortedResultRequestDto input) - { - return await _blogAppService.GetListPagedAsync(input); - } - - [HttpGet] - [Route("all")] public async Task> GetListAsync() { return await _blogAppService.GetListAsync(); diff --git a/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/Blogs/MongoBlogRepository.cs b/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/Blogs/MongoBlogRepository.cs index 9319eb64af..8a3b759730 100644 --- a/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/Blogs/MongoBlogRepository.cs +++ b/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/Blogs/MongoBlogRepository.cs @@ -1,12 +1,9 @@ using System; -using System.Collections.Generic; using System.Threading.Tasks; using MongoDB.Driver.Linq; using Volo.Abp.Domain.Repositories.MongoDB; using Volo.Abp.MongoDB; using Volo.Blogging.MongoDB; -using System.Linq; -using System.Linq.Dynamic.Core; namespace Volo.Blogging.Blogs { @@ -21,15 +18,6 @@ namespace Volo.Blogging.Blogs return await GetMongoQueryable().FirstOrDefaultAsync(p => p.ShortName == shortName); } - public async Task> GetListAsync(string sorting, int maxResultCount, int skipCount) - { - var auditLogs = GetMongoQueryable().OrderBy(sorting ?? "creationTime desc").As>() - .PageBy(skipCount, maxResultCount) - .ToList(); - - return auditLogs; - } - public async Task GetTotalCount() { return await GetMongoQueryable().CountAsync(); diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml.cs b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml.cs index 83edb281b0..20f281f8ae 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml.cs +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Threading.Tasks; using System.Web; using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; using Volo.Blogging.Blogs; using Volo.Blogging.Blogs.Dtos;