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
a406f08e
Commit
a406f08e
authored
Aug 18, 2024
by
Almouhannad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(B) Add validation bases
parent
a7ea84d5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
0 deletions
+34
-0
IValidationResult.cs
...ics.Backend/Domain/Shared/Validation/IValidationResult.cs
+10
-0
ValidationResult.cs
Clinics.Backend/Domain/Shared/Validation/ValidationResult.cs
+12
-0
ValidationResultT.cs
...ics.Backend/Domain/Shared/Validation/ValidationResultT.cs
+12
-0
No files found.
Clinics.Backend/Domain/Shared/Validation/IValidationResult.cs
0 → 100644
View file @
a406f08e
namespace
Domain.Shared.Validation
;
public
interface
IValidationResult
{
public
static
readonly
Error
ValidationError
=
new
(
"ValidationError"
,
"القيم المدخلة غير صالحة"
);
#
region
Properties
Error
[]
Errors
{
get
;
}
#
endregion
}
Clinics.Backend/Domain/Shared/Validation/ValidationResult.cs
0 → 100644
View file @
a406f08e
namespace
Domain.Shared.Validation
;
public
class
ValidationResult
:
Result
,
IValidationResult
{
private
ValidationResult
(
Error
[]
errors
)
:
base
(
false
,
IValidationResult
.
ValidationError
)
=>
Errors
=
errors
;
public
Error
[]
Errors
{
get
;
}
public
static
ValidationResult
WithErrors
(
Error
[]
errors
)
=>
new
(
errors
);
}
Clinics.Backend/Domain/Shared/Validation/ValidationResultT.cs
0 → 100644
View file @
a406f08e
namespace
Domain.Shared.Validation
;
public
class
ValidationResult
<
TValue
>
:
Result
<
TValue
>,
IValidationResult
{
private
ValidationResult
(
Error
[]
errors
)
:
base
(
default
,
false
,
IValidationResult
.
ValidationError
)
=>
Errors
=
errors
;
public
Error
[]
Errors
{
get
;
}
public
static
ValidationResult
<
TValue
>
WithErrors
(
Error
[]
errors
)
=>
new
(
errors
);
}
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