Example #1
0
        public bool TryLogin(User _loginData)
        {
            var user = new Context().Users
                       .Where(x => x.Name == _loginData.Name)
                       .Where(x => x.Password == _loginData.Password)
                       .Include(x => x.Role)
                       .FirstOrDefault();

            if (user is null)
            {
                return(false);
            }
            CurrentUser = user;
            ValuesChangedNotification?.Invoke(this);
            return(true);
        }
Example #2
0
 public void LogOut()
 {
     CurrentUser = null;
     ValuesChangedNotification?.Invoke(this);
 }