Skip to main content
A newer version of this page is available. .
.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.

EFCoreObjectSpace Class

An Object Space used for data manipulation in EF Core-based applications that do not use the Security System.

Namespace: DevExpress.ExpressApp.EFCore

Assembly: DevExpress.ExpressApp.EFCore.v20.2.dll

Declaration

public class EFCoreObjectSpace :
    CompositeObjectSpace

Remarks

If your application uses the Security System, create the SecuredEFCoreObjectSpace instead of EFCoreObjectSpace.

In XAF application, use the XafApplication.CreateObjectSpace method to create this Object Space if the default Object Space Provider is EFCoreObjectSpaceProvider (see the CreateDefaultObjectSpaceProvider method implementation of your WinApplication descendant).

The following example demonstrates how to use EFCoreObjectSpaceProvider to create EFCoreObjectSpace in a non-XAF application.

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.EFCore;
using Microsoft.EntityFrameworkCore;
using System;
// ...
class Program {
    static void Main() {
        EFCoreObjectSpaceProvider objectSpaceProvider = 
            new EFCoreObjectSpaceProvider(typeof(ApplicationDbContext),
            (builder, _) => builder.UseSqlServer(
                ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString));
        IObjectSpace objectSpace = objectSpaceProvider.CreateObjectSpace();
        // ...
    }
}

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).

To learn more about Object Spaces, refer to the BaseObjectSpace class description.

Implements

See Also