Hi,
I have this project where I would like to go from regular ADO.NET code to a more productive, more understandable, leaner and meaner OR/M system. I have the following scenario that currently works but has to work with the OR/M as well:
Orders:
- id
- stuff
Documents:
- id
- order_id
- path
When I create a new order I attach a document. This document is given an array of binary data (a PDF file) and when I save it, it writes the binary content to the path defined. This all works and even transactionally.
Now, is it possible to replicate the same behavior using an OR/M? Clearly it is something that I will have to write manually on top of the generated OR/M code but is it doable in Linq-to-SQL or nHibernate? Which one would you recommend? And how would I hook it up to do this?
There is some other less-default behavior in my application that is a little bit difficult to replicate I think.
Cards:
- id
- serial
- pin
- puk
Modems:
- id
- serial
- imei
Orders:
- id
- stuff
OrderLines:
- id
- order_id
- stuff
OrderLineContents:
- id
- orderline_id
- identifier_name
- identifier_id
What I'm trying to do here is hook up a specific card or a specific modem to an OrderLine. By inserting 'Modem' in identifier_name and id 1 for example. This system currently works with ADO.NET but again, I wonder how easily it's replicable in an OR/M. I have read that L2S only support single-table inheritance and I think this is clearly some sort of polymorphic multi-table 'thing'.
Any help with this would be hugely appreciated :) I seek a system that could do both these scenarios or perhaps change the second scenario to something a little different if there is no other choice.