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

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -