SecuredObjectSpaceProviderBuilderExtensions.AddSecuredXpo<TContext>(IObjectSpaceProviderBuilder<TContext>, Action<XafApplication, SecuredXPObjectSpaceProviderOptions>) Method
Adds the SecuredObjectSpaceProvider to your WinForms application.
Namespace: DevExpress.ExpressApp.ApplicationBuilder
Assembly: DevExpress.ExpressApp.Security.Xpo.v24.1.dll
NuGet Package: DevExpress.ExpressApp.Security.Xpo
Declaration
public static IObjectSpaceProviderBuilder<TContext> AddSecuredXpo<TContext>(
this IObjectSpaceProviderBuilder<TContext> builder,
Action<XafApplication, SecuredXPObjectSpaceProviderOptions> configureOptions
)
where TContext : IXafApplicationBuilder<TContext>, IAccessor<IServiceCollection>
Parameters
Name | Type | Description |
---|---|---|
builder | IObjectSpaceProviderBuilder<TContext> | Allows you to register and configure Object Space Providers in your application, and chain further provider registrations. |
configureOptions | Action<XafApplication, SecuredXPObjectSpaceProviderOptions> | Options that allow you to configure the secured Object Space Provider. |
Type Parameters
Name | Description |
---|---|
TContext | The IWinApplicationBuilder type. |
Returns
Type | Description |
---|---|
IObjectSpaceProviderBuilder<TContext> | Allows you to register and configure Object Space Providers in your application, and chain further provider registrations. |
Remarks
The following example demonstrates how to use this method:
File: MySolution.Win\Startup.cs.
using DevExpress.ExpressApp.ApplicationBuilder;
using DevExpress.ExpressApp.Win.ApplicationBuilder;
// ...
public class ApplicationBuilder : IDesignTimeApplicationFactory {
public static WinApplication BuildApplication(string connectionString) {
var builder = WinApplication.CreateBuilder();
builder.UseApplication<MySolutionWindowsFormsApplication>();
builder.ObjectSpaceProviders
.AddSecuredXpo((application, options) => {
options.ConnectionString = connectionString;
})
.AddNonPersistent();
}
// ...
}
See Also