public async Task <ActionResult <bool> > DeletePlaceProduct( [FromForm] string placeProductid ) { try { if (!await User.IsPlaceProviderAdmin(userRepository, placeProviderRepository)) { throw new Exception(localizer[Controllers_PlaceController.Only_admin_is_allowed_to_manage_testing_places].Value); } var productPlace = await placeRepository.GetPlaceProduct(placeProductid); if (productPlace == null) { throw new Exception("Place not found"); } if (productPlace.PlaceProviderId != User.GetPlaceProvider()) { throw new Exception("You can define product only for your places"); } return(Ok(await placeRepository.DeletePlaceProduct(productPlace))); } catch (Exception exc) { logger.LogError(exc, exc.Message); return(BadRequest(new ProblemDetails() { Detail = exc.Message })); } }