Exemple #1
0
 public void CreateDB2()
 {
     _connection.InsertAll(new[] {
         new imsi02 {
             Name = "탐",
         },
         new imsi02 {
             Name = "あいうぇえおか",
         }
     });
 }
Exemple #2
0
    public void CreateChapterTables()
    {
        _connection.DropTable <PChapter> ();
        _connection.CreateTable <PChapter> ();

        _connection.InsertAll(new[] {
            new PChapter {
                Id     = GetRandomString(),
                Name   = "Sunrise",
                Locked = false
            },
            new PChapter {
                Id     = GetRandomString(),
                Name   = "Dawn",
                Locked = true
            },
            new PChapter {
                Id     = GetRandomString(),
                Name   = "Dusk",
                Locked = true
            },
        });

        CreateLevelDB();
    }
Exemple #3
0
        private void InitializeSettingTable()
        {
            string dbName = "receptionist.db3";

            ILocalStorageService storageService   = ServiceProvider.GetService <ILocalStorageService>();
            IActivatorService    activatorService = ServiceProvider.GetService <IActivatorService>();
            var factory = activatorService.CreateInstance <Func <string, ISQLiteConnection> >();

            ISQLiteConnection db = factory(storageService.GetFilePath(dbName, LocalFolderKind.Data));

            if (!db.TableExists <GeneralSetting>())
            {
                db.CreateTable <GeneralSetting>();
            }
            //else
            //    db.MigrateTable<Setting>();

            if (db.Table <GeneralSetting>().ToList().Count == 0)
            {
                List <GeneralSetting> generalsetting = new List <GeneralSetting>();
                generalsetting.Add(new GeneralSetting()
                {
                    SettingId = Guid.NewGuid(), GeneralName = "barcode"
                });
                db.InsertAll(generalsetting);
            }
        }
 public virtual async Task AddRange(IEnumerable <T> entities)
 {
     _sqliteConnection.InsertAll(entities);
 }