I am using EfCore to build my Data access layer, the database is an sql server database.
After generating the Model using Scaffold-DbContext
, I add some custom entities that I will fill up using custom sql query.
I wanted to know if there is someway to tell the DbContext that whenever I ask for CustomEntity
use this query to fill it, without using FromSql("query")
, so I can do this context.CustomEntity.ToList()
.
the Dbset is readonly, there is no need to track changes or anything else.