Skip to main content
A newer version of this page is available.
All docs
V20.2
.NET Standard 2.0+
  • The page you are viewing does not exist in the .NET Framework 4.5.2+ platform documentation. This link will take you to the parent topic of the current section.

SecuredEFCoreObjectSpaceProvider Class

Provides an Object Space in EF Core-based applications that use the Security System.

Namespace: DevExpress.EntityFrameworkCore.Security

Assembly: DevExpress.EntityFrameworkCore.Security.v20.2.dll

Declaration

public class SecuredEFCoreObjectSpaceProvider :
    EFCoreObjectSpaceProvider,
    INonsecuredObjectSpaceProvider

Remarks

The following example demonstrates how to create the SecuredEFCoreObjectSpaceProvider in a non-XAF application.

using DevExpress.EntityFrameworkCore.Security;
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Security;
using DevExpress.Persistent.Base;
using DevExpress.Persistent.BaseImpl.EF.PermissionPolicy;
using Microsoft.EntityFrameworkCore;
using System.Configuration;
// ...
class Program {
    static void Main() {
        PasswordCryptographer.EnableRfc2898 = true;
        PasswordCryptographer.SupportLegacySha512 = false;
        AuthenticationStandard authentication = new AuthenticationStandard();
        SecurityStrategyComplex security = new SecurityStrategyComplex(
            typeof(PermissionPolicyUser), typeof(PermissionPolicyRole),
            authentication
        );
        SecuredEFCoreObjectSpaceProvider objectSpaceProvider = new SecuredEFCoreObjectSpaceProvider(
            security, typeof(ApplicationDbContext),
            XafTypesInfo.Instance, ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString,
            (builder, connectionString) => builder.UseSqlServer(connectionString)
        );
        // ...
    }
}

You can find the full example in the following GitHub repository: How to use the Integrated mode of the Security System in non-XAF applications (EF Core).

Inheritance

Object
EFCoreObjectSpaceProvider
SecuredEFCoreObjectSpaceProvider
See Also