CSLA.NET 5.4.2
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
WebConfiguration.cs
Go to the documentation of this file.
1#if NETSTANDARD2_0 || NET5_0 || NETCORE3_1
2//-----------------------------------------------------------------------
3// <copyright file="WebConfiguration.cs" company="Marimer LLC">
4// Copyright (c) Marimer LLC. All rights reserved.
5// Website: https://cslanet.com
6// </copyright>
7// <summary>Implement extension methods for .NET Core configuration</summary>
8//-----------------------------------------------------------------------
9using System;
10using Microsoft.AspNetCore.Builder;
11
12namespace Csla.Configuration
13{
17 public static class WebConfigurationExtensions
18 {
23 public static IApplicationBuilder UseCsla(this IApplicationBuilder app)
24 {
25 return UseCsla(app, null);
26 }
27
33 public static IApplicationBuilder UseCsla(
34 this IApplicationBuilder app, Action<CslaConfiguration> config)
35 {
36 ApplicationContext.DefaultServiceProvider = app.ApplicationServices;
37 ApplicationContext.WebContextManager =
38 new Csla.AspNetCore.ApplicationContextManager(app.ApplicationServices);
39 config?.Invoke(CslaConfiguration.Configure());
40 return app;
41 }
42 }
43}
44#endif
Application context manager that uses HttpContextAccessor when resolving HttpContext to store context...