Storing object as a column in LINQ

Posted by Alex on Stack Overflow See other posts from Stack Overflow or by Alex
Published on 2010-05-16T22:58:32Z Indexed on 2010/05/16 23:00 UTC
Read the original article Hit count: 249

Filed under:
|
|
|
|

Hello,

i have some class which constructs itself from string, like this: CurrencyVector v = new CurrencyVector("10 WMR / 20 WMZ"); it's actually a class which holds multiple currency values, but it does not matter much.

I need to change type of column in my LINQ table (in vs 2010 designer) from String to that class, CurrencyVector.

If i do it - i get runtime error when LINQ runtime tries to cast String as CurrencyVector (when populating the table from database). Adding IConvertible did not help.

I wrapped these columns in properties, but it's ugly and slow solution. Searching internet gave no results.

© Stack Overflow or respective owner

Related posts about LINQ

Related posts about object