예제 #1
0
        /// <summary>
        ///
        /// </summary>
        public async Task <TaxonomyOutput> GetAsync(string id)
        {
            var taxonomy = await _taxonomyRepository.GetByIdAsync(id);

            if (taxonomy == null)
            {
                throw new Exception("Taxonomy not found");
            }


            return(_mapperService.BindToOutputModel(taxonomy));
        }
예제 #2
0
        /// <summary>
        ///
        /// </summary>
        public async Task <TaxonomyInput> GetAsync(string id)
        {
            var tax = await _taxonomyRepository.GetByIdAsync(id);

            if (tax == null)
            {
                throw new Exception("Taxonomy not found");
            }


            return(new TaxonomyInput
            {
                Id = tax.Id,
                Name = tax.Name,
                Description = tax.Description,
                PostCount = tax.PostCount,
                Type = tax.Type,
                UrlTitle = tax.UrlTitle,
            });
        }