Execute a LINQ query using T-SQL code in the LINQ expression
LINQ
1
Posts
1
Posters
1
Views
1
Watching
-
Hello everyone. First i ask sorry for my poor enlish, but i will try to explain myself in the best way i can. What i wish to know is: Make a generic query to get one record from the database using the id's fields. But the number of the ids fields(and its types) different from table to table. I intend to build a LINQ query and mix T-SQl code to build the WHERE expression. Something like that: var query = from e in dbContext.ObjectSetNameToextractFrom(*) includeThis("WHERE id1 = value1 AND id2 = value2....") select e; (*) the name of the table where i want to extract the unique record from . Thanks ofr your help. Best regards, jonatan