示例#1
0
 public int Create(Follow follow)
 {
     follow.CreatedOn = DateTime.Now;
     this.dbContext.Follows.Add(follow);
     this.dbContext.SaveChanges();
     return follow.Id;
 }
示例#2
0
 public bool DeleteFollowProject(Follow follow)
 {
     if (follow != null)
     {
         this.dbContext.Follows.Remove(follow);
         this.dbContext.SaveChanges();
         return true;
     }
     return false;
 }
示例#3
0
        public int Follow(int projectId, int userId)
        {
            Follow test = this.repo.GetFollowProject(projectId, userId);
            if (test != null)
            {
                return test.Id;
            }

            Follow follow = new Follow()
            {
                ProjectId = projectId
                , FollowerId = userId

            };
            int createdId = this.repo.Create(follow);

            return createdId;
        }
示例#4
0
 private bool SaveChanges(Follow follow)
 {
     return this.repo.SaveChanges(follow);
 }
示例#5
0
 public bool SaveChanges(Follow follow)
 {
     this.dbContext.Entry(follow).State = System.Data.Entity.EntityState.Modified;
     int result = this.dbContext.SaveChanges();
     return result > 0;
 }