Use own database context, for example with SQLite
Purpose
I will use only one database context for all in my application and so I have wrote this change. The main change for developer is first initialize of database context and then initialize azure auth.
Does this introduce a breaking change?
[x] Yes
[ ] No
Pull Request Type
[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:
How to Test
- Get the code
git clone [repo-address]
cd [repo-name]
git checkout [branch-name]
[change settings in appsettings.json]
dotnet run
- Test the code
@jmprieur I am assigning you to review this PR and make a decision. I can see that this architecture is more likely the industry standards, however it brings code that is not the purpose of this sample. On the other hand, we are preparing the extensions project to be a nuget package and the SqlCache provider shouldn`t define what DB tool to use.
@IxelBox thanks for the collaboration. We will analyze it soon.
@IxelBox : thanks for much for this contribution @TiagoBrenck : I like the idea.
We probably want to understand if an implementation of IDistributedCache for SQL lite would be better? (See https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/pull/173)
@TiagoBrenck : the question is could we or @IxelBox provide an implementation of IDistributedCache for SQLLite. See Distributed caching in ASP.NET Core
Then Microsoft.Identity.Web (but not only) would immediately benefit from it as described in Token cache serialization
@v-michaelmi , review and approve or reject