It seems like your application is continuously executing certain queries that are not required and may be causing performance issues. Here are a few steps you can take to stop these queries:
Check if the Entity Framework context is configured correctly: If the __MigrationHistory and EdmMetadata tables are not present in the database, it is possible that the Entity Framework context is not configured correctly. Check if the database context class is inheriting from the DbContext class and if the migration configuration class is properly set up.
Disable automatic migrations: If you are not using Entity Framework Migrations, you can disable automatic migrations by setting the "AutomaticMigrationsEnabled" property to "false" in the migration configuration class.
Optimize your Entity Framework queries: If you are using Entity Framework queries in your application, make sure that they are optimized for performance. You can use the Entity Framework Profiler or SQL Server Profiler to identify any inefficient queries.
Cache frequently accessed data: If certain data is frequently accessed, consider caching it in memory to reduce the number of database queries.
Tune your database: If your database is experiencing performance issues, consider tuning it by optimizing indexes, updating statistics, and monitoring database performance metrics.
Use a performance monitoring tool: Use a performance monitoring tool like SQL Server Profiler or New Relic to identify the root cause of the performance issues and to monitor the impact of any changes made to the application or database.
By taking these steps, you should be able to identify and stop the unnecessary queries that are causing performance issues in your application.