Skip to content

Conversation

@falwickster
Copy link
Contributor

@falwickster falwickster commented Jun 13, 2018

Hello

This is my first pull request, this is a new extension method to replace an item in a collection when the item we want to change exists in a collection. Otherwise it won't make any changes.

EDIT: I have noticed that all ICollection methods are void or bool, so I rewrote the method to be void. I have it on my fork.

@JonathanMagnan JonathanMagnan self-assigned this Jun 13, 2018
@JonathanMagnan
Copy link
Member

Hello @falwickster ,

Thank you for your contribution.

This project is currently still on hold on our side for a few weeks (we have to many requests) but we will certainly look at it when we will be able.

Beside this, I'm this not sure if I like the second implementation or not.

We probably expect when swapping an item, the same position will remain as your first implementation.
Best Regards,

Jonathan


Performance Libraries
context.BulkInsert(list, options => options.BatchSize = 1000);
Entity Framework ExtensionsBulk OperationsDapper PlusLinqToSql Plus

Runtime Evaluation
Eval.Execute("x + y", new {x = 1, y = 2}); // return 3
C# Eval FunctionSQL Eval Function

@falwickster
Copy link
Contributor Author

falwickster commented Jun 13, 2018

Hello @JonathanMagnan,

Thanks for feedback. I replaced this ICollection method to IList method, because as far as I know ICollection doesn't store indexes, so swaping items with keeping its position is problematic.

Best Regards

@falwickster falwickster changed the title New ICollection<T> extension method - Swap New IList<T> extension method - Swap Jun 13, 2018
@JonathanMagnan
Copy link
Member

Thank a lot ;)

Best Regards,

Jonathan

@JonathanMagnan JonathanMagnan merged commit b98b17d into zzzprojects:master Jul 11, 2018
@JonathanMagnan
Copy link
Member

Hello @falwickster ,

Sorry for the long waiting, we had to complete the support to .NET Standard first.

Your method has been added

Thank you for your contribution ;)

Best Regards,

Jonathan

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants