/// <summary> /// Parses the json message sent and converts it into a search criterion object using a json serializer. /// </summary> /// <param name="json"> the json message to be parsed.</param> /// <exception cref="ArgumentException"> thrown if the json message is null or empty.</exception> private void ProcessNewCriterionUpdate(string json) { if (String.IsNullOrEmpty(json)) { throw new ArgumentException("json"); } try { ISearchCriterion newCriterion = JsonConvert.DeserializeObject <SearchCriterionImpl>(json); searchManager.AddSearch(newCriterion.Owner, newCriterion.DescriptionKey, newCriterion.IsPrivate, newCriterion.IsFilter, newCriterion.ControlName, newCriterion.ControlValue); } catch (Exception exc) { log.Error(String.Format("Failed to deserialize json [{0}] into new search criterion update. Exception raised [{1}]", json, exc.Message)); } }