예제 #1
0
        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();
        }
예제 #2
0
 public GenericRepository(ShopSiteDB db)
 {
     _context = db;
     _table   = db.Set <T>();
 }
예제 #3
0
 public UnitOfWork(ShopSiteDB context) => db = context;
예제 #4
0
 public AccountRepository(ShopSiteDB context) => db = context;
예제 #5
0
 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;
 }