1
- // Copyright (C) 2013-2021 Xtensive LLC.
1
+ // Copyright (C) 2013-2022 Xtensive LLC.
2
2
// This code is distributed under MIT license terms.
3
3
// See the License.txt file in the project root for more information.
4
4
// Created by: Denis Krjuchkov
@@ -15,51 +15,20 @@ namespace Xtensive.Orm.Validation
15
15
/// </summary>
16
16
public abstract class PropertyValidator : Attribute , IPropertyValidator
17
17
{
18
- private bool isImmediate ;
19
- private bool validateOnlyIfModified ;
20
- private bool skipOnTransactionCommiting ;
21
-
22
18
/// <summary>
23
19
/// Gets or sets value indicating if current validator is immediate.
24
20
/// </summary>
25
- public bool IsImmediate
26
- {
27
- get => isImmediate ;
28
- init {
29
- if ( Domain != null ) {
30
- throw Exceptions . AlreadyInitialized ( null ) ;
31
- }
32
- isImmediate = value ;
33
- }
34
- }
21
+ public bool IsImmediate { get ; init ; }
35
22
36
23
/// <summary>
37
24
/// Gets or sets value indicating wheteher validation should continue only if field value has changed.
38
25
/// </summary>
39
- public bool ValidateOnlyIfModified
40
- {
41
- get => validateOnlyIfModified ;
42
- init {
43
- if ( Domain != null ) {
44
- throw Exceptions . AlreadyInitialized ( null ) ;
45
- }
46
- validateOnlyIfModified = value ;
47
- }
48
- }
26
+ public bool ValidateOnlyIfModified { get ; init ; }
49
27
50
28
/// <summary>
51
29
/// Gets or sets value indicating if current validator should be skipped on a transaction commit.
52
30
/// </summary>
53
- public bool SkipOnTransactionCommit
54
- {
55
- get => skipOnTransactionCommiting ;
56
- init {
57
- if ( Domain != null ) {
58
- throw Exceptions . AlreadyInitialized ( null ) ;
59
- }
60
- skipOnTransactionCommiting = value ;
61
- }
62
- }
31
+ public bool SkipOnTransactionCommit { get ; init ; }
63
32
64
33
/// <summary>
65
34
/// Gets domain this instance is bound to.
0 commit comments