### Manual filter to contracts.

Manual filter allows you to create filtering expressions with C# LINQ. This filter is mainly used to create conditions which are dependant on current date.
Example 1. Show all of the companies whose contract expires in the next n days:

CompanyDocuments.Any((DateEnd - DateTime.Now).Value.TotalDays <= n && (DateEnd - DateTime.Now).Value.TotalDays > 0)

(DateEnd - DateTime.Now).Value is used here because DateEnd is of type DateTime?(Nullable). If the field is not Nullable, you must simply write:

(DateTime.Now-Created).TotalDays<14

Example 2. Show all companies that have contracts that are created in the current month:

CompanyDocuments.Any(DateTime.Now.Year == DateBegin.Value.Year && DateTime.Now.Month == DateBegin.Value.Month)

Example 3. Show all companies that have contracts that are created in the past month:

CompanyDocuments.Any(DateTime.Now.AddMonths(-1).Year == DateBegin.Value.Year && DateTime.Now.AddMonths(-1).Month == DateBegin.Value.Month)

Example 4. Show all companies in which the contract expires this month:

CompanyDocuments.Any(DateTime.Now.Year == DateEnd.Value.Year && DateTime.Now.Month == DateEnd.Value.Month)

Example 5. Show all companies in which the contract expires next month:

CompanyDocuments.Any(DateTime.Now.AddMonths(1).Year == DateEnd.Value.Year && DateTime.Now.AddMonths(1).Month == DateEnd.Value.Month)

Allowed date and time intervals: TotalDays.

Allowed fields to filter by: DateBegin (DateTime?), Created (DateTime), DateEnd (DateTime?).