public bool DeleteCollection(int id) { var dispensableCollection = GetCollectionByID(id); _context.Attach(dispensableCollection).State = EntityState.Deleted; _context.SaveChanges(); return(true); }
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); }
public Order CreateOrder(Order order) { _context.Attach(order).State = EntityState.Added; _context.SaveChanges(); return(order); }
public Product CreateProduct(Product product) { _context.Attach(product).State = EntityState.Added; _context.SaveChanges(); return(product); }