Beispiel #1
0
        public static AppLanguagesDto FromApp(IAppEntity app, ApiController controller)
        {
            var result = new AppLanguagesDto
            {
                Items = app.LanguagesConfig.OfType <LanguageConfig>()
                        .Select(x => AppLanguageDto.FromLanguage(x, app, controller))
                        .OrderByDescending(x => x.IsMaster)
                        .ThenBy(x => x.Iso2Code)
                        .ToArray()
            };

            return(result.CreateLinks(controller, app.Name));
        }
        public static AppLanguagesDto FromApp(IAppEntity app, Resources resources)
        {
            var config = app.LanguagesConfig;

            var result = new AppLanguagesDto
            {
                Items = config.Languages
                        .Select(x => AppLanguageDto.FromLanguage(x.Key, x.Value, config))
                        .Select(x => x.WithLinks(resources, app))
                        .OrderByDescending(x => x.IsMaster).ThenBy(x => x.Iso2Code)
                        .ToArray()
            };

            return(result.CreateLinks(resources));
        }