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

Replace IList<> with IEnumerable<> #147

Closed
acordmike opened this issue Feb 13, 2019 · 7 comments
Closed

Replace IList<> with IEnumerable<> #147

acordmike opened this issue Feb 13, 2019 · 7 comments

Comments

@acordmike
Copy link

I did not see any specific IList<> functionality (at least for the bulk insert). It would be helpful to change this the bulk input parameters to IEnumerable<> to prevent having to wrap collections into List objects to use the methods.

@borisdj
Copy link
Owner

borisdj commented Mar 3, 2019

Implemented with 2.4.2

@borisdj borisdj closed this as completed Mar 3, 2019
@borisdj
Copy link
Owner

borisdj commented Mar 5, 2019

Reverted to IList with 2.4.3 because of UpdateEntitiesIdentity(SetOutputIdentity).
Related to #76
Reference of List is required:

else // Clears entityList and then refills it with loaded entites from Db
{
entities.Clear();
((List<T>)entities).AddRange(entitiesWithOutputIdentity);
}

@Mithras
Copy link

Mithras commented May 21, 2019

Having IList for bulk operations doesn't make much sense to me. If I need to insert millions of rows, am I supposed to load them all in memory? I guess I can still split rows in reasonable chunks and call bulkInserts multiple times but it's kinda weird that I have to do that.

@cda963
Copy link

cda963 commented Apr 3, 2020

Reverted to IList with 2.4.3 because of UpdateEntitiesIdentity(SetOutputIdentity).
Related to #76
Reference of List is required:

else // Clears entityList and then refills it with loaded entites from Db
{
entities.Clear();
((List<T>)entities).AddRange(entitiesWithOutputIdentity);
}

Can't you just assign

entities = entitiesWithOutputIdentity

and keep using IEnumerable instead of IList?

In my scenario I'm reading sequentially from a .csv file and I really want to avoid using up too much memory by loading up all the rows into memory...

@Numpsy
Copy link
Contributor

Numpsy commented Jun 3, 2020

entities = entitiesWithOutputIdentity

It needs to update the callers view of the elements rather than just the local reference?

@cda963
Copy link

cda963 commented Jun 3, 2020

entities = entitiesWithOutputIdentity

It needs to update the callers view of the elements rather than just the local reference?

Closing this issue still doesn't solve the problem when the data is read sequentially from a file for example. IList loads everything into memory... so for bulk operations, as others have mentioned it's not very helpful.

@borisdj
Copy link
Owner

borisdj commented May 16, 2023

Bulk methods are now receiving IEnumerable.

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

5 participants