Enable constructor contracts
That would be great to be able to define methods in interfaces as contructors - I mean a way of forcing the implementers to have a constructor matching the one defined in the interface.
Also that would be great to have static interfaces (contracts, which static classes can implement).
Thanks for taking the time to share this suggestion. This item has been around for a couple of versions of Visual Studio and we haven’t acted on it. Looking at the VS “15” plans, we’re not going to take action on this item, so we’re going to close it. If the suggestion is still relevant, please either take a look to see if there’s another suggestion that’s similar that you can vote on, or open a new suggestion.
- The Visual Studio Team
Bummer and a great design miss
Artak Mkrtchyan commented
Sure I can, but that's a pattern, not a language level solution, what I've asked for.
Henning Dieterichs commented
You could solve it currently with the abstract factory pattern.
This is the feature I most wish C# had.