private static GenericRecord Parse(Schema schema, string json) { var jsonEntity = (JToken)JsonConvert.DeserializeObject(json); var avroEntity = JsonDecoder.DecodeAny(schema, jsonEntity); if (avroEntity is GenericRecord) { return((GenericRecord)avroEntity); } throw new ArgumentException("schema was not a record"); }