Esempio n. 1
0
        private void InsertNewUser(string email)
        {
            using var db = new UsersDbContext();
            var uuid = Guid.NewGuid().ToString();

            db.Add(new User {
                Uuid = uuid, Email = email
            });
            db.SaveChanges();

            Console.WriteLine($"User {uuid} with email {email} saved.");
        }
Esempio n. 2
0
 private bool IsNewUser(string email)
 {
     using var db = new UsersDbContext();
     return(!db.Users.Any(x => x.Email == email));
 }
 private List <User> GetAllUsers()
 {
     using var db = new UsersDbContext();
     return(db.Users.ToList());
 }