public async Task <IActionResult> Update([FromBody] PharmacySystem pharmacySystem)
 {
     if (pharmacySystem.isValid())
     {
         var pharmacyOld = _pharmacySystemService.GetPharmacyByIdNoTracking(pharmacySystem.Id);
         if (pharmacyOld == null)
         {
             throw new ArgumentNullException("There is no pharmacy with id=" + pharmacySystem.Id);
         }
         if (pharmacySystem.ActionsBenefitsExchangeName == null)
         {
             pharmacySystem.ActionsBenefitsSubscribed = false;
         }
         if (await _actionBenefitService.SubscriptionEdit(pharmacyOld.ActionsBenefitsExchangeName,
                                                          pharmacyOld.ActionsBenefitsSubscribed,
                                                          pharmacySystem.ActionsBenefitsExchangeName,
                                                          pharmacySystem.ActionsBenefitsSubscribed))
         {
             _pharmacySystemService.UpdatePharmacy(pharmacySystem);
             return(Ok());
         }
         return(BadRequest());
     }
     else
     {
         return(BadRequest());
     }
 }