Beispiel #1
0
 public void AddUrl(Url url)
 {
     using (var context = new UrlContext(_connectionString))
     {
         context.Urls.Add(url);
         context.SaveChanges();
     }
 }
Beispiel #2
0
        public void AddUser(User user, string password)
        {
            user.Password = PasswordEncryption.HashPassword(password);

            using (var context = new UrlContext(_connectionString))
            {
                context.Users.Add(user);
                context.SaveChanges();
            }
        }