How do i put a nested insert into database using Linq to SQL
my Table is like this:
[Post]
--Post ID
--Post Title
[Attachment]
--Post ID (PFK)
--AttachmentID (PK)
--IMGID (FK)
--VIDID (FK)
[IMG]
--IMGID (PK)
it's a M:N table
basically when i submit a form , it go together with the attachments within the form. Im ok with insert Post, but strugling with the inserting attachments since i dont have any POST ID yet...
so what do you think is the best solution for this kind of problem?
Thank you