Exemplo n.º 1
0
        public void InsertManagerLangBook(Areas.Admin.Models.LangBooksEditViewModel model)
        {
            var item = Mapper.Map <Lang_Books>(model);

            m_contentContext.Lang_Books.Add(item);
            m_contentContext.SaveChanges();
        }
Exemplo n.º 2
0
        public void UpdateManagerLangBook(Areas.Admin.Models.LangBooksEditViewModel model)
        {
            var query = from b in m_contentContext.Lang_Books
                        where b.Id == model.Id
                        select b;
            var item = query.FirstOrDefault();

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