[go: nahoru, domu]

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

Multiple delete #6

Closed
leonardoporro opened this issue Feb 28, 2017 · 2 comments
Closed

Multiple delete #6

leonardoporro opened this issue Feb 28, 2017 · 2 comments
Assignees
Labels

Comments

@leonardoporro
Copy link
Owner

"Sending a list of Ids (long) to DeleteAsync throws the following exception "Object must implement IConvertible."
Casting the list to an object array I get the following "One or more errors occurred. (Key values count mismatch, expected Id)"

@leonardoporro
Copy link
Owner Author

use
await detachedContext.Set<Entity>().DeleteAsync(new KeyValue(1), new KeyValue(2));

@rupoase
Copy link
rupoase commented Nov 1, 2019

Hello Leonardo,

I'm trying to use the DeteleAsync feature with the new syntax, like follows:

await detachedContext .Set<Entity>() .DeleteAsync(someEnumerable.Select(e=>e.Id).ToArray()); - this returns the IComparable error.
await detachedContext .Set<Entity>() .DeleteAsync(someEnumerable.Select(e=> new KeyValue(e.Id)).ToArray(); - this returns IndexOutOfRange exception.

I think I'm doing something wrong, but based on the parameter metadata that is showing up in the Intellisense, I can only figure out the above examples.
Can you write down an example of usage where the Entity is an actual complex object ?
Thank you!

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

No branches or pull requests

2 participants