Created
September 13, 2011 14:24
-
-
Save hotgazpacho/1213918 to your computer and use it in GitHub Desktop.
Looking up a Type, and converting it to a generic parameter for a method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public bool IsSurveillanceNoUnique(string surveillanceNo, SurveillanceType surveillanceType, SurveillanceContext surveillanceContext) | |
| { | |
| var sType = SurveillanceTypeMap[surveillanceType]; | |
| var methodInfo = _surveillances.GetType().GetMethod("IsSurveillanceNoUnique"); | |
| methodInfo = methodInfo.MakeGenericMethod(sType); | |
| var unique = (bool) methodInfo.Invoke(_surveillances, new object[] {surveillanceNo, surveillanceContext}); | |
| return unique; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment