public static ResponseViewModel <List <ValidateUser_Result> > ValidateCustomer(string username, string password)
 {
     using (EcommerceEntities entities = new EcommerceEntities())
     {
         ResponseViewModel <List <ValidateUser_Result> > response = new ResponseViewModel <List <ValidateUser_Result> >();
         List <ValidateUser_Result> result = entities.ValidateUser(username, password).ToList();
         if (result.Count > 0)
         {
             User user = entities.Users.Where(entry => entry.Username == username && entry.Password == password).FirstOrDefault();
             user.LastLoginTime = DateTime.UtcNow;
             response.Data      = result;
             return(response);
         }
         else
         {
             response.errorViewModel            = new ErrorViewModel();
             response.errorViewModel.statusCode = 300;
             return(response);
         }
     }
 }