Пример #1
0
        public async Task <ActionResult <LstDogToReturnDto> > GetLstDog(Guid id)
        {
            var spec   = new LstDogWithChildrenSpecification(id);
            var lstDog = await _lstDogRepo.GetEntityWithSpec(spec);

            var lstDogToReturnDto = _mapper.Map <LstDog, LstDogToReturnDto>(lstDog);

            return(Ok(lstDogToReturnDto));
        }
Пример #2
0
 public async Task <ActionResult <BaseList> > GetLst(LstTypeClass lstTypeClass, Guid id)
 {
     // var bs = await _lstDefaultRepo.GetEntityAsync(id);
     if (lstTypeClass == LstTypeClass.LstDefault)
     {
         return(Ok(await _lstDefaultRepo.GetEntityAsync(id)));
     }
     else if (lstTypeClass == LstTypeClass.LstDog)
     {
         var spec = new LstDogWithChildrenSpecification(id);
         return(Ok(await _lstDogRepo.GetEntityWithSpec(spec)));
     }
     else if (lstTypeClass == LstTypeClass.LstOrder)
     {
         return(Ok(await _lstOrderRepo.GetEntityAsync(id)));
     }
     else
     {
         return(Ok());
     }
 }