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.
CslaOptions.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="CslaConfiguration.cs" company="Marimer LLC">
3// Copyright (c) Marimer LLC. All rights reserved.
4// Website: https://cslanet.com
5// </copyright>
6// <summary>Use this type to configure the settings for CSLA .NET</summary>
7//-----------------------------------------------------------------------
8using Csla.Core;
10using System;
11
12namespace Csla.Configuration
13{
17 public class CslaOptions
18 {
22 public IServiceCollection Services { get; private set; }
23
28 public CslaOptions(IServiceCollection services)
29 {
30 Services = services;
32 }
33
41 where T : IContextManager
42 {
43 Services.AddScoped(typeof(IContextManager), typeof(T));
44 return this;
45 }
46
54 {
56 return this;
57 }
58
65 {
67 return this;
68 }
69
85 public CslaOptions VersionRoutingTag(string version)
86 {
87 if (!string.IsNullOrWhiteSpace(version))
88 if (version.Contains("-") || version.Contains("/"))
89 throw new ArgumentException("VersionRoutingTag");
91 return this;
92 }
93
98 {
99 Core.FieldManager.PropertyInfoFactory.FactoryType = typeof(T);
100 return this;
101 }
102
106 internal SecurityOptions SecurityOptions { get; set; } = new SecurityOptions();
110 internal SerializationOptions SerializationOptions { get; set; } = new SerializationOptions();
114 internal DataPortalClientOptions DataPortalClientOptions { get; private set; }
118 internal DataPortalServerOptions DataPortalServerOptions { get; private set; } = new DataPortalServerOptions();
122 internal DataOptions DataOptions { get; set; } = new DataOptions();
123 }
124}
Provides consistent context information between the client and server DataPortal objects.
static bool UseReflectionFallback
Gets or sets a value indicating whether CSLA should fallback to using reflection instead of System....
static PropertyChangedModes PropertyChangedMode
Gets or sets a value specifying how CSLA .NET should raise PropertyChanged events.
PropertyChangedModes
Enum representing the way in which CSLA .NET should raise PropertyChanged events.
static string VersionRoutingTag
Gets a value representing the application version for use in server-side data portal routing.
Use this type to configure the settings for CSLA .NET.
Definition: CslaOptions.cs:18
IServiceCollection Services
Gets the current service collection.
Definition: CslaOptions.cs:22
CslaOptions VersionRoutingTag(string version)
Sets a value representing the application version for use in server-side data portal routing.
Definition: CslaOptions.cs:85
CslaOptions PropertyChangedMode(ApplicationContext.PropertyChangedModes mode)
Sets a value specifying how CSLA .NET should raise PropertyChanged events.
Definition: CslaOptions.cs:64
CslaOptions(IServiceCollection services)
Creates an instance of the type.
Definition: CslaOptions.cs:28
CslaOptions UseReflectionFallback(bool value)
Sets a value indicating whether CSLA should fallback to using reflection instead of System....
Definition: CslaOptions.cs:53
CslaOptions RegisterContextManager< T >()
Registers a specific ApplicationContext manager service, overriding the default service registration.
Definition: CslaOptions.cs:40
CslaOptions RegisterPropertyInfoFactory< T >()
Sets the factory type that creates PropertyInfo objects.
Definition: CslaOptions.cs:97
Use this type to configure the settings for security.
Defines the interface for an application context manager type.
Defines the interface for a factory object that creates IPropertyInfo objects.