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.
ApplicationContextFactory.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="ApplicationContextFactory.cs" company="Marimer LLC">
3// Copyright (c) Marimer LLC. All rights reserved.
4// Website: https://cslanet.com
5// </copyright>
6// <summary>Factory for creation of ApplicationContext instances for use in tests</summary>
7//-----------------------------------------------------------------------
8using System;
9using System.Collections.Generic;
10using System.Text;
12
14{
15 public static class ApplicationContextFactory
16 {
17
23 public static ApplicationContext CreateTestApplicationContext(TestDIContext context)
24 {
25 ApplicationContext applicationContext;
26
27 applicationContext = context.ServiceProvider.GetRequiredService<ApplicationContext>();
28 return applicationContext;
29 }
30
31 }
32}
Provides consistent context information between the client and server DataPortal objects.
Type to carry context information for DI in unit tests
IServiceProvider ServiceProvider
The service provider used to perform DI operations