コード例 #1
0
        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.");
            }
        }
コード例 #2
0
        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.");
            }
        }