Example #1
0
        public async Task <ActionResult <FeatureToReturnDto> > GetFeature(int id)
        {
            var spec    = new FeaturesWithResourceTypeAndProjecSpecification(id);
            var feature = await _featuresRepo.GetEntityWithSpec(spec);

            return(_mapper.Map <Feature, FeatureToReturnDto>(feature));
        }
Example #2
0
        public async Task <ActionResult <IReadOnlyList <FeatureToReturnDto> > > GetFeatures(string sort, int?projectId, string?search)
        {
            var spec = new FeaturesWithResourceTypeAndProjecSpecification(sort, projectId, search);

            var features = await _featuresRepo.ListAsync(spec);

            return(Ok(_mapper.Map <IReadOnlyList <Feature>, IReadOnlyList <FeatureToReturnDto> >(features)));
        }