Efcore: Making DbContext Proxyable

Created on 8 Oct 2020  路  1Comment  路  Source: dotnet/efcore

Sorry if this is the wrong place to post this.

I proxy DbContext for several purposes but I recently tried v5.0 and noticed that it introduces 3 non-virtual members which make DbContext less proxyable.

public event EventHandler<SavingChangesEventArgs> SavingChanges;
public event EventHandler<SavedChangesEventArgs> SavedChanges;
public event EventHandler<SaveChangesFailedEventArgs> SaveChangesFailed;

I hope you consider making them virtual.

closed-wont-fix customer-reported type-enhancement

Most helpful comment

@mnver1 Event overriding behavior is undefined in C#. Consider hiding them instead.

>All comments

@mnver1 Event overriding behavior is undefined in C#. Consider hiding them instead.

Was this page helpful?
0 / 5 - 0 ratings