You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created a web api project using .net core and entity framework.
This uses a stored procedure which returns back most of the properties of a table defined by entity framework.
The entity framewrok does not bring back all the columns of the table. And I get an error when I call the api complaining it cannot find the missing columns when I execute the stored procedure using ,
So does that mean I should not add my own model class and change the SP to return all the properties of the entity. So what about really complicated sql SP which does not need the entire column of a table to return(may be uses joins between tables in database)?
I created a web api project using .net core and entity framework.
This uses a stored procedure which returns back most of the properties of a table defined by entity framework.
The entity framewrok does not bring back all the columns of the table. And I get an error when I call the api complaining it cannot find the missing columns when I execute the stored procedure using ,
_context.Set().FromSql("execute dbo.spr_GetValue").ToList();
I created another model class which defines the properties brought back from the SP( called NewClass).
_context.Set().FromSql("execute dbo.spr_GetValue").ToList();
This works, but just wanted to check if there is a convention that the SP should only return the model classes from the database.
Thanks in advance.
The text was updated successfully, but these errors were encountered: