After reading Skeet's article, I went with the general advice to "..consider renaming some of the methods to reduce the degree of overloading. This advice goes double when it's across an inheritance hierarchy.."
BUT I would like to understand the ambiguity a bit more (and see if I can keep the overloads!)
These are just some testing helpers to help stub out parts of tedious tests that might require various flavors of view models to be in some Valid or Invalid state first.
I started out using these helpers on two view model that do not have an inheritance relationship and they worked fine.
Then I decided another would be useful for another oveload for ViewModelWrapper, which is the base class to the other view model types. So the compiler complained it didn't know which extension to use for a previously working subclass of the VmWrapper.
So that's the 3rd overload and the 1st in the code below in this case. Like I implied, I already just did away with the overloads, but
Does anyone see how I might keep these working as overloads?
Cheers,
Berryl
// SatVm
public static void MakeValid<TParentModel, TModel>(this ISatelliteVm<TParentModel, TModel> instance, IEntityValidator validator) {...}
// HubVm
public static void MakeValid<TParentModel>(this HubViewModel<TParentModel> instance, IEntityValidator validator, bool bValid = true)
where TParentModel : Entity { ... }
// VmWrapper
public static void MakeValid<TModel>(this ViewModelWrapper<TModel> instance, IEntityValidator validator) { ... }