6
Convert.ChangeType (), Nullable Türlerinde başarısız oluyor
Bir dize adını bir dize olarak sahip bir nesne özellik değerine dönüştürmek istiyorum. Bunu böyle yapmaya çalışıyorum: string modelProperty = "Some Property Name"; string value = "SomeValue"; var property = entity.GetType().GetProperty(modelProperty); if (property != null) { property.SetValue(entity, Convert.ChangeType(value, property.PropertyType), null); } Sorun, bu başarısız oluyor ve özellik türü null olabilecek …
301
c#
.net
reflection