I have the following function in my SQL Server:
getMaxSL(paramter)
which will return a string value.
I have tried to call and execute this function from the Entity Framework in the following ways but did not work for me, instead it's returning the sql query itself.
var styleCode = (_dbContext as IObjectContextAdapter).ObjectContext.CreateQuery<string>("Select dbo.getMaxSL(500)");
and
var styleCode = _dbContext.Database.SqlQuery<string>("Select dbo.getMaxSL(500)");
Would anyone tell me what are the best possible ways to call and execute a SQL Server function in Entity Framework??