using System.Collections.Generic; using System.Linq; using bahnplan.web.database.Tables; using LinqToDB; using LinqToDB.Configuration; namespace bahnplan.web.database { public class Database { public class ConnectionStringSettings : IConnectionStringSettings { public string ConnectionString { get; set; } public string Name { get; set; } public string ProviderName { get; set; } public bool IsGlobal => false; } public class Settings : ILinqToDBSettings { public IEnumerable DataProviders => Enumerable.Empty(); public string DefaultConfiguration => "SQLite"; public string DefaultDataProvider => "SQLite"; public IEnumerable ConnectionStrings { get { yield return new ConnectionStringSettings {Name = "db", ProviderName = "SQLite", ConnectionString = @"Data Source=database.db;"}; } } } public class DbConn : LinqToDB.Data.DataConnection { public DbConn() : base("db") { } public ITable Users => GetTable(); public ITable Legs => GetTable(); public ITable Tickets => GetTable(); public ITable TicketLegs => GetTable(); public ITable Trips => GetTable(); public ITable Cards => GetTable(); } } }