Exemple #1
0
 public static bool QueryUserExistence(string userEmail)
 {
     using (var db = new UsersDBApiService())
     {
         var query = from u in db.Users
                     where u.Email == userEmail
                     select u;
         return(query.Any());
     }
 }
Exemple #2
0
 public static List <User> All()
 {
     using (var db = new UsersDBApiService())
     {
         var query = from u in db.Users
                     orderby u.ID descending
                     select u;
         return(query.ToList());
     }
 }
Exemple #3
0
        public static bool InsertNewUser(User newUser)
        {
            if (QueryUserExistence(newUser.Email))
            {
                return(true);
            }

            using (var db = new UsersDBApiService())
            {
                db.Insert(newUser);
                return(true);
            }
        }