RichP's Blog

The .Net ramblings of Richard Penrose

WCF Service Proxies – Channel Factories

without comments

Some time ago I got a bit fed up with the standard way that Visual Studio creates WCF client proxies. I.e. right click and add service reference. Although it is fairly simple to create service clients this way, it generates a load of horrible code within you project. It also has the following short comings: [...]

Read More

Written by admin

July 26th, 2010 at 12:47 pm

Posted in WCF

Fluent NHibernate References – Left Join (Sort of)

without comments

I hit an issue yesterday with NHibernate which I managed to resolve so I thought I’d jot down some notes. The problem was as follows: We have a class called Person see below: public class Person { public virtual int Id { get; set; } public virtual Car Car { get; set; } } Using [...]

Read More

Written by admin

June 23rd, 2010 at 8:48 am

Posted in NHibernate

Script Tags in Asp.Net MVC

without comments

Just a quick tip really, when adding Javascript tags to you Asp.Net MVC master page use the following syntax rather than hard coding the path: <script src="<%= Url.Content("~/Script/jquery-1.2.3.min.js") %>" type="text/javascript"></script> This allows the Asp.Net engine to resolve the path and is more reliable than hard coding it. Thanks to Steve Fenton for this gem.

Read More

Written by admin

May 19th, 2010 at 10:40 am

Posted in Asp.Net

Windsor IOC – Notes and Code Samples

without comments

I have been messing around with Windsor recently and I thought I would jot down some notes. I have also add some code samples to demonstrate various aspects of Windsor. See code samples at the bottom of the post. Dependency Injection / IOC Before going any further make sure you understand the concepts of IOC [...]

Read More

Written by admin

March 31st, 2010 at 12:46 pm

Posted in Design Patterns

ASP.Net Sessions with SQL Server

without comments

I recently ran into some problems with ASP.Net session state with a SQL server provider. At times the SQL Database is being hit extremely hard with updates locks and reset timeout events. Consequently I have spent a fair amount of time researching the optimisation of session state and I thought I’d write up some of [...]

Read More

Written by admin

March 15th, 2010 at 2:14 pm

Posted in Asp.Net

WCF – Multiple Endpoints in IIS

without comments

Background Sometimes it is desirable to configure a WCF service to support on more than one endpoint. Implementing this on a service which is hosted outside IIS (in a console app or Windows service say) is very straight forward and logical. Surprisingly achieving this on a service which is hosted in IIS is just as [...]

Read More

Written by admin

March 12th, 2010 at 12:05 pm

Posted in WCF

NMock – Custom List Matcher

without comments

I am a big believer in Test Driven development. I am also an avid user of mocking Frameworks I having used the excellent Rhino Mocks framework in the past and am currently using the NMock framework as this is the preference of my current client. Anyway, the other day I was testing some code was [...]

Read More

Written by admin

March 10th, 2010 at 1:23 pm

Posted in Unit Testing