よく使われるメソッド
よく使われるメソッド
よく使われるメソッド
よく使われるメソッド
private static void ValidateValueIsCorrectType <T>(object value, string referenceId) { try { // No need to worry about unboxing here since T will always be a reference type at this point. T _ = (T)value; } catch (InvalidCastException) { ThrowHelper.ThrowInvalidOperationException_MetadataReferenceOfTypeCannotBeAssignedToType( referenceId, value.GetType(), typeof(T)); throw; } }