mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-03-04 00:35:47 +08:00
22 lines
565 B
C#
22 lines
565 B
C#
using Microsoft.Extensions.DependencyInjection;
|
|
using Yi.Framework.Infrastructure.CurrentUsers;
|
|
using Yi.Framework.Infrastructure.CurrentUsers.Accessor;
|
|
|
|
namespace Yi.Framework.Infrastructure.AspNetCore
|
|
{
|
|
public static class CurrentUserAddExtensions
|
|
{
|
|
public static IServiceCollection AddCurrentUserServer(this IServiceCollection services)
|
|
{
|
|
services.AddSingleton<ICurrentPrincipalAccessor, HttpContextCurrentPrincipalAccessor>();
|
|
return services.AddTransient<ICurrentUser, CurrentUser>();
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|