public static IConfigurationProperties UseSqlServer(this IConfigurationProperties configuration, string nameOrConnectionString, Action <SqlServer> configureSqlServer)
        {
            var sqlServer = new SqlServer(nameOrConnectionString);

            configureSqlServer(sqlServer);
            configuration.Datastores.Add(sqlServer);
            return(configuration);
        }
        public NHibernateSessionSource(IConfigurationProperties configurationProperties)
        {
            _configurationProperties = configurationProperties;
            if(_sessionFactory != null) return;

            lock(_factorySyncRoot)
            {
                if(_sessionFactory != null) return;

                _configuration = AssembleConfiguration(null);
                _sessionFactory = _configuration.BuildSessionFactory();
            }
        }
Пример #3
0
        public static IConfigurationProperties UseJsonConverter([NotNull] this IConfigurationProperties properties, [NotNull] Action <JsonSettingConverter> jsonSettingConverterAction)
        {
            if (properties == null)
            {
                throw new ArgumentNullException(nameof(properties));
            }
            if (jsonSettingConverterAction == null)
            {
                throw new ArgumentNullException(nameof(jsonSettingConverterAction));
            }

            var converter = JsonSettingConverterFactory.CreateDefault();

            jsonSettingConverterAction.Invoke(converter);
            properties.Converter = converter;
            return(properties);
        }
Пример #4
0
 public static IConfigurationProperties UseJsonConverter(this IConfigurationProperties properties)
 {
     return(properties.UseJsonConverter(converter => { }));
 }
Пример #5
0
 public UserRepository(IConfigurationProperties configurationProperties)
 {
     _configurationProperties = configurationProperties;
 }
 public PersistenceConfigurer(IConfigurationProperties settings)
 {
     _settings = settings;
 }
 public static IConfigurationProperties UseAppSettings(this IConfigurationProperties properties)
 {
     properties.Datastores.Add(new AppSettings());
     return(properties);
 }
 public static IConfigurationProperties UseSqlServer(this IConfigurationProperties configuration, string nameOrConnectionString)
 {
     configuration.Datastores.Add(new SqlServer(nameOrConnectionString));
     return(configuration);
 }
Пример #9
0
 public AuthorizationRepository(IConfigurationProperties configurationProperties)
 {
     _configurationProperties = configurationProperties;
 }
Пример #10
0
 public TokenAuthorizer(IConfigurationProperties configurationProperties, IAuthorizationRepository authorization)
 {
     _configurationProperties = configurationProperties;
     _authorizationRepository = authorization;
     _tokens = new List <Token>();
 }
Пример #11
0
 public static IConfigurationProperties UseMultiple(this IConfigurationProperties properties, IEnumerable <IDatastore> datastores)
 {
     properties.Datastores.AddRange(datastores);
     return(properties);
 }
 public static IConfigurationProperties UseInMemory(this IConfigurationProperties properties, IEnumerable <ISetting> settings)
 {
     properties.Datastores.Add(new InMemory(settings));
     return(properties);
 }