How can I make Entity Framework SqlQuery to return an Anonymous type.
Right now I run a context.TheObject.SqlQuery()
RAW query. the query joins two tables and I want to return the results of the joined tables.
If I use it with a type context.TheObject.SqlQuery()
I only get to see the results of the table of that same type.
I tried db.Database.SqlQuery<DbResults>("the sql query here")
; With a pre-defined class that matches the result's objects, but all the fields are null.
Using Entity Framework 6 with MySQL.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…