Skip to content

CsvTable.AsObjects requires unused int parameter #2

@Jarno458

Description

@Jarno458
    /// <summary>Get rows as object</summary>
    /// <typeparam name="T">Object type</typeparam>
    /// <param name="index">Index</param>
    /// <param name="mapping">Override mapping</param>
    /// <returns>Object</returns>
    public IEnumerable<T> AsObjects<T>(int index, Dictionary<int, CsvMapping> mapping = null) where T : new()
    {
      if (index < 0 || index > this.CountRows)
        throw new ArgumentException("Invalid index", nameof (index));
      foreach (string[] row in this.Rows)
        yield return CsvParser.Map<T>(row, mapping ?? this.Mapping);
    }

the index is only used to throw an error if its out of range but otherwise its not used

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions