private EncounterDTO GetUpdatedEncounter(EncounterUpdateModelIn encounterModel)
        {
            EncounterDTO toUpdate = encounterSimpleServices.GetEncounter(encounterModel.Id.ToString());

            encounterModel.UpdateServicesDTO(toUpdate, teamServices);
            return(toUpdate);
        }
 private IActionResult TryToPut(string id, EncounterUpdateModelIn encounterModel)
 {
     try
     {
         EncounterDTO toUpdate = GetUpdatedEncounter(encounterModel);
         encounterSimpleServices.UpdateEncounter(toUpdate);
         return(Ok());
     }
     catch (ServicesException e)
     {
         return(BadRequest(e.Message));
     }
 }
 public IActionResult ModifyEncounter(string id, [FromBody] EncounterUpdateModelIn encounterModel)
 {
     try
     {
         CreateSession();
         encounterModel.Id = Guid.Parse(id);
         return(TryToPut(id, encounterModel));
     }
     catch (ServicesException ex)
     {
         return(BadRequest(ex.Message));
     }
     catch (InsufficientPermissionException)
     {
         return(Unauthorized());
     }
 }