/// <summary>
        /// Prepare paged language list model
        /// </summary>
        /// <param name="searchModel">Language search model</param>
        /// <returns>Language list model</returns>
        public virtual LanguageListModel PrepareLanguageListModel(LanguageSearchModel searchModel)
        {
            if (searchModel == null)
            {
                throw new ArgumentNullException(nameof(searchModel));
            }

            //get languages
            var languages = _languageService.GetAllLanguages(showHidden: true).ToPagedList(searchModel);

            //prepare list model
            var model = new LanguageListModel().PrepareToGrid(searchModel, languages, () =>
            {
                return(languages.Select(language =>
                {
                    return language.ToModel <LanguageModel>();
                }));
            });

            return(model);
        }
Esempio n. 2
0
 public async Task <LanguageSearchModel> GetLanguages(LanguageSearchModel model)
 {
     return(await _languageApiClient.GetLanguages(model));
 }
Esempio n. 3
0
 private LanguageSearchModel InitializeModel(LanguageSearchModel model)
 {
     model = InitializeSearchModel(model, "LanguageGrid", "Name", "Desc");
     return(model);
 }