refresh user

This commit is contained in:
john 2025-05-19 09:23:20 +02:00
parent 4e24796a5d
commit 0d34774059
12 changed files with 141 additions and 32 deletions

View file

@ -0,0 +1,16 @@
using Microsoft.Extensions.DependencyInjection;
namespace Femto.Modules.Auth.Application;
/// <summary>
/// We use this to bind a scope to the request scope in the composition root
/// Any scoped services provided by this subcontainer should be accessed via a ScopeBinding injected in the host
/// </summary>
/// <param name="scope"></param>
public class ScopeBinding(IServiceScope scope) : IDisposable
{
public T GetService<T>() where T : notnull => scope.ServiceProvider.GetRequiredService<T>();
public void Dispose() => scope.Dispose();
}