views:

57

answers:

1

Is it possible to add a property to an entity where the property is not supposed to map to the database?

A: 

Possible? Sure; add it to a custom partial class matching your entity type. Useful? Less so; you (mostly) can't use them in LINQ to Entities queries, and you shouldn't re-purpose your entities as view models.

Craig Stuntz
Thanks alot for the feedback
seddler
Adding properties in an partial class works fine when reading from database to display info on screen. But when I'm saving an entity I get an error telling me that the column (the added property) does not exist. How can I avoid thid issue? Any thoughts?
seddler
I can't give a useful answer with only a vague description of the error you're seeing and nothing precise about what you're doing. The source code, the exact error, and a call stack is really a minimum for "debugging over the web."
Craig Stuntz