6
반사와 함께 '주조'
다음 샘플 코드를 고려하십시오. class SampleClass { public long SomeProperty { get; set; } } public void SetValue(SampleClass instance, decimal value) { // value is of type decimal, but is in reality a natural number => cast instance.SomeProperty = (long)value; } 이제 반사를 통해 비슷한 작업을 수행해야합니다. void SetValue(PropertyInfo info, …
81
c#
reflection
casting