Beispiel #1
0
        public bool DeleteCollection(int id)
        {
            var dispensableCollection = GetCollectionByID(id);

            _context.Attach(dispensableCollection).State = EntityState.Deleted;
            _context.SaveChanges();
            return(true);
        }
Beispiel #2
0
        public User CreateUser(LoginInputModel input)
        {
            User user = new User();

            user.Email = input.Email;
            byte[] passwordHash, passwordSalt;
            _authHelp.CreatePasswordHash(input.Password, out passwordHash, out passwordSalt);
            user.PasswordHash           = passwordHash;
            user.PasswordSalt           = passwordSalt;
            _context.Attach(user).State = EntityState.Added;
            _context.SaveChanges();
            return(user);
        }
Beispiel #3
0
 public Order CreateOrder(Order order)
 {
     _context.Attach(order).State = EntityState.Added;
     _context.SaveChanges();
     return(order);
 }
Beispiel #4
0
 public Product CreateProduct(Product product)
 {
     _context.Attach(product).State = EntityState.Added;
     _context.SaveChanges();
     return(product);
 }