public virtual int Count(Expression <Func <T, bool> > filter) { if (filter != null) { return(CurrentDbSet.Where(filter).Count()); } return(CurrentDbSet.Count()); }
/// <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)); }