i have a question what i couldnt resolve it for 2 days. I'm working on .NET Core 2.2 by the way and thats why i'm using Entity Framework Core.
I have a views in my database and i dont know how to get view from code side. Because my views consisting of these;
CREATE VIEW table_column as
SELECT db.database_id,db.name,col.TABLE_NAME,col.COLUMN_NAME from sys.databases as db
INNER JOIN INFORMATION_SCHEMA.COLUMNS as col ON db.name = col.TABLE_CATALOG
Someone adviced me these;
var rawSQL = dbContext.Database.SqlQuery<SomeModel>("Raw SQL Query").ToList();
and this
var rawSQL = dbContext.SomeModels.FromSql("your SQL");
but they didnt work. As the last one i tried this;
how to use views in code first entity framework
but again didnt work because this is for the code first project.
AS A RESULT WHAT CAN I DO. I am about to go crazy.