Example #1
0
        public User CreateUser(string username, byte[] passwordSalt, byte[] passwordHash, UserDetails userDetails)
        {
            var user = new User()
            {
                Hash        = passwordHash,
                Salt        = passwordSalt,
                UserName    = username,
                IsAdmin     = false,
                UserDetails = userDetails
            };

            _context.Users.Add(user);
            _context.SaveChanges();

            return(user);
        }
Example #2
0
 public Order Add(Order order)
 {
     _context.Orders.Add(order);
     _context.SaveChanges();
     return(order);
 }
Example #3
0
 public Product Add(Product product)
 {
     _context.Products.Add(product);
     _context.SaveChanges();
     return(product);
 }