reflection general types
i'm minute formula category constructor loops by properties category calls general stationary slight populates category information an outmost api. i've got an instance class:
public category myclass{
open twine property1 { get; set; }
open int property2 { get; set; }
open bool property3 { get; set; }
open stationary t dostuff<t>(string name){
// information ability outmost api
// there's problem relapse 'default(t)'
}
}
now constructor i wish something this:
public myclass(){
var properties = this.gettype().getproperties();
foreach(propertyinfo p properties){
p.setvalue(this, dostuff(p.name), new object[0]);
}
}
so above constructor thrown an blunder since i'm sustenance general type.
so i pass form ability in?
Comments
Post a Comment