Is there a simple way to handle properties that are only mapped some of the time? For example:
I have a products table and products entity. Most of the time I use LINQ to SQL to execute the equivalent of:
select * from products where...
However, occasionally, I manually write a SQL query that is more like:
select products.*, someOtherVal, anotherVal from products join....
As far as I know, I can't add someOtherVal
and anotherVal
to my entity because they are not always mapped to a column.
Note: I realize it might be better to properly set up all of my entities and relationships and not use Entity.SqlQuery(). I'm just wondering if there's a quick way to accomplish my goal for now. I will make improvements later as I continue converting my application to EF.