|
-
June 27th, 2008, 07:23 AM
#1
LINQ. Insert. How can I do this?
Hello,
I have 3 tables:
Files > FileID, Url, ...
Tags > TagID, Name, ...
FilesTags > FileID, TagID, ...
FilesTags is used to associate tags to each file.
Before I update a file I have the following data:
1. File Data
2. List of File Tags (TagsList)
I need to:
1. Update File Data (This is done)
2. Update File Tags ...
I am having problems updating the file tags using LINQ.
The sequence I am trying to create is:
FOR each Tag in TagsList {
Exists = Find Tag in Tags table given its name
IF Not Exists > Create Tag in Tags table using the Name
Use found or created Tag ID and add record to FilesTags with FileID and TagID
END
How can I translate this to LINQ?
Thanks,
Miguel
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|