public void Insert(Toy toy, int count) { var stockItem = new StockItem() { Count = count, Price = toy.Price * count, BaseToy = toy }; _context.StockItems.Add(stockItem); _context.SaveChanges(); }
public User CreateUser(string login, string password, string answer) { var hash = CreateHash(password); var user = new User() { Login = login, AnswerToSecretQuestion = answer, PasswordHash = hash }; _context.Users.Add(user); _context.SaveChanges(); return(GetUser(login, password)); }
public void Save() { _context.SaveChanges(); }