| | 1 | | namespace Pozitron.QuerySpecification; |
| | 2 | |
|
| | 3 | | public class IncludeExpression |
| | 4 | | { |
| 65 | 5 | | public LambdaExpression LambdaExpression { get; } |
| 61 | 6 | | public Type EntityType { get; } |
| 61 | 7 | | public Type PropertyType { get; } |
| 34 | 8 | | public Type? PreviousPropertyType { get; } |
| 239 | 9 | | public IncludeTypeEnum Type { get; } |
| | 10 | |
|
| 115 | 11 | | private IncludeExpression( |
| 115 | 12 | | LambdaExpression expression, |
| 115 | 13 | | Type entityType, |
| 115 | 14 | | Type propertyType, |
| 115 | 15 | | Type? previousPropertyType, |
| 115 | 16 | | IncludeTypeEnum includeType) |
| | 17 | |
|
| | 18 | | { |
| 115 | 19 | | ArgumentNullException.ThrowIfNull(expression); |
| 114 | 20 | | ArgumentNullException.ThrowIfNull(entityType); |
| 113 | 21 | | ArgumentNullException.ThrowIfNull(propertyType); |
| | 22 | |
|
| 112 | 23 | | if (includeType == IncludeTypeEnum.ThenInclude) |
| | 24 | | { |
| 52 | 25 | | ArgumentNullException.ThrowIfNull(previousPropertyType); |
| | 26 | | } |
| | 27 | |
|
| 111 | 28 | | LambdaExpression = expression; |
| 111 | 29 | | EntityType = entityType; |
| 111 | 30 | | PropertyType = propertyType; |
| 111 | 31 | | PreviousPropertyType = previousPropertyType; |
| 111 | 32 | | Type = includeType; |
| 111 | 33 | | } |
| | 34 | |
|
| | 35 | | public IncludeExpression( |
| | 36 | | LambdaExpression expression, |
| | 37 | | Type entityType, |
| | 38 | | Type propertyType) |
| 63 | 39 | | : this(expression, entityType, propertyType, null, IncludeTypeEnum.Include) |
| | 40 | | { |
| 60 | 41 | | } |
| | 42 | |
|
| | 43 | | public IncludeExpression( |
| | 44 | | LambdaExpression expression, |
| | 45 | | Type entityType, |
| | 46 | | Type propertyType, |
| | 47 | | Type previousPropertyType) |
| 52 | 48 | | : this(expression, entityType, propertyType, previousPropertyType, IncludeTypeEnum.ThenInclude) |
| | 49 | | { |
| 51 | 50 | | } |
| | 51 | | } |