I am trying to figure out why the following code does not retrieve fields of type int?
private static List<FieldInfo> GetRelevantFields(Type type)
{
var myObjectFields = type.GetFields(
BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
var nonKeyFields = myObjectFields.ToList();
var fields = new List<FieldInfo>();
foreach (var fi in from fi in nonKeyFields
let colType = ColType(fi)
where colType != DBColumnType.Unknown // objects and nullable columns will be missed
select fi) fields.Add(fi);
return fields;
}
For example if I use
public class MyBusinessObject
{
public int? LookupId { get; set; } // this binding will not be retreived
public int Lookup2Id {get;set;} // this binding will be retreived
}
How do I get it to?
Looking at the decompiled code
Aucun commentaire:
Enregistrer un commentaire