Esempio n. 1
0
        /// <summary>
        /// Saves the given block type.
        /// </summary>
        /// <param name="blockType">The block type</param>
        public void Save(Extend.BlockType blockType)
        {
            var type = db.BlockTypes
                       .FirstOrDefault(t => t.Id == blockType.Id);

            if (type == null)
            {
                type = new Data.BlockType()
                {
                    Id = blockType.Id
                };
                db.BlockTypes.Add(type);
            }
            type.Body = JsonConvert.SerializeObject(blockType);

            db.SaveChanges();
        }
Esempio n. 2
0
 /// <summary>
 /// Deletes the given block type.
 /// </summary>
 /// <param name="blockType">The block type</param>
 public void Delete(Extend.BlockType blockType)
 {
     Delete(blockType.Id);
 }