private static void CheckIsGenericType (Type type, string methodName) { if (!type.IsGenericType) { string message = string.Format("{0}() called with invalid Type ({1})", methodName, type.FullName); throw new Exception(message); } } }