From 59b984343302c781d75d66cd5144daba5a1cf586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Thu, 17 Aug 2023 20:25:55 +0300 Subject: [PATCH 1/2] Document AbpAspNetCoreAuditingOptions --- docs/en/Audit-Logging.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/en/Audit-Logging.md b/docs/en/Audit-Logging.md index 2fdf34dca6..e2d577c756 100644 --- a/docs/en/Audit-Logging.md +++ b/docs/en/Audit-Logging.md @@ -92,6 +92,19 @@ The condition `typeof(IEntity).IsAssignableFrom(type)` will be `true` for any cl `options.EntityHistorySelectors` is a flexible and dynamic way of selecting the entities for audit logging. Another way is to use the `Audited` and `DisableAuditing` attributes per entity. +## AbpAspNetCoreAuditingOptions + +`AbpAspNetCoreAuditingOptions` is the [options object](Options.md) to configure audit logging in the ASP.NET Core layer. You can configure it in the `ConfigureServices` method of your [module](Module-Development-Basics.md): + +````csharp +Configure(options => +{ + options.IgnoredUrls.Add("/products"); +}); +```` + +`IgnoredUrls` is the only option. It is a list of ignored URLs prefixes. In the preceding example, all URLs starting with `/products` will be ignored for audit logging. + ## Enabling/Disabling Audit Logging for Services ### Enable/Disable for Controllers & Actions From 777abd048a94dc553d605f3f338ee97810d24996 Mon Sep 17 00:00:00 2001 From: maliming Date: Fri, 18 Aug 2023 09:55:08 +0800 Subject: [PATCH 2/2] Get hooks by current layout. Fix #17394 --- .../Mvc/UI/Components/LayoutHook/LayoutHookViewComponent.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/LayoutHookViewComponent.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/LayoutHookViewComponent.cs index 553c7908c4..082ca59ee0 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/LayoutHookViewComponent.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/LayoutHookViewComponent.cs @@ -18,9 +18,9 @@ public class LayoutHookViewComponent : AbpViewComponent public virtual IViewComponentResult Invoke(string name, string layout) { - var hooks = Options.Hooks.GetOrDefault(name)?.Where(IsViewComponent).ToArray() - ?? Array.Empty(); - + var hooks = Options.Hooks.GetOrDefault(name)?.Where(x => x.Layout == layout && IsViewComponent(x)).ToArray() + ?? Array.Empty(); + return View( "~/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/Default.cshtml", new LayoutHookViewModel(hooks, layout)