Merge pull request #17404 from abpframework/auto-merge/rel-7-4/2127

Merge branch dev with rel-7.4
pull/17405/head
Engincan VESKE 2 years ago committed by GitHub
commit abe237a8e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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<AbpAspNetCoreAuditingOptions>(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

@ -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<LayoutHookInfo>();
var hooks = Options.Hooks.GetOrDefault(name)?.Where(x => x.Layout == layout && IsViewComponent(x)).ToArray()
?? Array.Empty<LayoutHookInfo>();
return View(
"~/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/Default.cshtml",
new LayoutHookViewModel(hooks, layout)

Loading…
Cancel
Save