コード例 #1
0
 public virtual int Count(Expression <Func <T, bool> > filter)
 {
     if (filter != null)
     {
         return(CurrentDbSet.Where(filter).Count());
     }
     return(CurrentDbSet.Count());
 }
コード例 #2
0
 /// <summary>
 /// Returns the number of comments for the specified track.
 /// </summary>
 /// <param name="trackId">
 /// The track id.
 /// </param>
 /// <returns>
 /// The number of comments for the specified track.
 /// </returns>
 public int GetFeedbacksCount(int trackId)
 {
     return(CurrentDbSet.Count(v => v.TrackId == trackId));
 }