Beispiel #1
0
 public int SaveUser(User user)
 {
     int userId;
     using (var db = new BaoLinksContainer())
     {
         db.User.Add(user);
         userId=db.SaveChanges();
     }
     return userId;
 }
Beispiel #2
0
        public int SaveDiscountInfo(DiscountInfo discountInfo)
        {
            using (var db = new BaoLinksContainer())
            {
                try
                {
                    var query = db.DiscountInfo.Add(discountInfo);
                    db.SaveChanges();
                }
                catch (DbEntityValidationException exception)
                {
                    var i = exception;
                    throw;
                }

            }
            return discountInfo.Id;
        }