I have a stored procedure which returns a single date string based on some logic with no column name.
My C# code using entiry framework
public string GetCurrTimeForUser(string userId)
{
using (var context = new RMTest())
{
var user_id = new SqlParameter("@USER_ID", userId);
var result = context.Database.SqlQuery<string>("EXEC PROC_GET_UTC_DATE",user_id);
return result.ToString();
}
}
and the output I am getting is "EXEC PROC_GET_UTC_DATE";
What is wrong with my approach?