|
1 | 1 | using System; |
2 | | -using System.Reflection; |
3 | 2 | using JsonApiDotNetCore.Internal; |
4 | 3 |
|
5 | 4 | namespace JsonApiDotNetCore.Models |
6 | 5 | { |
7 | 6 | public class AttrAttribute : Attribute |
8 | 7 | { |
9 | | - public AttrAttribute(string publicName, bool isImmutable = false) |
| 8 | + public AttrAttribute(string publicName, bool isImmutable = false, bool isFilterable = true, bool isSortable = true) |
10 | 9 | { |
11 | 10 | PublicAttributeName = publicName; |
12 | 11 | IsImmutable = isImmutable; |
| 12 | + IsFilterable = isFilterable; |
| 13 | + IsSortable = isSortable; |
13 | 14 | } |
14 | 15 |
|
15 | | - public AttrAttribute(string publicName, string internalName, bool isImmutable = false) |
| 16 | + internal AttrAttribute(string publicName, string internalName, bool isImmutable = false) |
16 | 17 | { |
17 | 18 | PublicAttributeName = publicName; |
18 | 19 | InternalAttributeName = internalName; |
19 | 20 | IsImmutable = isImmutable; |
20 | 21 | } |
21 | 22 |
|
22 | | - public string PublicAttributeName { get; set; } |
23 | | - public string InternalAttributeName { get; set; } |
24 | | - public bool IsImmutable { get; set; } |
| 23 | + public string PublicAttributeName { get; } |
| 24 | + public string InternalAttributeName { get; } |
| 25 | + public bool IsImmutable { get; } |
| 26 | + public bool IsFilterable { get; } |
| 27 | + public bool IsSortable { get; } |
25 | 28 |
|
26 | 29 | public object GetValue(object entity) |
27 | 30 | { |
|
0 commit comments