Пример #1
0
 public ElementService(IMapper Mapper, IMediatorHandler Bus, IMerchantRepository MerchantRepository, IRoleManngeRepository roleManngeRepository)
 {
     _Mapper               = Mapper;
     _Bus                  = Bus;
     _MerchantRepository   = MerchantRepository;
     _RoleManngeRepository = roleManngeRepository;
 }
Пример #2
0
 public MustRoleHandle(IAuthenticationSchemeProvider authenticationSchemeProvider, IHttpContextAccessor httpContextAccessor,
                       IRoleManngeRepository roleManngeRepository
                       )
 {
     Schemes               = authenticationSchemeProvider;
     _Accessor             = httpContextAccessor;
     _RoleManngeRepository = roleManngeRepository;
 }
Пример #3
0
 public UserCommandHandlers(IUnitOfWork uow,
                            IMediatorHandler bus,
                            IUserRepository UserRepository,
                            IRoleManngeRepository RoleManngeRepository,
                            IJwtInterface JwtInterface
                            ) : base(uow, bus)
 {
     _Bus                  = bus;
     _UserRepository       = UserRepository;
     _RoleManngeRepository = RoleManngeRepository;
     _JwtInterface         = JwtInterface;
 }
Пример #4
0
        public async static Task <bool> SeedData(IRoleManngeRepository _RoleMannageRepository, IUserRepository _UserRepository)
        {
            User user1 = new User(new Guid("9af7f46a-ea52-4aa3-b8c3-9fd484c2af12"), "110101199003076894", "test", "北京市东城区", "13666666666", Encrypt.EncryptPassword("123456"), "*****@*****.**");

            if (await _UserRepository.GetModelAsync(x => x.Id.Equals(user1.Id)) != null)
            {
                return(false);
            }
            RoleMannage roleMannage = new RoleMannage(user1.Id, "Permission", true);
            await _UserRepository.AddModel(user1);

            await _RoleMannageRepository.AddModel(roleMannage);

            return(true);
        }