using System; using System.Collections.Generic; using System.Security.Cryptography; using ReactiveUI; using System.Text; using RegAuth.Models; using Microsoft.EntityFrameworkCore; using System.Linq; namespace RegAuth.ViewModels { internal class AuthViewModel : ViewModelBase { string _login = ""; string _password = ""; public string Login { get=>_login; set=>_login = value; } public string Password { get=>_password; set=>_password = value; } public void AuthUser() { byte[] _hashPassword = MD5.HashData(Encoding.ASCII.GetBytes(_password)); User user = MainWindowViewModel.myConnection.Users.Include(x=>x.Roleid).FirstOrDefault(x=>x.Login == _login && x.Password == _hashPassword); } } }