/// <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(); }
/// <summary> /// Deletes the given block type. /// </summary> /// <param name="blockType">The block type</param> public void Delete(Extend.BlockType blockType) { Delete(blockType.Id); }