Hello everyone
Does Radzen let you work with database table-valued functions? Is there a way to call db functions in ServerMethodsController custom methods?
Hello everyone
Does Radzen let you work with database table-valued functions? Is there a way to call db functions in ServerMethodsController custom methods?
Hi @luf,
According to this SO answer you have to use raw SQL with Entity Framework Core. This should work as expected in ServerMethodsController in Radzen.
Is it possible to call it directly from the EF context?
Like for example...
var courses = context.GetCourseListByStudentID(1)
.ToList<Course>();
No, Radzen doesn't scaffold functions at the moment.
In the end, I reached this solution:
Created the model needed for the data the function will return
Added a virtual DbSet to the Connection context class
Always in the context class I've created the method that will call
the SQL function with FromSql()
Finally I can call my function directly in the ServerMethodsController class through the Conn context class.