Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
H
HIAST-Clinics
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
almohanad.hafez
HIAST-Clinics
Commits
22134c5c
Commit
22134c5c
authored
Aug 18, 2024
by
Almouhannad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(B) Reafctor validation bases and add comments
parent
a406f08e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
4 deletions
+16
-4
IValidationResult.cs
...ics.Backend/Domain/Shared/Validation/IValidationResult.cs
+5
-4
ValidationResult.cs
Clinics.Backend/Domain/Shared/Validation/ValidationResult.cs
+6
-0
ValidationResultT.cs
...ics.Backend/Domain/Shared/Validation/ValidationResultT.cs
+5
-0
No files found.
Clinics.Backend/Domain/Shared/Validation/IValidationResult.cs
View file @
22134c5c
...
...
@@ -2,7 +2,8 @@
public
interface
IValidationResult
{
public
static
readonly
Error
ValidationError
=
new
(
"ValidationError"
,
"القيم المدخلة غير صالحة"
);
public
static
readonly
Error
ValidationError
=
new
(
"ValidationError"
,
"القيم المدخلة غير صالحة"
);
#
region
Properties
Error
[]
Errors
{
get
;
}
...
...
Clinics.Backend/Domain/Shared/Validation/ValidationResult.cs
View file @
22134c5c
...
...
@@ -6,7 +6,13 @@ public class ValidationResult : Result, IValidationResult
:
base
(
false
,
IValidationResult
.
ValidationError
)
=>
Errors
=
errors
;
#
region
Properties
public
Error
[]
Errors
{
get
;
}
#
endregion
#
region
Static
factory
public
static
ValidationResult
WithErrors
(
Error
[]
errors
)
=>
new
(
errors
);
#
endregion
}
Clinics.Backend/Domain/Shared/Validation/ValidationResultT.cs
View file @
22134c5c
...
...
@@ -6,7 +6,12 @@ public class ValidationResult<TValue> : Result<TValue>, IValidationResult
:
base
(
default
,
false
,
IValidationResult
.
ValidationError
)
=>
Errors
=
errors
;
#
region
Properties
public
Error
[]
Errors
{
get
;
}
#
endregion
#
region
Static
factory
public
static
ValidationResult
<
TValue
>
WithErrors
(
Error
[]
errors
)
=>
new
(
errors
);
#
endregion
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment