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
f2d225d8
Commit
f2d225d8
authored
Jul 26, 2024
by
hasan khaddour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor shared kernell
parent
c26e64c8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
+17
-4
IDomainEvent.cs
PSManagement.SharedKernel/DomainEvents/IDomainEvent.cs
+11
-0
BaseEntity.cs
PSManagement.SharedKernel/Entities/BaseEntity.cs
+6
-4
No files found.
PSManagement.SharedKernel/DomainEvents/
Base
DomainEvent.cs
→
PSManagement.SharedKernel/DomainEvents/
I
DomainEvent.cs
View file @
f2d225d8
...
...
@@ -3,9 +3,9 @@ using System;
namespace
PSManagement.SharedKernel.Events
{
public
abstract
class
Base
DomainEvent
:
INotification
public
interface
I
DomainEvent
:
INotification
{
public
DateTime
DateOccurred
{
get
;
protected
set
;
}
=
DateTime
.
UtcNow
;
public
DateTime
DateOccurred
{
get
;
set
;
}
}
}
PSManagement.SharedKernel/Entities/BaseEntity.cs
View file @
f2d225d8
using
PSManagement.SharedKernel.Events
;
using
System.Collections.Generic
;
using
System.ComponentModel.DataAnnotations.Schema
;
namespace
PSManagement.SharedKernel.Entities
{
public
class
BaseEntity
{
[
DatabaseGenerated
(
DatabaseGeneratedOption
.
Identity
)]
public
int
Id
{
get
;
set
;
}
public
List
<
BaseDomainEvent
>
Events
=
new
List
<
BaseDomainEvent
>
();
public
List
<
IDomainEvent
>
Events
=
new
();
public
void
AddDomainEvent
(
Base
DomainEvent
eventItem
)
public
void
AddDomainEvent
(
I
DomainEvent
eventItem
)
{
Events
=
Events
??
new
List
<
Base
DomainEvent
>();
Events
??=
new
List
<
I
DomainEvent
>();
Events
.
Add
(
eventItem
);
}
public
void
RemoveDomainEvent
(
Base
DomainEvent
eventItem
)
public
void
RemoveDomainEvent
(
I
DomainEvent
eventItem
)
{
Events
?.
Remove
(
eventItem
);
}
...
...
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