public void InsertManagerLangBook(Areas.Admin.Models.LangBooksEditViewModel model) { var item = Mapper.Map <Lang_Books>(model); m_contentContext.Lang_Books.Add(item); m_contentContext.SaveChanges(); }
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(); }