Working With Range
You may want to search a range like between two DateTimes or numbers.
- The Model is same as previous sample:
- Just use following
Range<T>
type in your DTO:
WARNING: Do not use nullable types as generic type parameter in Range<T>
. Use same type with your entity. If your property is already nullable in entity, it's ok. Just use same type with model with Range
Now, querystring is changed a little bit. Try following requests:
/Blogs?Priority.Min=4
/Blogs?Priority.Min=3&Priority.Max=5
/Blogs?PublishDate.Max=01.05.2019
// Depends on CultureInfo. If you're using Request Localization, each client must send by its own datetime format