public NapDbConfiguration(TDb db) { Db = db; RootPath = Path.Combine(Environment.CurrentDirectory, "Data", typeof(TDb).Name); Locker = GlobalDefaults.CreateDefaultLocker(db.GetType().FullName); DataSetConfigs = db .AllDataSets() .ToDictionary( ds => ds.Name, ds => new DataSetConfiguration <TDb, TKey>(this, ds)); }
public DataSetConfiguration(NapDbConfiguration <TDb, TKey> dbConfig, IDataSet <TKey> dataSet) { DbConfig = dbConfig; DataSet = dataSet; FolderName = dataSet.Name; EnableCaching = false; Serializer = GlobalDefaults.CreateDefaultSerializer <TKey>(); Reader = GlobalDefaults.CreateDefaultReader(); NameResolver = GlobalDefaults.CreateDefaultNameResolver <TKey>(); PropertyConfigs = dataSet .GetEntityType() .GetProperties() .Where(ReflectionHelper.IsPropertyConfigurable) .ToDictionary( p => p.Name, p => new EntityPropertyConfiguration <TDb, TKey>(this, p)); }