Guest User

Untitled

a guest
Aug 14th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. Insert only those objects that are not already in the database
  2. var tags = context.Tags.Where(t => t.ItemId = itemId) // search via your item
  3. .Select(t => t.TagValue);
  4.  
  5. var newTags = myItem.Tags.Where(t => !tags.Contains(t.TagValue));
  6. var existingTags = myItem.Tags.Where(t => tags.Contains(t.TagValue));
Add Comment
Please, Sign In to add comment