Windows Forms, Entity Framework, Data Binding, threading
-
I've seen some good information on this site as to how to set up a Windows Forms application using the Entity Framework and Data Binding the controls on the forms to the Entity Framework. And also have a SQL Server at the bottom of the stack. But, there is one thing that I don't understand. I could be missing something. But it seems that, in the examples that I've seen, that the Form controls, the entity framework, and the binding between are all running off of the same thread. If that's true, then I would think that I could expect the UI to appear to hang while waiting on a round trip query to the Database. It would seem that it would be better to make any Database query run in a separate thread for performance reasons. Or, perhaps it's the case that optimizations along these lines take place, by default, under the hood in ObjectContext and I just don't know it. Could someone please enlighten me?
-
I've seen some good information on this site as to how to set up a Windows Forms application using the Entity Framework and Data Binding the controls on the forms to the Entity Framework. And also have a SQL Server at the bottom of the stack. But, there is one thing that I don't understand. I could be missing something. But it seems that, in the examples that I've seen, that the Form controls, the entity framework, and the binding between are all running off of the same thread. If that's true, then I would think that I could expect the UI to appear to hang while waiting on a round trip query to the Database. It would seem that it would be better to make any Database query run in a separate thread for performance reasons. Or, perhaps it's the case that optimizations along these lines take place, by default, under the hood in ObjectContext and I just don't know it. Could someone please enlighten me?