static void Main(string[] args) { ShopSiteDB db = new ShopSiteDB(); Console.WriteLine("enter the pass"); var pass = Console.ReadLine(); var us = db.Users.SingleOrDefault(u => u.UserName == "martini"); var userpass = us.Password; if (AccountsUtilities.VerifyHashPassword(userpass, pass)) { Console.WriteLine("success"); } else { Console.WriteLine("failed"); } Console.ReadKey(); }
public GenericRepository(ShopSiteDB db) { _context = db; _table = db.Set <T>(); }
public UnitOfWork(ShopSiteDB context) => db = context;
public AccountRepository(ShopSiteDB context) => db = context;
public override string[] GetRolesForUser(string username) { using var db = new ShopSiteDB(); return(db.Users.Where(u => u.Email == username).Select(u => u.Roles.RoleName).ToArray()); }
public ProductsCustomRepository(ShopSiteDB context) { db = context; }