private static T GetFilter <T>(RecentInfoFilterRequest filterRequest) where T : RecentInfoFilter, new() { var filter = new T { ContributedAfter = DateTime.Today.AddDays(-filterRequest.Days), ContributedBy = !string.IsNullOrEmpty(filterRequest.ContributedBy) ? new[] { filterRequest.ContributedBy } : null, Agencies = filterRequest.Agencies }; return(filter); }
public List <RecentProperty> GetProperty(RecentInfoFilterRequest filterRequest) { return(_recentInfoQueryService.GetProperty(GetFilter <RecentPropertyFilter>(filterRequest)).OrderBy(p => p.Description).ToList()); }
public List <RecentPerson> GetPeople(RecentInfoFilterRequest filterRequest) { return(_recentInfoQueryService.GetPeople(GetFilter <RecentPersonFilter>(filterRequest)).OrderBy(p => p.LastName).ToList()); }
public List <RecentVehicle> GetVehicles(RecentInfoFilterRequest filterRequest) { return(_recentInfoQueryService.GetVehicles(GetFilter <RecentVehicleFilter>(filterRequest)).OrderBy(v => v.PlateNumber).ToList()); }
public List <RecentEvent> GetEvents(RecentInfoFilterRequest filterRequest) { return(_recentInfoQueryService.GetEvents(GetFilter <RecentEventFilter>(filterRequest))); // ordered desc by DateContributed }