Tuesday, July 14, 2009

Version 1.1 Final of LINQ to SQL Entity Base Released

Hi everyone,

I've released the latest version of the LINQ to SQL Entity Base. If you are unfamiliar with it, it allows you to have change tracking without having to have the DataContext object within scope.

Here's the changes since Version 1.0

Improvement: Implemented caching for reflected properties which should significantly speed up creation of entity instances. Thanks Johannes!

Improvement: If you delete an entity while it is in the new state (and therefore has not been submitted to the database yet), the entity will now be removed from the scope of the entity tree during the call SyncronisationWithDataContext(), and as there are no references to the entity anymore it will be garbage collected. Before this change, the object would still hang around.

Bug Fix: Issue where setting a value FK value via object reference did not result in entity being flagged as modified unless you modified another property on that entity as well.


Anyway, head on over to codeplex to check it out.

Cheers

Matt.

Saturday, July 4, 2009

Javascript showModalDialog() - Not impressed

Recently I was working on an ASP.Net page to put in an IFRAME for Microsoft CRM. I had a requirement to choose a CRM systemuser from a list, and so naturally I went looking for a way to do this.

I stumbled across showModalDialog() and thought it was the way to go as it offered a Modal Dialog window which I could put to any URL and also could return any result I wanted back to the calling window really simply.

So, everything seemed to work great, but as it turns out, it IE 8 seems to cache the Dialog window so everytime that you start it up it would show the very first window that you had that ever used it (not just for that session, but the very first time you used the window with that URL). This was really odd, I tried several methods for stopping the caching but none of them seemed to work - even changing the URL to be unique every time didn't even stop it!

At the end of the day I gave up after finding out so many other people were having problems with it, and that it's functionality and become "flakey-er" as new revisions of IE were released (I also discovered that it's an IE only feature).

I ended up just re-arranging my base page (the one that i put in the IFRAME) to include the some functionality.

From now on I'll be avoiding the showModalDialog() - as I wouldn't be surprised if it doesn't work at all in the next version of IE. And although I ended up not using any type of Modal in this instance, I did find examples of how it's possible to do it with standard (non IE specific) code.

Lesson Learnt!