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)); }
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))); }