public ProjectManagement() { projectRepository = new RepositoryProject(); accoutM = new RepositoryAccount(); taskManagement = new TaskManagement(); configSystenm = new RepositoryConfig(); }
public RepositoryImpl([NotNull] DbContext dbContext, [NotNull] IRepositoryConfig config) { _objectContext = (dbContext as IObjectContextAdapter).ObjectContext; _config = config; _objectSet = _objectContext.CreateObjectSet <TEntity>(); }
public BlobLeaseHelper(ILog log, IRepositoryConfig repositoryConfig, ValidateStorage validateStorage, CloudBlockBlobMd5Helper cloudBlockBlobMd5Helper, BlobRequestOptionsHelper blobRequestOptionsHelper) : base(log, validateStorage, cloudBlockBlobMd5Helper, blobRequestOptionsHelper) { _log = log; _log.Debug(); _acquiredLeases = new Dictionary <string, Lease>(); ConnectionString = repositoryConfig.StorageAccountConnectionString; }
public SqlServerRepository(IEntitySerialiser serialiser, IRepositoryConfig config, IDatabase database, ISqlBuilder <T> sqlBuilder) { InitColumnMapping(); this.database = database; Serialiser = serialiser; Config = config; this.sqlBuilder = sqlBuilder; sqlBuilder.Init(Config, IdentityFieldName, IndexedColumnMetadata); InitSerialiser(); }
public void Init(IRepositoryConfig config, string identityFieldName, Dictionary <string, Type> columnMetadata = null) { if (config == null) { throw new ArgumentNullException(nameof(config)); } if (identityFieldName == null) { throw new ArgumentNullException(nameof(identityFieldName)); } this.config = config; IdentityFieldName = identityFieldName; ColumnMetadata = columnMetadata ?? new Dictionary <string, Type>(); }
public RepositoryBase(ILog log, ValidateStorage validateStorage, TableRequestOptionsHelper tableRequestOptionsHelper, IRepositoryConfig repositoryConfig) { // inspired by: // https://docs.particular.net/nservicebus/azure-storage-persistence/performance-tuning // http://blogs.msmvps.com/nunogodinho/2013/11/20/windows-azure-storage-performance-best-practices/ // https://blogs.msdn.microsoft.com/windowsazurestorage/2010/06/25/nagles-algorithm-is-not-friendly-towards-small-requests/ // https://alexandrebrisebois.wordpress.com/2013/03/24/why-are-webrequests-throttled-i-want-more-throughput/ log.Debug(); ServicePointManager.UseNagleAlgorithm = false; ServicePointManager.Expect100Continue = false; ServicePointManager.DefaultConnectionLimit = 1000; _validateStorage = validateStorage; _tableRequestOptionsHelper = tableRequestOptionsHelper; Config = repositoryConfig; }
public RepositoryData(IRepositoryConfig repositoryConfig) { if (repositoryConfig == null) throw new ArgumentNullException("repositoryConfig"); this.repositoryConfig = repositoryConfig; if (!string.IsNullOrWhiteSpace(repositoryConfig.PersistedDataPath)) { this.IndexesCached = new Lazy<Cache<Type, IIndex>>(() => { var path = Path.Combine(this.repositoryConfig.PersistedDataPath, "Indexes"); if (!Directory.Exists(path)) return new Cache<Type, IIndex>(this.repositoryConfig.Indexes.ToDictionary(index => index.GetType(), index => index)); var cache = new Cache<Type, IIndex>(); Directory.EnumerateFiles(path) .Each(fileName => { using (var entityFileStream = File.OpenRead(fileName)) { var indexContainer = JsonSerializer.DeserializeFromStream<IndexContainer>(entityFileStream); cache.Fill(indexContainer.Type, indexContainer.Index); } }); return cache; }); this.EntitiesCached = new Lazy<Cache<Type, List<dynamic>>>(() => { var path = Path.Combine(this.repositoryConfig.PersistedDataPath, "Entities"); if (!Directory.Exists(path)) return new Cache<Type, List<dynamic>>(); var cache = new Cache<Type, List<dynamic>>(); Directory.EnumerateFiles(path) .Each(fileName => { using (var entityFileStream = File.OpenRead(fileName)) { var entityContainer = JsonSerializer.DeserializeFromStream<EntityContainer>(entityFileStream); cache.Fill(entityContainer.Type, entityContainer.Entities); } }); return cache; }); } else { this.IndexesCached = new Lazy<Cache<Type, IIndex>>(() => new Cache<Type, IIndex>(repositoryConfig.Indexes.ToDictionary(index => index.GetType(), index => index))); this.EntitiesCached = new Lazy<Cache<Type, List<dynamic>>>(() => new Cache<Type, List<dynamic>>()); } }
public AppConfig() { _configuration = new ConfigurationBuilder() .AddJsonFile("appsettings.json", optional: true) .Build(); _repositoryConfig = new RepositoryConfig { LocalRepositoryPath = _configuration["RepositoryConfig:LocalRepositoryPath"], RepositoryAddress = _configuration["RepositoryConfig:RepositoryAddress"] }; _databaseConfig = new DatabaseConfig { DefaultConnectionString = _configuration["DatabaseConfig:ConnectionString"], ConnectionString = Environment.CurrentDirectory + $"\\LocalDatabase.db" }; }
public AccountManagement() { accountRepository = new RepositoryAccount(); configSystenm = new RepositoryConfig(); }
public AuthenticationService(IFactory factory, IRepositoryConfig config) { _factory = factory; _config = config; }
public FlightRepository(IRepositoryConfig config) { _config = config; }
public UserRepository(IRepositoryConfig config) { _config = config; }
public UserRepository(IRepositoryConfig config) { this.config = config; }
public MemberConfigForRep(IRepositoryConfig repConfig) { this.repConfig = repConfig; }
public InMemoryRepository(IEntitySerialiser serialiser, IRepositoryConfig config) { Serialiser = serialiser; Config = config; Store = new Dictionary <object, object>(); }
public FileRepository(IEntitySerialiser serialiser, IRepositoryConfig config) { Serialiser = serialiser; Config = config; }
public void ConfigRepository(IRepositoryConfig repConfig) { config(new MemberConfigForRep(repConfig)); }
public LessonRepository(IRepositoryConfig config) { _config = config; }