Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
ProjectsStatusManagement
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
hasan.bahjat
ProjectsStatusManagement
Commits
29cc9621
Commit
29cc9621
authored
Aug 11, 2024
by
hasan khaddour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix s.
parent
157eceaa
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
17 deletions
+18
-17
DomainError.cs
PSManagement.SharedKernel/DomainErrors/DomainError.cs
+7
-10
PSManagement.SharedKernel.csproj
PSManagement.SharedKernel/PSManagement.SharedKernel.csproj
+2
-1
BaseSpecification.cs
PSManagement.SharedKernel/Specification/BaseSpecification.cs
+1
-1
Result.cs
PSManagement.SharedKernel/Utilities/Result.cs
+4
-4
ProjectsStatusManagement.sln
ProjectsStatusManagement.sln
+4
-1
No files found.
PSManagement.SharedKernel/DomainErrors/DomainError.cs
View file @
29cc9621
using
FluentResults
;
using
Ardalis.Result
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
...
...
@@ -7,18 +8,14 @@ using System.Threading.Tasks;
namespace
PSManagement.SharedKernel.DomainErrors
{
public
class
DomainError
:
Error
public
class
DomainError
:
Validation
Error
{
public
DomainError
(
string
message
)
:
base
(
message
)
public
DomainError
(
string
errorCode
,
string
errorMessage
)
:
base
(
)
{
this
.
ErrorMessage
=
errorMessage
;
this
.
ErrorCode
=
errorCode
;
}
public
DomainError
(
string
message
,
IError
causedBy
)
:
base
(
message
,
causedBy
)
{
}
protected
DomainError
()
{
}
}
}
PSManagement.SharedKernel/PSManagement.SharedKernel.csproj
View file @
29cc9621
...
...
@@ -5,7 +5,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentResults" Version="3.16.0" />
<PackageReference Include="Ardalis.Result" Version="9.0.0" />
<PackageReference Include="ErrorOr" Version="2.0.1" />
<PackageReference Include="MediatR" Version="8.0.1" />
</ItemGroup>
...
...
PSManagement.SharedKernel/Specification/BaseSpecification.cs
View file @
29cc9621
...
...
@@ -13,7 +13,7 @@ namespace PSManagement.SharedKernel.Specification
{
Criteria
=
criteria
;
}
public
Expression
<
Func
<
T
,
bool
>>
Criteria
{
get
;
}
public
Expression
<
Func
<
T
,
bool
>>
Criteria
{
get
;
set
;
}
public
List
<
Expression
<
Func
<
T
,
object
>>>
Includes
{
get
;
}
=
new
List
<
Expression
<
Func
<
T
,
object
>>>();
public
List
<
string
>
IncludeStrings
{
get
;
}
=
new
List
<
string
>();
public
Expression
<
Func
<
T
,
object
>>
OrderBy
{
get
;
private
set
;
}
...
...
PSManagement.SharedKernel/Utilities/Result.cs
View file @
29cc9621
...
...
@@ -39,15 +39,15 @@ namespace PSManagement.SharedKernel.Utilities
public
static
Result
<
TValue
>
Failure
<
TValue
>(
Error
error
)
=>
new
(
default
,
false
,
error
);
public
static
Result
<
TValue
>
Create
<
TValue
>(
TValue
?
value
)
=>
public
static
Result
<
TValue
>
Create
<
TValue
>(
TValue
value
)
=>
value
is
not
null
?
Success
(
value
)
:
Failure
<
TValue
>(
Error
.
NullValue
);
}
public
class
Result
<
TValue
>
:
Result
{
private
readonly
TValue
?
_value
;
private
readonly
TValue
_value
;
protected
internal
Result
(
TValue
?
value
,
bool
isSuccess
,
Error
error
)
protected
internal
Result
(
TValue
value
,
bool
isSuccess
,
Error
error
)
:
base
(
isSuccess
,
error
)
{
_value
=
value
;
...
...
@@ -58,6 +58,6 @@ namespace PSManagement.SharedKernel.Utilities
?
_value
!
:
throw
new
InvalidOperationException
(
"The value of a failure result can not be accessed."
);
public
static
implicit
operator
Result
<
TValue
>(
TValue
?
value
)
=>
Create
(
value
);
public
static
implicit
operator
Result
<
TValue
>(
TValue
value
)
=>
Create
(
value
);
}
}
ProjectsStatusManagement.sln
View file @
29cc9621
...
...
@@ -41,6 +41,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PSManagement.Infrastructure
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Persistence", "Persistence", "{E40CD9A8-20E3-4D39-992B-F7DA048E3B4C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Services", "Services", "{2FF0133A-7AC6-4346-AEC2-CB5C36939AC7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
...
...
@@ -90,7 +92,7 @@ Global
{1EA4D7A7-EF37-43C4-8704-223CD7F44162} = {A8A58969-B142-4968-982B-16F771A7C805}
{34AD12C1-6312-4F2A-8297-645BC8221C8B} = {F823B488-2A6B-40C0-B332-65C861DA40E3}
{3507E59A-4B8B-4418-B1C6-0AD0C2697959} = {9C4A8DA5-024F-48AD-BD57-37FC8AEBAFA2}
{E96488F4-9D4F-4890-A7A0-1085647C82A8} = {
7C209DBF-1DB8-4E86-BD78-F689B70D5BD1
}
{E96488F4-9D4F-4890-A7A0-1085647C82A8} = {
2FF0133A-7AC6-4346-AEC2-CB5C36939AC7
}
{7C209DBF-1DB8-4E86-BD78-F689B70D5BD1} = {016CB7CA-D962-4D88-BA4F-FE5A94F35C90}
{A8A58969-B142-4968-982B-16F771A7C805} = {016CB7CA-D962-4D88-BA4F-FE5A94F35C90}
{F823B488-2A6B-40C0-B332-65C861DA40E3} = {016CB7CA-D962-4D88-BA4F-FE5A94F35C90}
...
...
@@ -101,6 +103,7 @@ Global
{122442B5-0221-43A7-80A3-555E91699951} = {8EEECA2A-3857-4081-A67C-49B9610FE5AE}
{430FC82E-16C9-453F-92D3-F4E35F52E0F0} = {E40CD9A8-20E3-4D39-992B-F7DA048E3B4C}
{E40CD9A8-20E3-4D39-992B-F7DA048E3B4C} = {7C209DBF-1DB8-4E86-BD78-F689B70D5BD1}
{2FF0133A-7AC6-4346-AEC2-CB5C36939AC7} = {7C209DBF-1DB8-4E86-BD78-F689B70D5BD1}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {5B34709A-AE37-4026-9182-CB9C7ADDEAF5}
...
...
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