S
shapper
Hello,
I have the following Query:
public IQueryable<Tag> GetTags(IList<Tag> tags) {
IQueryable<Tag> _tags = (from t in context.aspnet_Tags
join tn in tags on t.Name equals
tn.Name
select new Tag {
Id = t.TagId,
Created = t.Created,
Name = t.Name,
Updated = t.Updated
}).AsQueryable();
return _tags;
} // GetTags
Basically I receive a list of Tags that contain only the names.
Then I look into the database for tags having the same name.
If exists I get the id, Created and Updated fields and return the
tags.
I am using this method in a few situations. One of them is to check if
all tags inserted by the user exist in the database so I have:
var AllFound = repository.GetTags(tags).Count() == tags.Count;
This is not working an I get the following error:
Local sequence cannot be used in LINQ to SQL implementation of query
operators except the Contains() operator.
I am not sure what I am doing wrong ...
Any idea?
Thank You,
Miguel
I have the following Query:
public IQueryable<Tag> GetTags(IList<Tag> tags) {
IQueryable<Tag> _tags = (from t in context.aspnet_Tags
join tn in tags on t.Name equals
tn.Name
select new Tag {
Id = t.TagId,
Created = t.Created,
Name = t.Name,
Updated = t.Updated
}).AsQueryable();
return _tags;
} // GetTags
Basically I receive a list of Tags that contain only the names.
Then I look into the database for tags having the same name.
If exists I get the id, Created and Updated fields and return the
tags.
I am using this method in a few situations. One of them is to check if
all tags inserted by the user exist in the database so I have:
var AllFound = repository.GetTags(tags).Count() == tags.Count;
This is not working an I get the following error:
Local sequence cannot be used in LINQ to SQL implementation of query
operators except the Contains() operator.
I am not sure what I am doing wrong ...
Any idea?
Thank You,
Miguel