3
For read-only contexts, add the following in the context class:
public override int SaveChanges()
{
throw new AccessViolationException(
"Contexto é somente leitura.");
}
public override async Task<int> SaveChanges()
{
throw new AccessViolationException(
"Contexto é somente leitura.");
}
This ensures that the context cannot make modifications to the database.
Plus, I think you’re already using it accordingly.
It depends on what you mean by repurposing. Do the two Databases have objects in common? The two Databases have completely different objects?
– Leonel Sanches da Silva
The two objects have a completely different database. Basically, in one I have a financial accompaniment with duplicates and blablabla already in the other, I have the pre-order that through an ERP, will generate these duplicates. My platform is for transactions, it’s for reports only. I won’t have any delete/edit/add method. So I wanted a simple way to work the consultations in these two banks.
– Rafael Barbosa