Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class App : Application
- {
- public override void OnCreate()
- {
- base.OnCreate();
- string libraryPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
- string sqliteFilename = "db.db3";
- string path = Path.Combine(libraryPath, sqliteFilename);
- conn = new SQLiteConnection(path);
- }
- }
- public class Database
- {
- readonly object locker = new object();
- SQLiteConnection database;
- public Database(SQLiteConnection conn)
- {
- database = conn;
- database.CreateTable<Tabla1>();
- database.CreateTable<Tabla2>();
- }
- public IEnumerable<Tabla1> GetDatos()
- {
- lock (locker)
- {
- return (from i in database.Table<Tabla1>()
- orderby i.Titulo ascending
- select i).ToList();
- }
- }
- //Etcétera.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement