public User Register(User user) { user.Password = CryptoHelper.Crypto.HashPassword(user.Password); user.AddedDate = DateTime.Now; user.ModifiedDate = DateTime.Now; user.AddedBy = "System"; user.ModifiedBy = "System"; _context.Users.Add(user); _context.SaveChanges(); return(user); }
public void UpdateToken(int id, string token) { Admin admin = _context.Admins.Find(id); admin.Token = token; _context.SaveChanges(); }
public void CreateReview(ProductReview productReview) { _context.ProductReviews.Add(productReview); _context.SaveChanges(); }
public void ChangeCount(Basket basketItem, int count) { _context.Entry(basketItem).State = EntityState.Modified; basketItem.Count = count; _context.SaveChanges(); }