asp.net mvc 3 - Listing all types -
i've defined class "contract", derive several types of contracts. i'm using entity framework storage , opted table-per-type model such end tables contract_put, contract_call, different derived classes.
now want list contracts , create field strings identifying contract type. tried this:
var ret = c in db.contracts select new contractsvm { ... }
however, there's no way can find figure out type of contract... help?
var ret = c in db.contracts.oftype<contract_put> select new contractsvm { strtype="put",... }; ret = ret.concat(from c in db.contracts.oftype<contract_call> select new contractsvm { strtype="call",... });
the variable ret
contains these values. hope helps!
Comments
Post a Comment