diff options
| author | Michael <[email protected]> | 2017-04-07 09:08:48 -0400 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-04-07 09:08:48 -0400 |
| commit | 62fc513e42ff6a52a8dbe69c0555fdf7fdb28ccc (patch) | |
| tree | e946a5b3ee6c9855fc3a3e97709dd4d8385506bc /Project-Unite/Models | |
| parent | 7bc9017b0fd43eb918277319907277edc839794d (diff) | |
| download | project-unite-62fc513e42ff6a52a8dbe69c0555fdf7fdb28ccc.tar.gz project-unite-62fc513e42ff6a52a8dbe69c0555fdf7fdb28ccc.tar.bz2 project-unite-62fc513e42ff6a52a8dbe69c0555fdf7fdb28ccc.zip | |
Add rating of wiki pages.
Diffstat (limited to 'Project-Unite/Models')
| -rw-r--r-- | Project-Unite/Models/WikiModels.cs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Project-Unite/Models/WikiModels.cs b/Project-Unite/Models/WikiModels.cs index a697496..29144d3 100644 --- a/Project-Unite/Models/WikiModels.cs +++ b/Project-Unite/Models/WikiModels.cs @@ -108,6 +108,25 @@ namespace Project_Unite.Models return list.ToArray(); } + + + + } + + public Like[] Likes + { + get + { + return new ApplicationDbContext().Likes.Where(x => x.Topic == this.Id && x.IsDislike == false).ToArray(); + } + } + + public Like[] Dislikes + { + get + { + return new ApplicationDbContext().Likes.Where(x => x.Topic == this.Id && x.IsDislike == true).ToArray(); + } } public string Contents { get; set; } |
