public T ProcessActionResult(string responseJson, Enum theAction) { JsonData geoJson = JsonMapper.ToObject(responseJson); switch ((GeoAction)theAction) { case GeoAction.CreatePlace: var place = new Place(geoJson); return(place.ItemCast(default(T))); default: throw new InvalidOperationException("Unknown Action."); } }
public T?ProcessActionResult(string responseJson, Enum theAction) { JsonElement geoJson = JsonDocument.Parse(responseJson).RootElement; switch ((GeoAction)theAction) { case GeoAction.CreatePlace: var place = new Place(geoJson); return(place.ItemCast(default(T))); default: throw new InvalidOperationException("Unknown Action."); } }