views:

224

answers:

0

Firstly, my previous question will help give some back story.

As stated in that question, I have a super-type table (if that is the technical term for it) and I have multiple sub-types in different tables - all with field unique to that sub-type.

Events
* Id
* EventTypeId
* AllEventTypes_Field

EventType0
* EventId (FK)
* EventType0_Field

EventType1
* EventId (FK)
* EventType1_Field

I will be using the repository pattern, along with giving IoC, DI a shot as I've finally wrapped my head around it and really like the sounds of it.

I want to also use POCOs as again, the idea of having everything nice and modular seems like a sizable benefit and this could potentially be a large project.

All that said, I am really at a loss for how to go from LINQtoSQL entities to POCOs for each type.

My initial thought is this:

  • Use of an IEventRepository to have basic DB calls, with calls to other tables pertinent to an EventViewModel
  • Use of a main EventRepository, which will implement IEventRepository, with additional calls to get other tables that are common to all Event types
  • Use of IEventRepository implementations for each type of Event

Are there any concerns I should be aware of with mapping from a LINQ Entity of Event.EventType0 to an EventType0 POCO?

Many thanks in advance - my apologies if this is more of a discussion thread and if this has been answered before, please yell at me - I searched prior to posting, I swear! :)