From f9285cb649ccbb463592e50ef3d4ca80d1106009 Mon Sep 17 00:00:00 2001 From: Ilkay Ilknur Date: Thu, 18 Feb 2021 12:01:03 +0300 Subject: [PATCH] Use getter only properties instead of variables for injected services --- .../Volo/CmsKit/Admin/Comments/CommentAdminAppService.cs | 3 +-- .../Volo/CmsKit/Admin/Comments/CommentAdminController.cs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Comments/CommentAdminAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Comments/CommentAdminAppService.cs index 60c83a2551..e045f1137a 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Comments/CommentAdminAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Comments/CommentAdminAppService.cs @@ -15,7 +15,7 @@ namespace Volo.CmsKit.Admin.Comments [Authorize(CmsKitAdminPermissions.Comments.Default)] public class CommentAdminAppService : CmsKitAdminAppServiceBase, ICommentAdminAppService { - protected readonly ICommentRepository CommentRepository; + protected ICommentRepository CommentRepository { get; } public CommentAdminAppService(ICommentRepository commentRepository) { @@ -65,7 +65,6 @@ namespace Volo.CmsKit.Admin.Comments public virtual async Task DeleteAsync(Guid id) { var comment = await CommentRepository.GetAsync(id); - await CommentRepository.DeleteWithRepliesAsync(comment); } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Comments/CommentAdminController.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Comments/CommentAdminController.cs index 8d25f93b32..9f71761235 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Comments/CommentAdminController.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Comments/CommentAdminController.cs @@ -17,7 +17,7 @@ namespace Volo.CmsKit.Admin.Comments [Route("api/cms-kit-admin/comments")] public class CommentAdminController : CmsKitAdminController, ICommentAdminAppService { - protected readonly ICommentAdminAppService CommentAdminAppService; + protected ICommentAdminAppService CommentAdminAppService { get; } public CommentAdminController(ICommentAdminAppService commentAdminAppService) {