magazine-website
magazine-website copied to clipboard
ReadModel should run the raw SQL to reduce the footprints when built with the ORM
Problem: At the moment, we use the DbContext for the ReadModel with the constraint on the specific entity. That looks like will not be a good approach for CQRS. Solution: Apply the raw SQL execute, reference at http://www.elanderson.net/2016/04/execute-raw-sql-in-entity-framework-core, we can build 2 providers: SQL server and Postgresql.