Question

The scenario:

  1. I have a considerable amount of entities as models in CodeFirst mapped to the database fieldname with the Attribute [Column("str")].

  2. I have a bunch of Reporting Service Reports (in local-mode) with the DataSets mapped to the database field names.

I can't pass direct results of linq queries to those reports with the ToList() method because of the field names. What I can do (and I'm trying to avoid) is to type select new for each object; or run each query via a different datasource.

Question:

I would like to know if there is any trick to have a IQueryable object with the original field names instead of the property names. Something like a dynamic select new.

Any suggestions will be appreciated.

Was it helpful?

Solution

No, there isn't. The database column names either have to match the property name, or you have to use the Column attribute to make them line up. That's your only choices.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top