So I'm migrating from .NET Framework to .NET 6. I'm in a function where the guy I took over from spends line 693 - 760 generating a query in SQL and getting the result with this:
var result = db.Database.SqlQuery<CustomObject>(sqlQuery.ToString(), parameters.ToArray());
But I am very kindly being informed that:
'DatabaseFacade' does not contain a definition for 'SqlQuery' and no accessible extension method 'SqlQuery' accepting a first argument of type 'DatabaseFacade' could be found (are you missing a using directive or an assembly reference?)
I am using System.Data.Entity as the docs say. I know I can do db.[TableName].FromSqlRaw, but I can't use that because the object I need isn't in the database.
I've got the following packages but I may be missing something?

db.Database.ExecuteSqlRawfor example, which you probably would have found if you have looked for it.Keylessentities, but first you need to fix your project up a bit. You have referenced both Entity Framework 6 and EFCore. Remove EntityFramework 6.4.4 from your project. learn.microsoft.com/en-us/ef/core/modeling/…