public List <tbfollowing> UpdateFlag_follow(string prNumber, string userid, string flag_follow)
        {
            try
            {
                using (var db = new ETrackingContext())
                {
                    db.tbfollowings.Where(i => i.userid == userid && i.pr_number == prNumber).ToList()
                    .ForEach(x => x.flag_follow = flag_follow);
                    db.SaveChanges();

                    return(null);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public List <tbfollowing> Add(tbfollowing follow)
        {
            try
            {
                using (var db = new ETrackingContext())
                {
                    follow.lastmodifieddate = DateTime.Now;
                    db.tbfollowings.Add(follow);
                    db.SaveChanges();

                    return(null);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public Comment Add(Comment comment)
        {
            try
            {
                using (var db = new ETrackingContext())
                {
                    comment.UpdateDate = DateTime.Now;
                    var data = db.Comments.Add(comment);
                    db.SaveChanges();

                    return(data);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#4
0
 public void Save()
 {
     context.SaveChanges();
 }