| | 1 | | using Fluorite.Strainer.Models.Metadata; |
| | 2 | | using Fluorite.Strainer.Models.Sorting; |
| | 3 | |
|
| | 4 | | namespace Fluorite.Strainer.Models; |
| | 5 | |
|
| | 6 | | /// <summary> |
| | 7 | | /// Represents options used by Strainer. |
| | 8 | | /// </summary> |
| | 9 | | public class StrainerOptions |
| | 10 | | { |
| | 11 | | /// <summary> |
| | 12 | | /// Initializes a new instance of the <see cref="StrainerOptions"/> class. |
| | 13 | | /// </summary> |
| 144 | 14 | | public StrainerOptions() |
| | 15 | | { |
| | 16 | |
|
| 144 | 17 | | } |
| | 18 | |
|
| | 19 | | /// <summary> |
| | 20 | | /// Gets or sets a default page number. |
| | 21 | | /// <para/> |
| | 22 | | /// Defaults to 1. |
| | 23 | | /// </summary> |
| 152 | 24 | | public int DefaultPageNumber { get; set; } = 1; |
| | 25 | |
|
| | 26 | | /// <summary> |
| | 27 | | /// Gets or sets a default page size. |
| | 28 | | /// <para/> |
| | 29 | | /// Defaults to 10. |
| | 30 | | /// </summary> |
| 156 | 31 | | public int DefaultPageSize { get; set; } = 10; |
| | 32 | |
|
| | 33 | | /// <summary> |
| | 34 | | /// Gets or sets a default sorting way used when applying default |
| | 35 | | /// sorting. |
| | 36 | | /// <para/> |
| | 37 | | /// Defaults to <see cref="SortingWay.Ascending"/>. |
| | 38 | | /// </summary> |
| 160 | 39 | | public SortingWay DefaultSortingWay { get; set; } = SortingWay.Ascending; |
| | 40 | |
|
| | 41 | | /// <summary> |
| | 42 | | /// Gets or sets a value indicating whether |
| | 43 | | /// Strainer should operate in case insensitive mode when comparing values. |
| | 44 | | /// <para/> |
| | 45 | | /// This for example affects the way of comparing value of incoming filter |
| | 46 | | /// with actual property value. |
| | 47 | | /// <para/> |
| | 48 | | /// Defaults to <see langword="false"/>. |
| | 49 | | /// </summary> |
| 11 | 50 | | public bool IsCaseInsensitiveForValues { get; set; } = false; |
| | 51 | |
|
| | 52 | | /// <summary> |
| | 53 | | /// Gets or sets a maximum page number. |
| | 54 | | /// <para/> |
| | 55 | | /// Defaults to 50. |
| | 56 | | /// </summary> |
| 162 | 57 | | public int MaxPageSize { get; set; } = 50; |
| | 58 | |
|
| | 59 | | /// <summary> |
| | 60 | | /// Gets or sets the type of sources Strainer will look through |
| | 61 | | /// when obtaining property metadata. |
| | 62 | | /// <para/> |
| | 63 | | /// Note: narrowing down type of metadata source can speed up Strainer |
| | 64 | | /// processing performance. |
| | 65 | | /// <para/> |
| | 66 | | /// Defaults to <see cref="MetadataSourceType.All"/>. |
| | 67 | | /// </summary> |
| 268 | 68 | | public MetadataSourceType MetadataSourceType { get; set; } = MetadataSourceType.All; |
| | 69 | |
|
| | 70 | | /// <summary> |
| | 71 | | /// Gets or sets a value indicating whether |
| | 72 | | /// Strainer should throw <see cref="Exceptions.StrainerException"/> |
| | 73 | | /// and the like. |
| | 74 | | /// <para/> |
| | 75 | | /// Defaults to <see langword="false"/>. |
| | 76 | | /// </summary> |
| 16 | 77 | | public bool ThrowExceptions { get; set; } = false; |
| | 78 | | } |