Beispiel #1
0
        public void InsertManagerHtmlBlocks(Areas.Admin.Models.HtmlBlocksEditViewModel model)
        {
            var item = Mapper.Map <HtmlBlocks>(model);

            m_contentContext.HtmlBlocks.Add(item);
            m_contentContext.SaveChanges();
        }
Beispiel #2
0
        public void UpdateMangerHtmlBlocks(Areas.Admin.Models.HtmlBlocksEditViewModel model)
        {
            var query = from b in m_contentContext.HtmlBlocks
                        where b.Id == model.Id
                        select b;
            var item = query.FirstOrDefault();

            Mapper.Map(model, item);
            m_contentContext.SaveChanges();
        }