Strange issue using PropertyInfo in C#
<p>I have a class like so:</p>

<pre><code>public class CompanyData
    {
        # region Properties
        /// &lt;summary&gt;
        /// string CompanyNumber
        /// &lt;/summary&gt;
        private string strCompanyNumber;    

        /// &lt;summary&gt;
        /// string CompanyName
        /// &lt;/summary&gt;
        private string strCompanyName;

    [Info("companynumber")]
    public string CompanyNumber
    {
        get
        {
            return this.strCompanyNumber;
        }

        set
        {
            this.strCompanyNumber = value;
        }
    }

    /// &lt;summary&gt;
    /// Gets or sets CompanyName
    /// &lt;/summary&gt;
    [Info("companyName")]
    public string CompanyName
    {
        get
        {
            return this.strCompanyName;
        }

        set
        {
            this.strCompanyName = value;
        }
    }

    /// &lt;summary&gt;
    /// Initializes a new instance of the CompanyData class
    /// &lt;/summary&gt;
    public CompanyData()
    {
    }

    /// &lt;summary&gt;
    /// Initializes a new instance of the CompanyData class 
    /// &lt;/summary&gt;
    /// &lt;param name="other"&gt; object company data&lt;/param&gt;
    public CompanyData(CompanyData other)
    {
        this.Init(other);
    }

    /// &lt;summary&gt;
    /// sets the Company data attributes
    /// &lt;/summary&gt;
    /// &lt;param name="other"&gt;object company data&lt;/param&gt;
    protected void Init(CompanyData other)
    {
        this.CompanyNumber = other.CompanyNumber;
        this.CompanyName = other.CompanyName;
    }

    /// &lt;summary&gt;
    /// Getting array of entity properties
    /// &lt;/summary&gt;
    /// &lt;returns&gt;An array of PropertyInformation&lt;/returns&gt;
    public PropertyInfo[] GetEntityProperties()
    {
        PropertyInfo[] thisPropertyInfo;

        thisPropertyInfo = this.GetType().GetProperties();

        return thisPropertyInfo;
    }

    }
</code></pre>

<p>A csv file is read and a collection of CompanyData objects is created</p>

<p>In this method I am trying to get properties and values:</p>

<pre><code>private void GetPropertiesAndValues(List&lt;CompanyData&gt; resList)
{

        foreach (CompanyData resRow in resList)
        {

            this.getProperties = resRow.ExternalSyncEntity.GetEntityProperties();

            this.getValues = resRow.ExternalSyncEntity.GetEntityValue(resRow.ExternalSyncEntity);

         }
 }
</code></pre>

<p>Here's the problem, for the first object the <code>GetEntityProperties()</code> returns the <code>CompanyNumber</code> as the first element in the array. For the remaining objects it returns <code>CompanyName</code> as the first element.</p>

<p>Why is the sequence not consistent?</p>

<p>Regards.</p>
