-
Notifications
You must be signed in to change notification settings - Fork 29
DateQueryable
Julien Amsellem edited this page Sep 30, 2017
·
3 revisions
This queryable interface provides an API to search files and folders depending on their date properties. Let's see how you can get such an object:
var everything = new Everything();
IDateQueryable queryable = everything.Search().ModificationDate;As you can see, when calling Search() method you get an IQuery object that can provides you with the following date queryable:
- CreationDate
- ModificationDate
- AccessDate
- RunDate
As soon as you get an IDateQueryable object you can define how you want to filter on date with the following methods:
-
Equal(DateTime date): search for files and folder which date property is exactly the same as the one specified -
Equal(Dates date): search for files and folder which date property match the predefined date range -
Before(DateTime date): search for files and folder which date property older than the one specified -
Before(Dates date): search for files and folder which date property is older than the predefined date range -
After(DateTime date): search for files and folder which date property is younger than the one specified -
After(Dates date): search for files and folder which date property is younger than the predefined date range -
Between(DateTime from, DateTime to): search for files and folders which date property is in the range of [from .. to] -
Between(Dates from, Dates to): search for files and folders which date property is in the range of two predefined date range -
Last(int count, CountableDates date): search for files and folders which date relies in the last X countable dates -
Next(int count, CountableDates date): search for files and folders which date is after the last X countable dates
var everything = new Everything();
IDateQueryable queryable = everything
.Search()
.ModificationDate
.Equal(DateTime.Now.Date);var everything = new Everything();
IDateQueryable queryable = everything
.Search()
.CreationDate
.Equal(Dates.Yesterday);var everything = new Everything();
IDateQueryable queryable = everything
.Search()
.AccessDate
.Before(Dates.ThisWeek);var everything = new Everything();
IDateQueryable queryable = everything
.Search()
.ModificationDate
.Between(Dates.ThisMay, Dates.ThisJune);