Пример #1
0
 public async Task <ActionResult <CarWashFullModel> > GetCarWash(int carWashId, [FromQuery(Name = "s")] bool isServicesNeeded) => await Exec(async operation =>
 {
     VerifyUser(UserRole.Company);
     var entity = await companyProfileService.GetCarWashById(operation, carWashId);
     var model  = new CarWashFullModel().ToModel(entity);
     if (isServicesNeeded)
     {
         var services   = await companyProfileService.GetCarWashServiceListByCarWash(operation, carWashId);
         model.Services = services.Select(item => new CarWashServiceModel().ToModel(item)).ToList();
     }
     return(model);
 });