How can I execute a scalar function using code first? Below is what I have tried but only the query itself is being returned, not the return value.
using (var dbContext = new FTTRContext())
{
queryResult =
dbContext.Database.SqlQuery<string>("SELECT [dbo].[ufnGetTotalUsers] (GETDATE())").ToString();
}
See Question&Answers more detail:os