Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
Medic
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
Medic
Commits
4a4eeb53
Commit
4a4eeb53
authored
Jun 19, 2024
by
hasan khaddour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add domain exceptions and enitiy abstraction
parent
d57d3621
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
71 additions
and
8 deletions
+71
-8
IEntityBase.cs
ApplicationDomain/Abstraction/IEntityBase.cs
+15
-0
IUnitOfWork.cs
ApplicationDomain/Abstraction/IUnitOfWork.cs
+6
-2
EntityBase.cs
ApplicationDomain/Entities/Base/EntityBase.cs
+3
-3
DomainException.cs
ApplicationDomain/Exceptions/Base/DomainException.cs
+3
-3
NotFoundException.cs
ApplicationDomain/Exceptions/NotFoundException.cs
+22
-0
UnAuthorizedException.cs
ApplicationDomain/Exceptions/UnAuthorizedException.cs
+22
-0
No files found.
ApplicationDomain/Abstraction/IEntityBase.cs
0 → 100644
View file @
4a4eeb53
using
System
;
using
System.Collections.Generic
;
using
System.ComponentModel.DataAnnotations.Schema
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
ApplicationDomain.Abstraction
{
public
interface
IEntityBase
<
T
>
{
[
DatabaseGenerated
(
DatabaseGeneratedOption
.
Identity
)]
public
T
Id
{
get
;
set
;
}
}
}
ApplicationDomain/Abstraction/IUnitOfWork.cs
View file @
4a4eeb53
...
...
@@ -7,8 +7,12 @@ namespace ApplicationDomain.Abstraction
{
IGenericRepository
<
T
>
Entity
{
get
;
}
IIngredientRepository
Ingredients
{
get
;
}
IMedicalStateRepository
MedicalStates
{
get
;
}
IPatientRepository
Patients
{
get
;
}
IMedicineRepository
Medicines
{
get
;
}
void
Save
();
void
Commit
();
// void Rollback();
}
}
ApplicationDomain/Entities/Base/EntityBase.cs
View file @
4a4eeb53
using
System
;
using
ApplicationDomain.Abstraction
;
using
System
;
using
System.Collections.Generic
;
using
System.ComponentModel.DataAnnotations
;
using
System.ComponentModel.DataAnnotations.Schema
;
...
...
@@ -8,9 +9,8 @@ using System.Threading.Tasks;
namespace
ApplicationDomain.Entities
{
public
class
EntityBase
public
class
EntityBase
:
IEntityBase
<
int
>
{
[
DatabaseGenerated
(
DatabaseGeneratedOption
.
Identity
)]
public
int
Id
{
get
;
set
;
}
...
...
ApplicationDomain/Exceptions/
Core
Exception.cs
→
ApplicationDomain/Exceptions/
Base/Domain
Exception.cs
View file @
4a4eeb53
...
...
@@ -6,14 +6,14 @@ using System.Threading.Tasks;
namespace
ApplicationDomain.Exceptions
{
public
class
Core
Exception
:
Exception
public
class
Domain
Exception
:
Exception
{
internal
Core
Exception
(
string
businessMessage
)
internal
Domain
Exception
(
string
businessMessage
)
:
base
(
businessMessage
)
{
}
internal
Core
Exception
(
string
message
,
Exception
innerException
)
internal
Domain
Exception
(
string
message
,
Exception
innerException
)
:
base
(
message
,
innerException
)
{
}
...
...
ApplicationDomain/Exceptions/NotFoundException.cs
0 → 100644
View file @
4a4eeb53
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
ApplicationDomain.Exceptions
{
public
class
NotFoundException
:
DomainException
{
public
NotFoundException
()
:
this
(
"Not found"
)
{
}
public
NotFoundException
(
string
message
)
:
base
(
message
)
{
}
}
}
\ No newline at end of file
ApplicationDomain/Exceptions/UnAuthorizedException.cs
0 → 100644
View file @
4a4eeb53
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
ApplicationDomain.Exceptions
{
public
sealed
class
UnAuthorizedException
:
DomainException
{
public
UnAuthorizedException
()
:
this
(
"Not found"
)
{
}
public
UnAuthorizedException
(
string
message
)
:
base
(
message
)
{
}
}
}
\ No newline at end of file
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