CSLA.NET
6.0.0
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
Csla.AspNetCore/ConfigurationExtensions.cs
Go to the documentation of this file.
1
//-----------------------------------------------------------------------
2
// <copyright file="AspNetCoreConfigurationExtensions.cs" company="Marimer LLC">
3
// Copyright (c) Marimer LLC. All rights reserved.
4
// Website: https://cslanet.com
5
// </copyright>
6
// <summary>Implement extension methods for AspNet configuration</summary>
7
//-----------------------------------------------------------------------
8
using
System;
9
using
Csla
.
Runtime
;
10
#if NET5_0_OR_GREATER
11
using
Csla
.
AspNetCore
.Blazor;
12
using
Microsoft
.AspNetCore.Components.Server.Circuits;
13
#endif
14
using
Microsoft
.
Extensions
.
DependencyInjection
;
15
using
Microsoft
.
Extensions
.
DependencyInjection
.Extensions;
16
using
Csla
.
Core
;
17
using
Csla
.
AspNetCore
;
18
19
namespace
Csla.Configuration
20
{
24
public
static
class
AspNetCoreConfigurationExtensions
25
{
31
public
static
CslaOptions
AddAspNetCore(
this
CslaOptions
config)
32
{
33
return
AddAspNetCore(config,
null
);
34
}
35
42
public
static
CslaOptions
AddAspNetCore(
this
CslaOptions
config, Action<AspNetCoreConfigurationOptions> options)
43
{
44
var localOptions =
new
AspNetCoreConfigurationOptions
();
45
options?.Invoke(localOptions);
46
#if NET5_0_OR_GREATER
47
config.
Services
.AddScoped<ActiveCircuitState>();
48
config.
Services
.AddScoped(typeof(CircuitHandler), typeof(ActiveCircuitHandler));
49
#endif
50
config.
Services
.AddScoped(typeof(
IContextManager
), typeof(
ApplicationContextManagerHttpContext
));
51
return
config;
52
}
53
}
54
59
public
class
AspNetCoreConfigurationOptions
60
{
65
public
bool
UseCslaPermissionsPolicy
{
get
;
set
; } =
true
;
66
}
67
}
Csla.AspNetCore.ApplicationContextManagerHttpContext
Application context manager that uses HttpContextAccessor when resolving HttpContext to store context...
Definition:
ApplicationContextManagerHttpContext.cs:21
Csla.Configuration.AspNetCoreConfigurationOptions
Options that can be provided to the AddAspNetCore method.
Definition:
Csla.AspNetCore/ConfigurationExtensions.cs:60
Csla.Configuration.AspNetCoreConfigurationOptions.UseCslaPermissionsPolicy
bool UseCslaPermissionsPolicy
Indicates whether the app should be configured to use CSLA permissions policies (default = true).
Definition:
Csla.AspNetCore/ConfigurationExtensions.cs:65
Csla.Configuration.CslaOptions
Use this type to configure the settings for CSLA .NET.
Definition:
CslaOptions.cs:18
Csla.Configuration.CslaOptions.Services
IServiceCollection Services
Gets the current service collection.
Definition:
CslaOptions.cs:22
Csla.Core.IContextManager
Defines the interface for an application context manager type.
Definition:
IContextManager.cs:18
Csla.AspNetCore
Definition:
ApplicationContextManagerHttpContext.cs:15
Csla.Configuration
Definition:
Csla.AspNetCore/ConfigurationExtensions.cs:20
Csla.Core
Definition:
AddedNewEventArgs.cs:11
Csla.Runtime
Definition:
IRuntimeInfo.cs:9
Csla
Definition:
BusinessRuleCases.cs:5
Microsoft.Extensions.DependencyInjection
Definition:
ServiceCollectionExtensions.cs:17
Microsoft.Extensions
Definition:
ServiceCollectionExtensions.cs:17
Microsoft
Definition:
ServiceCollectionExtensions.cs:17
Generated by
1.9.2