public List <Feedback> GetFeedbacksByUser(UserPeriod period) { return(_context.Feedbacks .WhereIf(period.UserName != null, x => x.username.StartsWith(period.UserName)) .WhereIf(period.StartTime != null, x => x.date > period.StartTime) .WhereIf(period.EndTime != null, x => x.date < period.EndTime) .OrderByDescending(x => x.date) .ToList()); }
public List <Feedback> GetByUserName([FromBody] UserPeriod period) { return(_feedbackService.GetFeedbacksByUser(period)); }