S
shapper
Hello,
I have three tables:
Articles > ArticleId, Title, ...
Tags > TagId, Name
ArticlesTags > ArticleId, TagId
Tags also relate to other tables, like documents, through
DocumentsTags ...
I am trying to get how many Tags are related to Articles:
ArticlesTagsCount = database.ArticlesTags.Distinct().Count(),
The problem is that I have 3 tags and this gives me 4 ...
.... I think I am getting the number of times the tags are used in
Articles and not the number of tags associated to articles ...
Do you understand?
How can I fix this?
Note: I have all table relationships well defined.
Thanks,
Miguel
I have three tables:
Articles > ArticleId, Title, ...
Tags > TagId, Name
ArticlesTags > ArticleId, TagId
Tags also relate to other tables, like documents, through
DocumentsTags ...
I am trying to get how many Tags are related to Articles:
ArticlesTagsCount = database.ArticlesTags.Distinct().Count(),
The problem is that I have 3 tags and this gives me 4 ...
.... I think I am getting the number of times the tags are used in
Articles and not the number of tags associated to articles ...
Do you understand?
How can I fix this?
Note: I have all table relationships well defined.
Thanks,
Miguel