Ejemplo n.º 1
0
        public User Login(SQLiteConnection connection, string username, string password)
        {
            if (string.IsNullOrWhiteSpace(username))
            {
                throw new ArgumentNullException(nameof(username));
            }

            if (string.IsNullOrWhiteSpace(password))
            {
                throw new ArgumentNullException(nameof(password));
            }


            var hashedPass = new Sha256Encryption().GenerateSha256Hash(password);

            return(_userRepo.Login(connection, username, hashedPass));
        }
Ejemplo n.º 2
0
        private void CreateTables()
        {
            var conn = DataAccess.GetScope();

            conn.CreateTable <User>();
            conn.CreateTable <Address>();
            conn.CreateTable <Customer>();
            conn.CreateTable <Video>();
            conn.CreateTable <Checkout>();

            var standardUser = new User();

            standardUser.Name = "jessie";
            var pass = new Sha256Encryption().GenerateSha256Hash("test");

            standardUser.Password = pass;
            conn.Insert(standardUser, typeof(User));
            var startCaptital = new Checkout()
            {
                Money = 1000.00
            };

            conn.Insert(startCaptital, typeof(Checkout));
        }