예제 #1
0
        public void Delete(int commentId)
        {
            var comment = _sportWorldContext.Comment.First(c => c.ID == commentId);

            _sportWorldContext.Comment.Remove(comment);
            _sportWorldContext.SaveChanges();
        }
예제 #2
0
        public void AddUser(string id, string name, Gender gender)
        {
            _context.User.Add(new User
            {
                ID     = id,
                Name   = name,
                Gender = gender
            });

            _context.SaveChanges();
        }
예제 #3
0
 public void UpdateStore(Store storeToUpdate)
 {
     _sportWorldContext.Store.Update(storeToUpdate);
     _sportWorldContext.SaveChanges();
 }
예제 #4
0
 public void SaveProducts(IEnumerable <Product> products)
 {
     _SportWorldContext.Product.AddRange(products);
     _SportWorldContext.SaveChanges();
 }
예제 #5
0
        public void AddUser(User user)
        {
            _sportWorldContext.User.Add(user);

            _sportWorldContext.SaveChanges();
        }