private void SetUser(Direction direction, AppUser user) { RequestBrokers.Remove(RequestBrokers.FirstOrDefault(x => x.Direction == direction)); RequestBrokers.Add(new SendReceiveBroker() { Direction = direction, User = user, UserId = user.Id }); var targetBroker = GetUser(direction); targetBroker.User = user; targetBroker.UserId = user.Id; }
private SendReceiveBroker GetUser(Direction direction) { return(RequestBrokers.FirstOrDefault(x => x.Direction == direction)); }