public static IDataRepository Instance() { if (_instance == null) { var schemaVersion = ConfigurationManager.AppSettings["sql.schema.version"]; var sqlSchemaVerifier = new SqlSchemaVerifier(schemaVersion); var databaseLocation = Environment.ExpandEnvironmentVariables(ConfigurationManager.AppSettings["sql.database.location"]); var databaseSchema = new ResourceManagerDatabaseSchema(databaseLocation, sqlSchemaVerifier); _instance = new SqliteDataRepository(databaseSchema); } return(_instance); }
public ResourceManagerDatabaseSchema(string databaseLocation, SqlSchemaVerifier schemaVerifier) : base(databaseLocation, schemaVerifier) { ProjectTable = new ProjectTable(this); PersonTable = new PersonTable(this); WeeklyScheduleTable = new WeeklyScheduleTable(this); ResourceBlockTable = new ResourceBlockTable(this); SqlTables.Add(ProjectTable); SqlTables.Add(PersonTable); SqlTables.Add(WeeklyScheduleTable); SqlTables.Add(ResourceBlockTable); }