So my IMusicStoreContext is in place on all of the controllers now. I still need to actually write an implementation of IMusicStoreContext, but that can come later.
My next goal is to get all of the entity properties into my POCOs. The NHibernate way has typically been to pass instances of the object around instead of foreign key integers.
Using MVC means that I will at least need the primary key to be a part of my entity.
For example http://localhost/albums/1 must point to the album with id 1, so I’m going to need to keep my Id available to me in code. This is a design decision that’s important with NHibernate that isn’t possible with EF4.
Here’s the domain model I’ve come up with so far. This might change at some stage in the future. I had to add OrderDetail.
Notice that instead of passing around integer Id’s, I’m referencing the related types directly. For example – Genre on the Album class.