From 2fdd32182c6cac6bc4d08ffca52cc64ba3d5fba6 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 7 May 2017 09:33:23 -0400 Subject: [PATCH] add users field to group table --- Project-Unite/Models/Group.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Project-Unite/Models/Group.cs b/Project-Unite/Models/Group.cs index f59270b..da5b277 100644 --- a/Project-Unite/Models/Group.cs +++ b/Project-Unite/Models/Group.cs @@ -16,6 +16,15 @@ public class Group public double RawReputation { get; set; } + public ApplicationUser[] Users + { + get + { + var db = new ApplicationDbContext(); + return db.Users.Where(x => x.GroupId == this.Id).ToArray(); + } + } + public int Reputation { get