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

How do you handle fetching and saving combination of static and dynamic object? #314

Open
3ggerhappy opened this issue Oct 31, 2024 · 1 comment

Comments

@3ggerhappy
Copy link

3ggerhappy commented Oct 31, 2024

Hi,

Finding it hard to wrap my head into this, and not sure if possible with ExcelMapper but here it goes:

Say I have an excel w/c the first 5 columns are fixed and succeeding columns are dynamic and i wont know before hand the header names or how may it would be.

Question is, is it possible to map this? what would my class looks like?, i assume it would be like this:

public class TestClass
{
public string FixedColumn1{ get; set; }
public string FixedColumn2{ get; set; }
......
public IEnumerable dynamicColumns { get; set; }
}

also i need to make edits on those dynamicColumns, is it possible to make edit then save it to new excel?

@mganss
Copy link
Owner

mganss commented Nov 6, 2024

Currently, there is no support for mixing static and dynamic types. The only way to map to unknown column names is to map to dynamic objects. The returned objects are ExpandoObjects.

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

No branches or pull requests

2 participants