I use EF Core and ADO.NET for custom SQLs. I get all EF Core SQLs in my log files, but I do not see my custom SQLs (created using DbCommand).
How to log ALL SQLs my .net core app sends to the database?
I use EF Core and ADO.NET for custom SQLs. I get all EF Core SQLs in my log files, but I do not see my custom SQLs (created using DbCommand).
How to log ALL SQLs my .net core app sends to the database?
ADO.NET does not have logging (thank you @adam-vincent).
When performance is not an issue, Query types may be created as described in Raw SQL Query without DbSet and Entity framework Core Raw SQLQueries with custom model
for context.Query<T>.FromSql("Query")
.
Trying to query a type that is not registered as a 'query type' results in an error "System.InvalidOperationException: Cannot create a DbSet for 'ReportStatusCount' because this type is not included in the model for the context.".
Query types must have properties not fields.