it's a question.
I need to store props for my objects. And I do not know - what kind of prop it is - it's data driven. I use 'object type' for 'value' of prop, but... Will EF work with object type?
Object is never complex type - it's Boolean,String,Int and Guid.
Until EF steps in the game - all was OK.
Thanks.
No. EF doesn't support this because it would require "dynamic" column type in the database. Database can support such scenario - for example SQL server offers sql_variant
. Unfortunately EF cannot map these columns. Here is workaround for using variant column in read only scenarios. The workaround uses DefiningQuery
in EDMX. In theory you should be able to map modification commands as well to be able to use it for saving changes. It is not possible to use it in code first - code first offers only basic mapping.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With