24 Dec 2010

I'm a Freelance C# / ASP.NET web application developer based in Leeds, Yorkshire, UK. I've years of experience and have just finished a funky AJAX-heavy MVC contract with oodles of Entity Framework fun, and my usual attention to User Experience. Do you want to hire me? In January I'll be free to do another contract so please get in touch if you think I could help!

17 Dec 2010

I love my new Lenovo T410, but the 2-finger scrolling didn't seem to be working right. The area of the touchpad in which the scroll would be detected seemed too narrow. Turns out that "gesture filtering" was enabled and needed to be turned off.

15 Dec 2010

Man I love the Castle Project documentation. Or at least, I would if I was a robot with a brain the size of a planet and an unlimited amount of time on my hands. Sadly I'm a human and find the whole thing impenetrable.

All I wanted to do was to intercept the NHibernate entity update event so that I could log the changes made. With kudos to this dude and this dude, here's how I did it:

Note it uses a struct called EntityPropertyUpdate and a collection called RuntimeManager.EntityPropertyUpdates to keep a log of the changes. You'll have to roll your own if you want to do what I'm doing here, otherwise just modify the code as you see fit.

The other key thing is the ActiveRecordStarter.Initialize() call, which had to be changed to include the assembly containing the AuditUpdateListener class, which happened to be the main executing assembly. I was doing my AR Initialisation in global.asax so it now looks like this:

Make following changes to upload files to c:\temp , with a max file size of 100Mb.
Change these to suit yourself - c:\temp will get automatically cleared so you have been warned.
If you create your own upload folder, remember you will need to give write perms to the ASP.NET process.