I have a difficult SQL query, and I don't want to rewrite it on Linq. The problem is: I have two equal tables and I must use one of them in depending on the some condition. So, to pass parameter (the name of table) I use this:
List<Variables> lst = db.Database
.SqlQuery<Variables>(s, new SqlParameter("tableSource", sourceTable))
.ToList();
And My query like this:
SELECT @tableSource.PlanId,
@tableSource.PlanSmall AS PlanImg,
@tableSource.NOb,
...
It Doesn't works, could someone help me, please?