Reputation: 760
I am using EF6 and I am trying to get the table sizes. I believe this should work but the result comes back as zero:
public class SqlRes{
public int Size { get; set; }
}
var size = DbContext.Database.SqlQuery<SqlRes>("exec sp_spaceused Customer").ToList();
I have also tried to use type like string or int with no success. Please help.
Upvotes: 1
Views: 1475
Reputation: 16358
The property names of SqlRes
should match the column names returned by the stored procedure.
According to SQL Docs, the column names are:
Try changing your SqlRes
class to have those property names.
Upvotes: 1