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

            _context.Attach(dispensableCollection).State = EntityState.Deleted;
            _context.SaveChanges();
            return(true);
        }
예제 #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);
        }
예제 #3
0
 public Order CreateOrder(Order order)
 {
     _context.Attach(order).State = EntityState.Added;
     _context.SaveChanges();
     return(order);
 }
예제 #4
0
 public Product CreateProduct(Product product)
 {
     _context.Attach(product).State = EntityState.Added;
     _context.SaveChanges();
     return(product);
 }