Closed ysmoradi closed 5 years ago
app.UseEFSecondLevelCache()
is equal to the EFServiceProvider.ApplicationServices = serviceProvider;
.
More info from the unit tests project which its setup is the same as console apps.
Also you can find a console app sample here.
This approach is not possible anymore due recent breaking changes
Yes. Just use services.AddEFSecondLevelCache();
. That would be enough.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related problems.
Summary of the issue
I tried to use this library with Microsoft.EntityFrameworkCore.SQLite 2.0 in Xamarin based mobile/desktop app. (A .NET Standard 2.0 based project). I stopped with the following exception:
Please add
AddEFSecondLevelCache
method toIServiceCollection
and also addUseEFSecondLevelCache
method toIApplicationBuilder
.Environment
I think it's not possible to use this library in other scnarios too. For example, if I write a .NET Core 2 console app which gets executed by azure jobs, I'll receive the same exception, because there is no asp.net core there. I'm open to send a PR for this if you think it helps. Thnaks in advance.