Exemple #1
0
 public async Task <ActionResult <CarWashShortModel> > AddCarWash([FromBody] CarWashFullModel model) => await Exec(async operation =>
 {
     var(_, id) = VerifyUser(UserRole.Company);
     if (!ModelState.IsValid)
     {
         throw new Exception(ExceptionMessage.ModelIsInvalid);
     }
     var carWash = await companyProfileService.AddCarWash(operation, id, model.ToEntity());
     return(new CarWashShortModel().ToModel(carWash));
 });