コード例 #1
0
ファイル: ODataAvroWriter.cs プロジェクト: zhonli/odata.net
        private void WriteEntryImplementation(ODataResource entry)
        {
            if (this.schema == null)
            {
                this.schema = this.outputContext.AvroWriter.UpdateSchema(entry, null, this.writingFeed);
            }

            if (this.scopes.Count > 0)
            {
                var parent = this.scopes.Pop() as ODataNestedResourceInfo;
                var obj    = this.currentEntityObject;
                ODataAvroConvert.UpdateNestedInfoFromODataObject(obj, entry, parent, schema);
            }
            else
            {
                var obj = (AvroRecord)ODataAvroConvert.FromODataObject(entry, this.schema);

                if (this.writingFeed)
                {
                    this.entityObjectList.Add(obj);
                    this.currentEntityObject = obj;
                }
                else
                {
                    this.currentEntityObject = obj;
                }
            }
        }
コード例 #2
0
        public override void WriteError(ODataError error, bool includeDebugInformation)
        {
            var schema = this.AvroWriter.UpdateSchema(error, null);
            var obj    = ODataAvroConvert.FromODataObject(error, schema);

            this.AvroWriter.Write(obj);
            this.Flush();
        }
コード例 #3
0
        public override void WriteProperty(ODataProperty property)
        {
            var schema = this.AvroWriter.UpdateSchema(property.Value, null);
            var obj    = ODataAvroConvert.FromODataObject(property.Value, schema);

            this.AvroWriter.Write(obj);
            this.Flush();
        }
コード例 #4
0
ファイル: ODataAvroWriter.cs プロジェクト: zdzislaw/odata.net
        private void WriteEntryImplementation(ODataEntry entry)
        {
            if (this.schema == null)
            {
                this.schema = this.outputContext.AvroWriter.UpdateSchema(entry, null, this.writingFeed);
            }

            var obj = (AvroRecord)ODataAvroConvert.FromODataObject(entry, this.schema);

            if (this.writingFeed)
            {
                this.entityObjectList.Add(obj);
            }
            else
            {
                this.currentEntityObject = obj;
            }
        }
コード例 #5
0
 public override void WriteValue(string parameterName, object parameterValue)
 {
     this.record[parameterName] = ODataAvroConvert.FromODataObject(parameterValue, this.GetSubSchema(parameterName));
 }