I am trying to run a SQL Query against a database:
public partial class Report2
{
public string Col1 { get; set; }
public string Col2 { get; set; }
}
var query = db.Database.SqlQuery<Report2>("Select Substring([English],1,1), Count(1) From Phrase Group by Substring([English], 1, 1)");
Running the select manually gives me 36 rows with values in two columns just like I would expect.
However when I run the EF version it gives me 36 objects but col1 and col2 are null in all of them.
Does anyone have any ideas why the results in Report2 would just be all nulls?
Select Substring([English],1,1) Col1, Count(1) Col2....?