From d316752da4b934c595271ec889afd4a051800327 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Sat, 15 Aug 2020 21:42:22 +0300 Subject: [PATCH] Update CommentingViewComponent.cs --- .../Components/Commenting/CommentingViewComponent.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/CommentingViewComponent.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/CommentingViewComponent.cs index 803119f50f..7053c65a29 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/CommentingViewComponent.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/CommentingViewComponent.cs @@ -4,6 +4,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Options; using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.UI; using Volo.Abp.AspNetCore.Mvc.UI.Widgets; using Volo.CmsKit.Public.Comments; using Volo.CmsKit.Web; @@ -19,14 +20,14 @@ namespace Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Commenting public class CommentingViewComponent : AbpViewComponent { public ICommentPublicAppService CommentPublicAppService { get; } - public AbpMvcOptions AbpMvcOptions { get; } - + public AbpMvcUiOptions AbpMvcUiOptions { get; } + public CommentingViewComponent( ICommentPublicAppService commentPublicAppService, - IOptions options) + IOptions options) { CommentPublicAppService = commentPublicAppService; - Options = options.Value; + AbpMvcUiOptions = options.Value; } public virtual async Task InvokeAsync( @@ -36,7 +37,7 @@ namespace Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Commenting var result = await CommentPublicAppService .GetListAsync(entityType, entityId); - var loginUrl = $"{Options.LoginUrl}?returnUrl={HttpContext.Request.Path.ToString()}&returnUrlHash=#cms-comment_{entityType}_{entityId}"; + var loginUrl = $"{AbpMvcUiOptions.LoginUrl}?returnUrl={HttpContext.Request.Path.ToString()}&returnUrlHash=#cms-comment_{entityType}_{entityId}"; var viewModel = new CommentingViewModel {