0

I am wondering about designing a EF core model of the SAP B1 database. I realize that this is a major undertaking, but I aim to start small. This is mainly as an exercise, which may lead to something in the future. My main issue right now, is to ensure that the DbContext is read-only.

I have found several suggestions, like this one: How to make Entity Framework Data Context Readonly

However, that is for the Entity Framework "standard" not core, and the accepted solution does not seem to be possible with EF Core.

So, aside from using a login without write permissions, how would I go about making a read-only DbContext?

I am using EF Core 5.0.

Thomas Due
  • 43
  • 1
  • 2
  • Why would you like to use EF for a read-only application? Try any simpler ORM if you just want to query tables, like dapper. – Antonio Rodríguez Sep 11 '21 at 14:59
  • Well, the primary reason is that I was wondering about using EF Core as my ORM for custom stuff. The main rule about the SAP B1 database though, is that system tables are absolutely off-limits regarding direct access for anything but reading. Thus it would make sense, to have system tables etc. read-only in my datalayer but, custom tables and fields writable. – Thomas Due Oct 20 '21 at 07:23

0 Answers0