S
shapper
Hello,
I am getting an error:
NotSupportedException was unhandled by user code.
Local Sequence cannot be used in Linq to SQL implementation of query
operators except the Contains() operator.
On the Linq query:
List<PostsTag> ties = (from t in database.Tags
join pt in paper.Tags on t.Name equals
pt.Name
select new PostsTag {
PostID = paper.Post.PostID,
TagID = t.TagID
}).ToList();
Basically Tag has two properties: TagID and Name.
paper.Tags is a List<Tag> where each Tag has only the Name defined.
So I need to pick the TagID from database.Tags by finding which Tag
given the name.
I think the problem is that the join in theory can give me more than
one record.
However, I know that there aren't two tags with same Name as I test it
before I insert a new tag.
How can I solve this without having to introduce a Sub Query?
Thanks,
Miguel
I am getting an error:
NotSupportedException was unhandled by user code.
Local Sequence cannot be used in Linq to SQL implementation of query
operators except the Contains() operator.
On the Linq query:
List<PostsTag> ties = (from t in database.Tags
join pt in paper.Tags on t.Name equals
pt.Name
select new PostsTag {
PostID = paper.Post.PostID,
TagID = t.TagID
}).ToList();
Basically Tag has two properties: TagID and Name.
paper.Tags is a List<Tag> where each Tag has only the Name defined.
So I need to pick the TagID from database.Tags by finding which Tag
given the name.
I think the problem is that the join in theory can give me more than
one record.
However, I know that there aren't two tags with same Name as I test it
before I insert a new tag.
How can I solve this without having to introduce a Sub Query?
Thanks,
Miguel