Exemple #1
0
 public int Create(Follow follow)
 {
     follow.CreatedOn = DateTime.Now;
     this.dbContext.Follows.Add(follow);
     this.dbContext.SaveChanges();
     return follow.Id;
 }
Exemple #2
0
 public bool DeleteFollowProject(Follow follow)
 {
     if (follow != null)
     {
         this.dbContext.Follows.Remove(follow);
         this.dbContext.SaveChanges();
         return true;
     }
     return false;
 }
Exemple #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;
        }
Exemple #4
0
 private bool SaveChanges(Follow follow)
 {
     return this.repo.SaveChanges(follow);
 }
Exemple #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;
 }