
using Kimuser.Domain;
using Kimuser.Domain.SystemUsers;
using Kimuser.Infrastructure.Repositories;
using Kimuser.Services;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;

namespace Kimuser.Infrastructure
{
    public class DependencyRegister
    {
        public static void Register(IServiceCollection services)
        {
            services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();

            #region User
            services.AddScoped<IUserRepository<User>, UserRepository<User>>();
            services.AddScoped<IUserRepository<SystemUser>, UserRepository<SystemUser>>();
            //services.AddTransient<IUserRepository<SystemUser>, UserRepository<SystemUser>>();
            services.AddScoped<IUserService, UserService>();
            services.AddScoped<ISystemUserService, SystemUserService>();
            services.AddScoped<IRoleService, RoleService>();
            #endregion
        }
    }
}
