Skip to content

Commit a201b26

Browse files
committed
Fix broken build
1 parent 4181997 commit a201b26

File tree

3 files changed

+5
-25
lines changed

3 files changed

+5
-25
lines changed

Extensions/Xtensive.Orm.Web/SessionManager.cs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -227,26 +227,4 @@ public SessionManager(RequestDelegate next)
227227
current = this;
228228
}
229229
}
230-
231-
232-
public class CustomActionFilter : IActionFilter
233-
{
234-
235-
236-
public void OnActionExecuted(ActionExecutedContext context)
237-
{
238-
239-
}
240-
241-
public void OnActionExecuting(ActionExecutingContext context)
242-
{
243-
var sessionParameter = context.ActionDescriptor.Parameters.FirstOrDefault(p => p.ParameterType == typeof(Session));
244-
context.ActionArguments[sessionParameter.Name] = OpenSession();
245-
}
246-
247-
private Session OpenSession()
248-
{
249-
return null
250-
}
251-
}
252230
}

Extensions/Xtensive.Orm.Web/SessionToActionProviderFilter.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ private async ValueTask ExecuteBeforeAction(ActionExecutingContext context, bool
114114

115115
//this search can probably be improved by caching action names with needed parameters
116116
foreach (var p in actionParameters) {
117-
if (p.ParameterType == SessionAccessorType) {
117+
if (p.ParameterType == WellKnownTypes.SessionAccessorType) {
118118
// trying to get registered accessor as service
119119
var accessor = GetSessionAccesorFromServices(context.HttpContext);
120120
if (accessor != null) {
@@ -198,13 +198,13 @@ private async ValueTask<IDisposable> CreateSessionAndBindContext(SessionAccessor
198198

199199
private static Domain GetDomainFromServices(HttpContext context)
200200
{
201-
var domain = (Domain) context.RequestServices.GetService(DomainType);
201+
var domain = (Domain) context.RequestServices.GetService(WellKnownTypes.DomainType);
202202
return domain == null
203203
? throw new InvalidOperationException("Domain is not found among registered services.")
204204
: domain;
205205
}
206206

207207
private static SessionAccessor GetSessionAccesorFromServices(HttpContext context) =>
208-
(SessionAccessor) context.RequestServices.GetService(SessionAccessorType);
208+
(SessionAccessor) context.RequestServices.GetService(WellKnownTypes.SessionAccessorType);
209209
}
210210
}

Extensions/Xtensive.Orm.Web/Xtensive.Orm.Web.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
</ItemGroup>
1717
<ItemGroup>
1818
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
19+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Abstractions" Version="2.2.0" />
20+
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.1.0" />
1921
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.7.0" />
2022
</ItemGroup>
2123
<ItemGroup>

0 commit comments

Comments
 (0)