Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing columns issue #35

Open
cbusuttil opened this issue Nov 17, 2014 · 0 comments
Open

Missing columns issue #35

cbusuttil opened this issue Nov 17, 2014 · 0 comments

Comments

@cbusuttil
Copy link

First of all I would like to thank you for this library, I have used it in multiple projects.

I don't know if there is a workaround for this issue, but I haven't figured anything out so far. Let's assume we have a csv file with 2 columns, ID and Name. The model will be something like this:-

    [CsvColumn(Name = "ID", FieldIndex = 1, CanBeNull = false)]
    public int UserID { get; set; }

    [CsvColumn(Name = "Name", FieldIndex = 2, CanBeNull = false)]
    public string UserName { get; set; }

If one of those values is left empty, the MissingRequiredFieldException is raised, and the fieldName property is being correct. However if i completely remove a column the fieldName is not being reported correctly. So if i remove the column ID, it will raise the MissingRequiredFieldException but the fieldName missing will be reported as 'Name'. Any idea please? I'm currently checking out the code to see if i can figure this out myself, but in case someone has already found a workaround I would appreciate if he/she can share it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant