public int Create(Follow follow) { follow.CreatedOn = DateTime.Now; this.dbContext.Follows.Add(follow); this.dbContext.SaveChanges(); return follow.Id; }
public bool DeleteFollowProject(Follow follow) { if (follow != null) { this.dbContext.Follows.Remove(follow); this.dbContext.SaveChanges(); return true; } return false; }
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; }
private bool SaveChanges(Follow follow) { return this.repo.SaveChanges(follow); }
public bool SaveChanges(Follow follow) { this.dbContext.Entry(follow).State = System.Data.Entity.EntityState.Modified; int result = this.dbContext.SaveChanges(); return result > 0; }