I don't see a lot of examples on how to persist with linq/flinq- I may ultimately write a proc to dowhat I need it to, however the 1->* relationship between tableA and tableC makes that tricky. Can you persist with flinq? Is there a example published somewhere I could follow? Below is what I have tried (or rather the most logical variant of what I have tried).
Thank you in advance.
TableA (1) -> (1) TableB
TableA (1) -> (*) TableC
// add the report
let b = TableB()
b.Name <- getName()
// add the authors
let authorSet = Data.Linq.EntitySet<TableC>()
getAuthorIds document.Authors |> Seq.iter
(fun id ->
let c = TableC()
c.Id <- id
authorSet.Add c)
// add the tagged report w/ associated reoprt
let a = TableA()
a.field1 <- "Something"
a.tableB = b
a.TableC <- authorSet
let docSet = Data.Linq.EntitySet<TableA>()
docSet.Add doc
db.TableA.InsertAllOnSubmit([doc])
let cf = db.ChangeConflicts
let cm = db.GetChangeSet