コード例 #1
0
        /// <inheritdoc />
        public async Task <IEnumerable <TextResource> > GetTextResourceSectionAsync(string lang, string name)
        {
            var response = await _service.GetTextResourceSectionAsync(lang, name);

            switch (response)
            {
            case List <TextResource> result:
                return(result);

            case ErrorResponse error:
                throw new Exception(error.ErrorMessage);
            }

            return(Array.Empty <TextResource>());
        }