ECO atomic operations

I’ve just created a simple class which I thought I’d share. Account1.Balance += 10;Account2.Balance -= 10; In this case we might expect the second line to throw an exception if the adjustment is not permitted, but the first line has already executed.  Obviously this isn’t a problem because we simply wouldn’t update the database, but …
Continue reading ECO atomic operations

Unity.BuildUp–Ambiguous constructor

Sometimes you have no control over the instantiation of your classes and therefore cannot use Unity. For this reason the BuildUp method was added to Unity in order to either call the method marked with [InjectionMethod] or to set all properties marked with [Dependency].  Unfortunately in the latest build this is broken.  For some reason …
Continue reading Unity.BuildUp–Ambiguous constructor

ASP MVC encoding route values

I’ve recently been using ASP MVC 2 to develop a business application.  As you may already know the ASP MVC routing system works with URLs which look like this http://localhost/Client/Details/IBM In standard ASPX apps the URL would look more like this http://localhost/Client/Details.aspx?code=IBM The first URL obviously looks much nicer than the 2nd, however it comes …
Continue reading ASP MVC encoding route values

ECO and distributed transactions

My current app is a website, each client gets their own unique database in order to help prevent possible data access from other clients (and meet various legal requirements too.)  One of the features of this application is that there is some core data (such as countries/currencies) which is maintained on behalf of the client.  …
Continue reading ECO and distributed transactions

Tightly coupling generic types

Update: Instead of decorating responses with IResponseFor<T> I now instead decorate the command/query with IExpectResponse<T> – Each command/query should only have one response type, and this way it makes it possible to specify the return type should be something simple like a GUID. My server application works purely on a request/response pattern, like so var …
Continue reading Tightly coupling generic types

ECO Persistence Mapper per connection

The Enterprise Core Objects Persistence Mapper is a singleton which is used by all EcoSpace instances.  It’s purpose is to load mapping information from the DB when your app starts and to cache it, improving performance. I needed a connection per client, all running within a single application.  This was a problem because once the …
Continue reading ECO Persistence Mapper per connection

PropertyChangedEventHandler is not marked as serializable

My data-transfer-objects implement INotifyPropertyChanged, which was giving me a problem whenever I tried to serialise them over a Remoting session.  If you try to add [NonSerialized] to the event you get an error informing you that you can only apply this attribute to fields, and not properties. The solution is pretty simple, I think the …
Continue reading PropertyChangedEventHandler is not marked as serializable

Partial declarations of must not specify different base classes

I wanted to use a common base class for a set of UserControls in my WPF application, but when I changed the class’s ancestor in the code file and compiled I would get the error “Partial declarations of must not specify different base classes” This is because when you compile a WPF application Visual Studio …
Continue reading Partial declarations of must not specify different base classes

A WebServer for MonoTouch that also parses posted form data (HttpListenerRequest)

I found a few examples of web servers for MonoTouch but none of them parsed the data sent in a POST request.  I looked around the web and was unable to find any examples of how to achieve this.  So now that I’ve written it myself I’ve decided to share my own implementation.  This includes …
Continue reading A WebServer for MonoTouch that also parses posted form data (HttpListenerRequest)