| | 1 | | using System.Diagnostics; |
| | 2 | |
|
| | 3 | | namespace Pozitron.QuerySpecification; |
| | 4 | |
|
| | 5 | | internal sealed class SpecLike<T> |
| | 6 | | { |
| | 7 | | public Expression<Func<T, string?>> KeySelector { get; } |
| | 8 | | public string Pattern { get; } |
| | 9 | |
|
| | 10 | | public SpecLike(Expression<Func<T, string?>> keySelector, string pattern) |
| | 11 | | { |
| | 12 | | Debug.Assert(keySelector is not null); |
| | 13 | | Debug.Assert(!string.IsNullOrEmpty(pattern)); |
| | 14 | | KeySelector = keySelector; |
| | 15 | | Pattern = pattern; |
| | 16 | | } |
| | 17 | | } |
| | 18 | |
|
| | 19 | | internal sealed class SpecLikeCompiled<T> |
| | 20 | | { |
| 60 | 21 | | public Func<T, string?> KeySelector { get; } |
| 55 | 22 | | public string Pattern { get; } |
| | 23 | |
|
| 31 | 24 | | public SpecLikeCompiled(Func<T, string?> keySelector, string pattern) |
| | 25 | | { |
| | 26 | | Debug.Assert(keySelector is not null); |
| | 27 | | Debug.Assert(!string.IsNullOrEmpty(pattern)); |
| 31 | 28 | | KeySelector = keySelector; |
| 31 | 29 | | Pattern = pattern; |
| 31 | 30 | | } |
| | 31 | | } |