Comments on: Asynchronous Call of Entity Framework in C# 5.0 http://bhrnjica.net/2011/10/13/asynchronous-call-of-entity-framework-in-c-5-0/ C#, C++, Math, Evolutionary Algorithms, Engineering, ... Sun, 09 Aug 2015 14:04:36 +0000 hourly 1 http://wordpress.com/ By: KickAss Torrents http://bhrnjica.net/2011/10/13/asynchronous-call-of-entity-framework-in-c-5-0/#comment-63150 Thu, 26 Mar 2015 09:32:53 +0000 http://bhrnjica.net/?p=4446#comment-63150 Extremely initial coming from all, navigate to the u – Torrent software.
Bahya kumbhaka could be the state where the yogi surrenders his very self
, inside the form of his breath, towards the lord and
merges with universal breath it may be the noblest kind of surrender,
because the yogi’s identity is completely merged with all the Lord.
If you’ve never tried this before, it is a feature that will permit you to gain 33 mb a
day.

]]>
By: foodandme.in http://bhrnjica.net/2011/10/13/asynchronous-call-of-entity-framework-in-c-5-0/#comment-51474 Mon, 24 Nov 2014 16:30:02 +0000 http://bhrnjica.net/?p=4446#comment-51474 foodandme.in

Asynchronous Call of Entity Framework in C# 5.0 | Bahrudin Hrnjica Blog

]]>
By: tarot y videncia http://bhrnjica.net/2011/10/13/asynchronous-call-of-entity-framework-in-c-5-0/#comment-29712 Sat, 20 Sep 2014 20:23:33 +0000 http://bhrnjica.net/?p=4446#comment-29712 May I simply just say what a relief too discover a person that actually knows what they are
discussing on the web. You definitely realize how
to bring ann issue to light and make it important. More and more people
ought to look at this and understand this side of your
story. I was surprised you’re not more popular given that
you surely possess the gift.

]]>
By: Bahrudin Hrnjica http://bhrnjica.net/2011/10/13/asynchronous-call-of-entity-framework-in-c-5-0/#comment-2157 Sun, 02 Dec 2012 21:42:06 +0000 http://bhrnjica.net/?p=4446#comment-2157 Hi,
thanks for very useful comment.
Maybe your approach with using the Rx.NET would produce better implementation. Unfortunately I didn’t think about this post since I have written it more than year ago.
It would be good if you would implement an example and share with the community, because lot of people came to this post by searching for async operation against EF.

]]>
By: arontsang http://bhrnjica.net/2011/10/13/asynchronous-call-of-entity-framework-in-c-5-0/#comment-2153 Sun, 02 Dec 2012 08:00:18 +0000 http://bhrnjica.net/?p=4446#comment-2153 The usage of ToList() in my opinion is wrong and will reduce performance, as the first element will only be accessible once the last element has been read from the DB. On the other hand if one were to use yield return, then the database connection’s lifecycle will be tied to how quickly your processing will take, potentially leaving the database connection (and associated read locks) open whilst the UI thread updates the UI.

Personally I would reference the Rx.Net libraries and return a Subject then on the callback just

foreach( var x in query.Context.Translate(reader))
{subject.OnNext(x);}

subject.OnComplete()

Then the Subject on each element will raise an event that the UI thread can subscribe to. Thus preventing blocking, asynchronously loading your elements AND concurrently mapping your dbrow to your POCO objects!

]]>
By: Ho to convert your old sequential code in to async « Bahrudin Hrnjica Blog http://bhrnjica.net/2011/10/13/asynchronous-call-of-entity-framework-in-c-5-0/#comment-2005 Tue, 16 Oct 2012 18:36:25 +0000 http://bhrnjica.net/?p=4446#comment-2005 […] blog post about async pattern (part 1 and part 2) (Bosnian language), and also wrote how to call Entity Framework with async pattern as […]

]]>
By: Tamir Daniely http://bhrnjica.net/2011/10/13/asynchronous-call-of-entity-framework-in-c-5-0/#comment-1826 Sat, 28 Jul 2012 13:15:20 +0000 http://bhrnjica.net/?p=4446#comment-1826 It’s worth mentioning that this is only required when you actually want to asynchronously access the DB itself.

If your only goal is keeping the UI running then you only need to enumerate the query in a task and await it. For example:

var data = await Task.Run(() => query.ToList())

And this will be sufficient to free up the UI.

]]>
By: En http://bhrnjica.net/2011/10/13/asynchronous-call-of-entity-framework-in-c-5-0/#comment-1793 Fri, 13 Jul 2012 03:33:43 +0000 http://bhrnjica.net/?p=4446#comment-1793 “Does the ExecuteReaderAsync() executes on the IO threadpool”

yes, so it does hold some scalability benefit when used in asp.net, when used in conjunction with async pages or controllers.

]]>
By: Bahrudin Hrnjica http://bhrnjica.net/2011/10/13/asynchronous-call-of-entity-framework-in-c-5-0/#comment-1512 Sun, 11 Mar 2012 17:10:37 +0000 http://bhrnjica.net/?p=4446#comment-1512 Hi
thanks for comment and very good questions.

For the first question there is some changes in beta version of VS 2011 and async pattern will not work with .NET 4 and below, so we have to wait the release in order to see all good and bad sides of the async pattern. But further you can see some answers for similar question about ExecuteReaderAsync() on StackOverflow .

For second question you already answer, yes we loose tracking changes since we converted entity in to List. But I think it can be implemented so that we can track changes and store back in to db. I didnt try to implement async for this kind of queries.
Regards

]]>
By: Shay Ben-Sasson http://bhrnjica.net/2011/10/13/asynchronous-call-of-entity-framework-in-c-5-0/#comment-1511 Sun, 11 Mar 2012 16:34:04 +0000 http://bhrnjica.net/?p=4446#comment-1511 AMAZING! But I have two questions:
1) Does the ExecuteReaderAsync() executes on the IO threadpool (hope not on the .net thread pool, if so, then there is no gain on a server side execution – only on client side not blocking the UI thread)?
2) What do we loose when we do it and not directly using EF? I think we loose the first level caching of EntityFramework. Secondly, how could this merge into the Unit of Work Pattern?

Thanks, Great Implementation,
Shay

]]>