S
shapper
Hello,
I have 3 tables with the following fields:
Posts: PostID, Title, Body
Tags: TagID, Name
PostsTags: PostID, TagID
1. I need to select all Tags (TagID and Name) that exist in PostsTags
adding a field Count which holds the frequency of how often each tag
is associated to a post, i.e., the number of times it shows in
PostsTags.
2. And would be also possible to group the tags as follows:
If Count <= 10 then group all tags and give Weight = 1
If 10 < Count < 20 then group all tags and give Weight = 2
If Count >= 20 then group all tags and give Weight = 3
How can I create this using LINQ?
Thanks,
Miguel
I have 3 tables with the following fields:
Posts: PostID, Title, Body
Tags: TagID, Name
PostsTags: PostID, TagID
1. I need to select all Tags (TagID and Name) that exist in PostsTags
adding a field Count which holds the frequency of how often each tag
is associated to a post, i.e., the number of times it shows in
PostsTags.
2. And would be also possible to group the tags as follows:
If Count <= 10 then group all tags and give Weight = 1
If 10 < Count < 20 then group all tags and give Weight = 2
If Count >= 20 then group all tags and give Weight = 3
How can I create this using LINQ?
Thanks,
Miguel