S
shapper
Hello,
I have 3 tables:
Tags > TagID, Name
Files > FileID, Name, Url
FilesTags > FileID, TagID
FilesTags relates each file with one or more tags
I need to get a specific Tag, given its ID, and get also the number of
associations to files. I created the following:
TagPaper tagPaper = (from t in database.Tags
select new TagPaper {
Tag = t,
Count = t.FilesTags.Count
}).SingleOrDefault(t => t.TagID == id);
I am getting an error in "Count = t.FilesTags.Count" saying:
'Tag' does not contain a definition for 'FilesTags' and no extension
method 'FilesTags' accepting a first argument of type 'Tag' could be
found (are you missing a using directive or an assembly reference?).
Any idea what am I doing wrong?
Thanks,
Miguel
I have 3 tables:
Tags > TagID, Name
Files > FileID, Name, Url
FilesTags > FileID, TagID
FilesTags relates each file with one or more tags
I need to get a specific Tag, given its ID, and get also the number of
associations to files. I created the following:
TagPaper tagPaper = (from t in database.Tags
select new TagPaper {
Tag = t,
Count = t.FilesTags.Count
}).SingleOrDefault(t => t.TagID == id);
I am getting an error in "Count = t.FilesTags.Count" saying:
'Tag' does not contain a definition for 'FilesTags' and no extension
method 'FilesTags' accepting a first argument of type 'Tag' could be
found (are you missing a using directive or an assembly reference?).
Any idea what am I doing wrong?
Thanks,
Miguel