public Membership Handle(GetMembershipByUsername request)
        {
            var response = _userContextService.GetContextByUsername <Membership>(request.Username);

            if (response.MethodResultState != MethodResultStates.Successful)
            {
                throw new MemberNotFoundException($"No membership details found for user: {request.Username}");
            }

            return(response.Result);
        }
        public Task Handle(FailedSignInAttemptCommand message)
        {
            var membership = _userContextService.GetContextByUsername <Membership>(message.Username).Result;

            if (membership != null)
            {
                membership.AccessFailCount++;
                if (membership.AccessFailCount == 5)
                {
                    membership.IsLocked = true;
                }
            }

            return(Task.CompletedTask);
        }