示例#1
0
        public ItemsLinkContainer <LanguageViewModel> Get()
        {
            var languages = _languageAppService.GetAll().ToList();

            languages.ForEach(x => x.AddRangeLink(_languageEnricher.CreateLinks(Method.Get, x)));
            var result = new ItemsLinkContainer <LanguageViewModel>()
            {
                Items = languages
            };

            result.AddRangeLink(_languageEnricher.CreateLinks(Method.GetAll));
            return(result);
        }
示例#2
0
        public IActionResult GetLanguage(string language)
        {
            var lang = _languageAppService.GetByLang(language);

            lang?.AddRangeLink(_languageEnricher.CreateLinks(Method.Get, lang));
            return(OkOrNotFound(lang));
        }