-
Notifications
You must be signed in to change notification settings - Fork 129
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
GetAsync() and Include #54
Comments
What issue are you experiencing? |
An InvalidOperationException is thrown when calling GetAsync(). Exception Text: Stack Trace:
Oh. if it matters, I'm using .NET Core 1.0.1. |
Dapper is suffering from a bug that causes the async methods to fail. |
Ok, I'll try to work around it. Thank you very much for the explanation! |
Hi. The normal Get works, but not the async. Look the code is identical...: Her is the exception from the unit test: Expected: No Exception to be thrown at SE.QuotationRepository.Tests.QuotationItemRepositoryTests.Order2_GetIdAsync_Return_Works() in S:\Dropbox\My Documents\01 Projects\SEDK\TelemecaniqueSensorsQuotation\Tests\Business\SE.QuotationRepository.Tests\QuotationItemRepositoryTests.cs:line 90 Wierd that the native dapper works...
|
Workaround :-(
|
@generik0 Please mark It as 'Workaround if you are super retarded and dumb and want you application to suck'. Maybe even underline It. Do you know that GetId will block and you will block one of the very important threads for the Task Scheduler? You didn't even use long running flag so It's super likely to completly shutdown your application If your application. For anyone looking at this DO NOT USE IT! It will cause alot of unwanted behvaiour. |
@GroundZero I can see that my example was very "high level" and some of the markdown was messed up. i.e. the "<" and ">". The real meaning of the workaround did not come out well in the example. I have updated a little. I hope it is more pleasing....
For may example the call to the workaround method would be: Best Regards, your mate, generik0 |
@GroundZero Any Comments? |
I'm still facing this issue An InvalidOperationException is thrown when calling GetAsync(). Exception Text: |
There seems to be an issue with the GetAsync() method. I'm writing a small library to maintain the database of my private mail server and tried to query a SQLite database. The "MailAccount" class contains a property to the "Domain" the mail account belongs to. Furthermore a property of type long annotated with the ForeignKey attribute points to the "Domain" property.
The following line works as expected:
MailAccount account = connection.Get(new MailAccount { Id = id }, statements =>statements.Include<Domain>(x => x.LeftOuterJoin()));
The asynchronous equivalent does not:
MailAccount account = await connection.GetAsync<MailAccount>(new MailAccount { Id = id }, statements => statements.Include<Domain>(x => x.LeftOuterJoin()));
Is there something I should additionally consider when using the asynchronous API functions?
The text was updated successfully, but these errors were encountered: