protected Singleton() { Dictionary <int, Queue <string> > Rooms = new Dictionary <int, Queue <string> >(); using (var context = new HomeDrawDbContext()) { var drawings = (from p in context.Drawings select p); foreach (Drawing drawing in drawings) { Queue <string> queue = new Queue <string>(); if (drawing.MasterID != null) { queue.Enqueue(drawing.MasterID); } //foreach (AppUser user in drawing.JoinedUsers) //{ // queue.Enqueue(user.Id); //} Rooms.Add(drawing.DrawingID, queue); } } ListOfRooms = Rooms; }
public static AppUserManager Create(IdentityFactoryOptions <AppUserManager> options, IOwinContext context) { HomeDrawDbContext db = context.Get <HomeDrawDbContext>(); AppUserManager manager = new AppUserManager(new UserStore <AppUser>(db)); return(manager); }