O'Reilly logo

C# 4.0 Unleashed by Bart De Smet

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Dictionary Suggest Revisited

During the introduction of our discussion about reactive programming, I mentioned the typical AJAX example of dictionary suggest. In doing so, we came to the conclusion there are two event sources somehow. One is the user typing text in the Search box, causing TextChanged events to be raised. Upon every such event, we want to start an asynchronous call to a web service to get dictionary suggestions for words starting with the typed term. This can be nicely expressed in LINQ as follows:

image

Because we haven’t seen LINQ in much depth just yet, approach this query expression with your gut feeling: For every TextChanged event ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required