Entity Framework Bad Practices and solutions with EF-Prof

יום שלישי, ספטמבר 6, 2011

Entity Framework Bad Practices – and solutions with EF-Prof This week I had to find and fix an interesting bug. For some reason, when using Entity Framework, we’ve seen database queries that were causing a TimeoutException to be thrown. We used EF-Prof to find which query was giving us troubles, and found a few additional issues. Solving these issues has improved the performance of our server by a great deal. While there are many ways to abuse ADO.Net Entity Framework, these were the two issues I’ve stumbled upon this week: Setting the environment In...
אין תגובות

Refactoring telerik RadScheduleView ReadOnly example to attached behavior

יום שבת, אוגוסט 27, 2011

Refactoring to attached behavior At the project I’m currently working on, I had to integrate Telerik’s RadScheduleView in a WPF application that uses Caliburn Micro as MVVM framework. The RadScheduleView is a time management  component, however, we needed it only for presentation – thus we had to make it a read only control. The control itself does not expose an “IsReadOnly” property, so I found this post at Telerik’s forums. It includes a code sample that shows how to do it, but it does not conform nicely to the M-V-VM Pattern – So I had to refactor it to Attached Behavior. The...
אין תגובות

System.InvalidOperationException: Invoke or BeginInvoke cannot be called on a control until the window handle has been created.

יום שישי, אוקטובר 12, 2007

This is the most annoying bug I had to handle. Here's the exception details: Message: "Invoke or BeginInvoke cannot be called on a control until the window handle has been created." Source: "System.Windows.Forms" Stack Trace: at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object args, Boolean synchronous)at System.Windows.Forms.Control.BeginInvoke(Delegate method, Object args)at System.Windows.Forms.ButtonBase.OnFrameChanged(Object o, EventArgs e)at System.Drawing.ImageAnimator.ImageInfo.OnFrameChanged(EventArgs e)at System.Drawing.ImageAnimator.ImageInfo.set_Frame(Int32 value)at System.Drawing.ImageAnimator.AnimateImages50ms()at System.Threading.ThreadHelper.ThreadStart_Context(Object state)at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)at System.Threading.ThreadHelper.ThreadStart() The thing is, that the programmer who wrote the code that caused the problem knew nothing about multithreading, nor did he know how to read and understand the exception details, and the...
2 תגובות