예제 #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;
 }