I have two methods in my EF context class, one is an override and one is a new member like this:
public override Task<int> SaveChangesAsync(CancellationToken cancellationToken = default)
…
public virtual async Task<int> SaveChangesAsync(string userId = "")
Why are all calls like await context.SaveChangesAsync()
resolving to the second one? Why are they not considered part of same method group by VS C# language service? Why are these calls not causing any ambiguity for the compiler?
When I tried adding new
to the second method, thinking that it was hiding the base method, the compiler complained that the modifier was not needed.