Skip to main content
All docs
V24.2
.NET 8.0+

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

XAF0031: Add the UseChangeTrackingProxies() call for automatic UI updates

Severity: Warning

Enable the DbContextOptionsBuilder.UseChangeTrackingProxies() option for automatic UI updates and change notifications from business object setters.

For more information, refer to the following topic: PropertyChanged and CollectionChanged Event in Entity Framework Core.

#Examples

See the Startup.cs file in YourSolutionName.Blazor.Server and YourSolutionName.Win projects:

#Invalid Code

public void ConfigureServices(IServiceCollection services) {
    services.AddXaf(Configuration, builder => {
        // ...
        builder.ObjectSpaceProviders
            .AddEFCore(options => options.PreFetchReferenceProperties())
                .WithDbContext<YourSolutionName.Module.BusinessObjects.YourSolutionNameEFCoreDbContext>((serviceProvider, options) => {
                    // ...
                    options.UseSqlServer(connectionString);
                    options.UseObjectSpaceLinkProxies();
                    options.UseLazyLoadingProxies();
                })
            .AddNonPersistent();
    });
}

#Valid Code

public void ConfigureServices(IServiceCollection services) {
    services.AddXaf(Configuration, builder => {
        // ...
        builder.ObjectSpaceProviders
            .AddEFCore(options => options.PreFetchReferenceProperties())
                .WithDbContext<YourSolutionName.Module.BusinessObjects.YourSolutionNameEFCoreDbContext>((serviceProvider, options) => {
                    // ...
                    options.UseSqlServer(connectionString);
                    options.UseChangeTrackingProxies();
                    options.UseObjectSpaceLinkProxies();
                    options.UseLazyLoadingProxies();
                })
            .AddNonPersistent();
    });
}