The Generic Rabbit Hole of Madness

added by Paul Wheeler
4/9/2018 2:25:02 PM

1 Kicks, 244 Views

Have you ever written a few generic classes and found yourself struggling to write yet another interface and class that interacts with those generic classes? Maybe something like this: public interface IMultipleMappingCommandExecutor where TRepository : IRepository { IEnumerable ExecuteCommands ( IEnumerable > commands) where TCommandInput : ICommandInput where TCommandOutput : ICommandOutput; } If you've gone down this path, you've likely experienced the frustration of cycling through these various states: It won't compile.


0 comments