I have a class as follows:
public class DummyReturnDto
{
public Set1ReturnDto Foo { get; set; }
public Set2ReturnDto Bar { get; set; }
public DummyReturnDto()
{
Set1 = new Set1ReturnDto();
Set2 = new Set2ReturnDto();
}
}
where all the properties are guaranteed to have classes as their types and will be unique. I would like to use reflection to set the value for the property given a particular type. So for Set1ReturnDto:
var propertyInfo = obj.GetType().GetProperty(Set1ReturnDto, ??????);
propertyInfo.SetValue(obj, value, null);
and then for Set2ReturnDto
var propertyInfo = obj.GetType().GetProperty(Set2ReturnDto, ??????);
propertyInfo.SetValue(obj, value, null);
EDIT:
This is part of the needed knowledge to implement requirements for Generic approach to dealing with multiple result sets from EF stored procedure