Exemplo n.º 1
0
        /// <summary>
        /// Update the content of the language
        /// </summary>
        /// <param name="languageViewModel"></param>
        /// <returns></returns>
        public void UpdateLanguage(LanguageViewModel languageViewModel)
        {
            var language = languageViewModel.ConvertToLanguageModel();

            _languageRepository.Update(language);
            _languageRepository.SaveChanges();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Remove the language from the system
        /// </summary>
        /// <param name="languageId"></param>
        public void RemoveLanguage(int languageId)
        {
            var languageViewModel = new LanguageViewModel {
                LanguageId = languageId
            };
            var language = languageViewModel.ConvertToLanguageModel();

            _languageRepository.Delete(language);
            _languageRepository.SaveChanges();
        }
Exemplo n.º 3
0
 /// <summary>
 /// Convert to language model
 /// </summary>
 /// <param name="languageViewModel"></param>
 /// <returns></returns>
 public static Language ConvertToLanguageModel(this LanguageViewModel languageViewModel)
 {
     return(Mapper.Map <LanguageViewModel, Language>(languageViewModel));
 }