thangchung / magazine-website

:mouse: A magazine website (using .NET Core, ASP.NET Core, EF Core) with DDD, CQRS, microservices, asynchronous programming applied...
https://github.com/thangchung/magazine-website
178 stars 51 forks source link

ReadModel should run the raw SQL to reduce the footprints when built with the ORM #7

Open thangchung opened 8 years ago

thangchung commented 8 years ago

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.