database context scopes

This commit is contained in:
2021-12-11 15:24:47 +01:00
parent f08cc8b504
commit 48ce5419b1
8 changed files with 139 additions and 62 deletions
+13 -12
View File
@@ -41,14 +41,15 @@ public class ApplicationResolver : IApplicationResolver
Application app;
if (context.IsBackofficeRequest(Options.ZeroPath))
{
app = await ResolveFromUser(user);
}
else
{
app = await ResolveFromRequest(context);
}
//if (context.IsBackofficeRequest(Options.ZeroPath))
//{
// app = await ResolveFromUser(user);
//}
//else
//{
// app = await ResolveFromRequest(context);
//}
app = await ResolveFromRequest(context);
if (app == null)
{
@@ -109,10 +110,10 @@ public class ApplicationResolver : IApplicationResolver
/// <inheritdoc />
public async Task<Application> ResolveFromRequest(HttpContext context)
{
if (Options.Applications.Count < 2)
{
return (await GetApplications()).FirstOrDefault();
}
//if (Options.Applications.Count < 2)
//{
// return (await GetApplications()).FirstOrDefault();
//}
IApplicationResolverHandler handler = Handler.Get<IApplicationResolverHandler>();
Application app = handler?.Resolve(context.Request, await GetApplications());