Beispiel #1
0
 public UnitOfWork(VehicleTrackingAPIContext dbContext)
 {
     if (dbContext == null)
     {
         throw new ArgumentNullException("dbContext");
     }
     _dbContext = dbContext;
 }
        private bool IsAuthorizedUser(string Username, string Password)
        {
            using (var _dbContext = new VehicleTrackingAPIContext())
            {
                string hashedPassword = PasswordHash.HashSHA1(Password);
                var    obj            = _dbContext.Users.Where(a => a.UserName.Equals(Username) && a.Password.Equals(hashedPassword)).FirstOrDefault();

                if (obj != null)
                {
                    return(true);
                }
                return(false);
            }
        }
Beispiel #3
0
 public VehicleRepository(IUnitOfWork UnitOfWork, VehicleTrackingAPIContext dbContext)
 {
     _UnitOfWork = UnitOfWork;
     _dbContext  = dbContext;
 }