public void Write(Serializer oprot) { Struct struc = new Struct("TApplicationException"); Field field = new Field(); oprot.WriteStructBegin(struc); if (!String.IsNullOrEmpty(Message)) { field.Name = "message"; field.Type = TType.String; field.ID = 1; oprot.WriteFieldBegin(field); oprot.WriteString(Message); oprot.WriteFieldEnd(); } field.Name = "type"; field.Type = TType.I32; field.ID = 2; oprot.WriteFieldBegin(field); oprot.WriteI32((int)type); oprot.WriteFieldEnd(); oprot.WriteFieldStop(); oprot.WriteStructEnd(); }