Cast checking and casting in the same line
Wed Jul 27 2022 17:22:45 GMT+0000 (Coordinated Universal Time)
Saved by @Marcos_
Using the TryGetValue() dictionary retrieval method, we retrieve the command from the key then we check if the ICommand can be converted to type ICommand<T> of typw ICommand<T>, using the "is" syntax. if that evaluates to true, we then cast the ICommand to the ICommand<T> for the return statment
Comments