public ContactDTO SearchUserContactByUsername(string username)
        {
            var contact = LoginHelperService
                          .GetCurrentUser()
                          .Contacts
                          .FirstOrDefault(o => o.Username.ToLower() == username.ToLower());

            return(contact);
        }
        public IAccount SignInUser(LoginDTO user)
        {
            var searchedUser = _accountsDB
                               .Read()
                               ?.FirstOrDefault(o =>
                                                o.User.Email == user.Email || o.Username == user.UserName &&
                                                o.Password == user.Password);

            if (searchedUser != null)
            {
                LoginHelperService.LoginUser(searchedUser);
            }
            return(searchedUser);
        }
 public void SignOutUser()
 {
     LoginHelperService.LogOutUser();
 }