Esempio n. 1
0
        public void EditEnvironment(DTO.Environment env)
        {
            using (var db = new LiteDatabase(DbLocation))
            {
                // Get environments collection
                var envs = db.GetCollection <DTO.Environment>("environments");

                envs.Update(env);
            }
        }
Esempio n. 2
0
        public void AddEnvironment(DTO.Environment env)
        {
            using (var db = new LiteDatabase(DbLocation))
            {
                // Get environments collection
                var envs = db.GetCollection <DTO.Environment>("environments");

                // Insert new environment document (Id will be auto-incremented)
                envs.Insert(env);

                // Index document using a document property
                envs.EnsureIndex(x => x.Name);
            }
        }