[ 
https://issues.apache.org/jira/browse/AVRO-3459?focusedWorklogId=745217&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-745217
 ]

ASF GitHub Bot logged work on AVRO-3459:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 21/Mar/22 16:27
            Start Date: 21/Mar/22 16:27
    Worklog Time Spent: 10m 
      Work Description: KyleSchoonover commented on pull request #1607:
URL: https://github.com/apache/avro/pull/1607#issuecomment-1074123931


   It will generate the following:
   ```
   // 
------------------------------------------------------------------------------
   // <auto-generated>
   //    Generated by avrogen, version 1.12.0.0
   //    Changes to this file may cause incorrect behavior and will be lost if 
code
   //    is regenerated
   // </auto-generated>
   // 
------------------------------------------------------------------------------
   namespace org.apache.avro.codegentest.other
   {
        using System;
        using System.Collections.Generic;
        using System.Text;
        using global::Avro;
        using global::Avro.Specific;
        
        public partial class NestedOtherNamespaceRecord : 
global::Avro.Specific.ISpecificRecord
        {
                public static global::Avro.Schema _SCHEMA = 
global::Avro.Schema.Parse("{\"type\":\"record\",\"name\":\"NestedOtherNamespaceRecord\",\"namespace\":\"org.apache.avro"
 +
                                
".codegentest.other\",\"fields\":[{\"name\":\"someField\",\"type\":\"int\"}]}");
                private @int _someField;
                public virtual global::Avro.Schema Schema
                {
                        get
                        {
                                return NestedOtherNamespaceRecord._SCHEMA;
                        }
                }
                public @int someField
                {
                        get
                        {
                                return this._someField;
                        }
                        set
                        {
                                this._someField = value;
                        }
                }
                public virtual object Get(int fieldPos)
                {
                        switch (fieldPos)
                        {
                        case 0: return this.someField;
                        default: throw new 
global::Avro.AvroRuntimeException("Bad index " + fieldPos + " in Get()");
                        };
                }
                public virtual void Put(int fieldPos, object fieldValue)
                {
                        switch (fieldPos)
                        {
                        case 0: this.someField = (int)fieldValue; break;
                        default: throw new 
global::Avro.AvroRuntimeException("Bad index " + fieldPos + " in Put()");
                        };
                }
        }
   }
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 745217)
    Time Spent: 1h 10m  (was: 1h)

> Use simple types and nullable modifier
> --------------------------------------
>
>                 Key: AVRO-3459
>                 URL: https://issues.apache.org/jira/browse/AVRO-3459
>             Project: Apache Avro
>          Issue Type: Improvement
>          Components: csharp
>            Reporter: Kyle Schoonover
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> First, it is more common to use the simple types keyword instead of the 
> struct type.  ie: int instead of System.Int32
> Second, instead of using the struct Nullable<int> you can use int?



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to