コード例 #1
0
		public void RegisterUser(string username) {
			AppUserService appUserService = new AppUserService();
			var appUser = appUserService.GetUserByUsername(username);

			if (appUser != null) {
				var connectionId = Context.ConnectionId;

				if (UsersNotifier.UsersConnections.ContainsKey(appUser.Id)) {
					UsersNotifier.UsersConnections[appUser.Id] = new UserFullDuplexConnection {ConnectionId = connectionId};
				} else {
					UsersNotifier.UsersConnections.Add(appUser.Id, new UserFullDuplexConnection {ConnectionId = connectionId});
				}
			}
		}
コード例 #2
0
		public AuthRepository() {
			AppUserService appUserService = new AppUserService();
			UserStore<AppUser> userStore = new UserStore<AppUser>(appUserService.Collection);
			userManager = new UserManager<AppUser>(userStore);
		}