I use OMS, which stores up to three write positions in the database.
The following is an example of an order containing five items.
Order Header
Order Detail
Prod 1
Prod 2
Prod 3
Order Detail
Prod 4
Prod 5
One order header record and two detail records.
My goal is to have a one-to-one relationship for information records (ie, one detailed record for each item). I used to use an UNION ALLSQL statement to retrieve data. Is there a better approach to this problem using LINQ?
The following is the first attempt to use LINQ. Any feedback, suggestions or recommendations would be greatly appreciated. For what I read, UNIONcan an operator tax the process?
var orderdetail =
(from o in context.ORDERSUBHEADs
select new {
edpNo = o.EDPNOS_001, price = o.EXTPRICES_001,
qty = o.ITEMQTYS_001 }
).Union(from o in context.ORDERSUBHEADs
select new { edpNo = o.EDPNOS_002, price = o.EXTPRICES_002,
qty = o.ITEMQTYS_002 }
).Union(from o in context.ORDERSUBHEADs
select new { edpNo = o.EDPNOS_003, price = o.EXTPRICES_003,
qty = o.ITEMQTYS_003 });