We're in 2025 and we should restructure the database access for the future:
- remove non-async interfaces from DatabaseAccessAbstractions, eliminate Async prefix in remaining interfaces (I/O with third-party systems should always be async)
rename IReadOnlySession to IClient - even if callers do not want to explicitly call SaveChangesAsync, their might be data manipulation going on. This kind of humble object simply behaves like an HttpClient - there could be a transaction, there might be immediate data manipulation, we simply don't know that it is read-only. We will drop the IReadOnlySession interface altogether and simply rely on IAsyncDisposable.
Rename the namespace DatabaseAccessAbstractions to DataAccessAbstractions - when we have an IClient, we cannot be sure that we connect to a database.
- Drop the interfaces
IAsyncTransactionalSession and IAsyncTransaction.
We're in 2025 and we should restructure the database access for the future:
renameWe will drop theIReadOnlySessiontoIClient- even if callers do not want to explicitly callSaveChangesAsync, their might be data manipulation going on. This kind of humble object simply behaves like anHttpClient- there could be a transaction, there might be immediate data manipulation, we simply don't know that it is read-only.IReadOnlySessioninterface altogether and simply rely onIAsyncDisposable.Rename the namespaceDatabaseAccessAbstractionstoDataAccessAbstractions- when we have anIClient, we cannot be sure that we connect to a database.IAsyncTransactionalSessionandIAsyncTransaction.