public override async Task <object> Handle(object request, IList <IActionBag> actionBags) { var user = BagConverter.Get <ActiveUserBag>(actionBags); if (user == null) { return("User is not logged in"); } return(await base.Handle(request, actionBags) .ConfigureAwait(false)); }
public override async Task <object> Handle(object request, IList <IActionBag> actionBags) { var user = BagConverter.Get <ActiveUserBag>(actionBags); if (user != null) { return($"Given connection is already logged in to account {user.ActiveUser.UserEntity.Username}"); } return(await base.Handle(request, actionBags) .ConfigureAwait(false)); }
public override async Task <object> Handle(object request, IList <IActionBag> actionBags) { var connectionBag = BagConverter.Get <ConnectionBag>(actionBags); var active = GetActiveUser(connectionBag.Connection); if (active?.UserEntity != null) { actionBags.Add(new ActiveUserBag(active)); } return(await base.Handle(request, actionBags) .ConfigureAwait(false)); }