Пример #1
0
 public TenantMgmtRepository(IConnectionFactory connectionFactory,
                             SimplePasswordHasher passwordHasher,
                             IOptions <DefaultValueConfig> config,
                             ILogger <TenantMgmtRepository> logger,
                             IMapper mapper,
                             IPrincipal principal) : base(connectionFactory, logger, mapper, principal)
 {
     _passwordHasher = passwordHasher;
     _logger         = logger;
     _mapper         = mapper;
     _config         = config.Value;
 }
Пример #2
0
 public AccountRepository(IConnectionFactory connectionFactory,
                          IOptions <DefaultValueConfig> config,
                          IJwtProvider jwtProvider,
                          SimplePasswordHasher passwordHasher,
                          ILogger <AccountRepository> logger,
                          IMapper mapper,
                          IPrincipal principal) : base(connectionFactory, logger, mapper, principal)
 {
     _config         = config.Value;
     _jwtProvider    = jwtProvider;
     _passwordHasher = passwordHasher;
     _logger         = logger;
     _mapper         = mapper;
 }
Пример #3
0
        protected virtual object GetDefaultValue(BindingFlags bindFlag)
        {
            object defaultValue;

            string[] config = DefaultValueConfig.Split(',');
            if (config.Length == 3)
            {
                Assembly assembly = Assembly.Load(config[2]);
                Type     type     = assembly.GetType(config[1]);
                defaultValue = type.InvokeMember(config[0], bindFlag, null, null, null);
            }
            else
            {
                Type type = Type.GetType(config[1]);
                defaultValue = type.InvokeMember(config[0], bindFlag, null, null, null);
            }
            return(defaultValue);
        }