Reputation: 15138
I want to override the
public virtual Task<int> SaveChangesAsync(CancellationToken cancellationToken = default);
of any DbContext
in my solution globaly and change it to
public virtual Task<MyDatabaseReturnModel> SaveChangesAsync(CancellationToken cancellationToken = default);
Is that possible?
Upvotes: 0
Views: 310
Reputation: 169160
Is that possible?
No. You can't change the signature of a method by overriding it. You can only change the implementation. The SaveChangesAsync
method must still return a Task<int>
or int
. This is how it is defined.
Upvotes: 2