Skip to content
This repository was archived by the owner on Aug 29, 2021. It is now read-only.
This repository was archived by the owner on Aug 29, 2021. It is now read-only.

DataInfos.GetOrdinal(string) ignores field name mapping #3

@VadymMelnychuk

Description

@VadymMelnychuk

This method should checks fieldNames also. It could be something like this:

    public int GetOrdinal(string name)
        {
            if (_fieldNames != null)
            {
                for (int i = 0; i < _fieldNames.Length; ++i)
                {
                    if (_fieldNames[i] == name)
                        return i;
                }
            }
            else
            {
                for (int i = 0; i < _properties.Length; ++i)
                {
                    if (_properties[i].Name == name)
                        return i;
                }
            }

            throw new IndexOutOfRangeException();
        } 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions