Files
work-club-manager/backend/WorkClub.Api/Middleware/MemberSyncMiddleware.cs
T

27 lines
509 B
C#
Raw Normal View History

using WorkClub.Api.Services;
namespace WorkClub.Api.Middleware;
public class MemberSyncMiddleware
{
private readonly RequestDelegate _next;
public MemberSyncMiddleware(RequestDelegate next)
{
_next = next;
}
public async Task InvokeAsync(HttpContext context, MemberSyncService memberSyncService)
{
try
{
await memberSyncService.EnsureMemberExistsAsync(context);
}
catch
{
}
await _next(context);
}
}