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

Populate Children Command Builder #396

Open
Grauenwolf opened this issue Dec 6, 2020 · 0 comments
Open

Populate Children Command Builder #396

Grauenwolf opened this issue Dec 6, 2020 · 0 comments

Comments

@Grauenwolf
Copy link
Collaborator

Here is how we currently populate child records:

var children = m_DataSource.GetByKeyList(ProductTable, "ProductLineKey",
                results.Select(pl => pl.ProductLineKey)).ToCollection<Product>().Execute();

It would be nice if we could write this:

m_DataSource.LoadChildern(productLines, p => p.Products).Execute();
  • productLines is the parent collection
  • p => p.Products is the pointer to the child collection
  • This would use GetByKeyList to find the records.
  • The primary key on parent table will determine the mappings
  • Optionally, a primary/foreign key pair may be specified.
  • It will have to dynamically determine the TKey type parameter. This means some fancy reflection work.
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

1 participant