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
fdc4e589
Commit
fdc4e589
authored
Jun 16, 2024
by
hasan khaddour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add specified repositories
parent
ae1463e6
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
63 additions
and
6 deletions
+63
-6
IngredientRepository.cs
Infrastructure/Repository/IngredientRepository.cs
+30
-0
MedicineRepository.cs
Infrastructure/Repository/MedicineRepository.cs
+3
-3
PatientRepository.cs
Infrastructure/Repository/PatientRepository.cs
+27
-0
Infrastructure.csproj.AssemblyReference.cache
...ebug/net5.0/Infrastructure.csproj.AssemblyReference.cache
+0
-0
Infrastructure.csproj.CoreCompileInputs.cache
...ebug/net5.0/Infrastructure.csproj.CoreCompileInputs.cache
+1
-1
Infrastructure.csproj.FileListAbsolute.txt
...j/Debug/net5.0/Infrastructure.csproj.FileListAbsolute.txt
+2
-2
Infrastructure.dll
Infrastructure/obj/Debug/net5.0/Infrastructure.dll
+0
-0
Infrastructure.pdb
Infrastructure/obj/Debug/net5.0/Infrastructure.pdb
+0
-0
No files found.
Infrastructure/Repository/IngredientRepository.cs
0 → 100644
View file @
fdc4e589
using
ApplicationDomain.Entities
;
using
ApplicationDomain.Repositories
;
using
ApplicationDomain.Specification
;
using
Microsoft.EntityFrameworkCore
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
namespace
Infrastructure.Repository
{
public
class
IngredientRepository
:
GenericRepository
<
Ingredient
>,
IIngredientRepository
{
public
IngredientRepository
(
DbContext
dbContext
)
:
base
(
dbContext
)
{
}
public
async
Task
<
IEnumerable
<
Ingredient
>>
GetByName
(
String
Name
)
{
var
spec
=
new
IngredientWithMedicinesSpecification
();
spec
.
Criteria
=
p
=>
p
.
Name
==
Name
;
IQueryable
<
Ingredient
>
queryable
=
_table
;
queryable
=
GetQuery
(
queryable
,
spec
);
return
await
queryable
.
ToListAsync
();
}
}
}
Infrastructure/Repository/MedicineRepository.cs
View file @
fdc4e589
using
ApplicationDomain.Entities
;
using
ApplicationDomain.Abstraction
;
using
ApplicationDomain.Entities
;
using
ApplicationDomain.Repositories
;
using
ApplicationDomain.Repositories
;
using
ApplicationDomain.Specification
;
using
ApplicationDomain.Specification
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
...
@@ -18,7 +18,7 @@ namespace Infrastructure.Repository
...
@@ -18,7 +18,7 @@ namespace Infrastructure.Repository
public
Task
<
IEnumerable
<
Medicine
>>
GetByMedicalState
(
int
medicalStateId
)
public
Task
<
IEnumerable
<
Medicine
>>
GetByMedicalState
(
int
medicalStateId
)
{
{
var
spec
=
new
Medicine
Ingredient
Specification
();
var
spec
=
new
Medicine
WithIngredients
Specification
();
spec
.
Criteria
=
p
=>
p
.
MedicalStates
.
All
(
s
=>
s
.
Id
==
medicalStateId
);
spec
.
Criteria
=
p
=>
p
.
MedicalStates
.
All
(
s
=>
s
.
Id
==
medicalStateId
);
...
...
Infrastructure/Repository/PatientRepository.cs
0 → 100644
View file @
fdc4e589
using
ApplicationDomain.Entities
;
using
ApplicationDomain.Repositories
;
using
ApplicationDomain.Specification
;
using
Microsoft.EntityFrameworkCore
;
using
System.Linq
;
using
System.Threading.Tasks
;
namespace
Infrastructure.Repository
{
public
class
PatientRepository
:
GenericRepository
<
Patient
>,
IPatientRepository
{
public
PatientRepository
(
DbContext
dbContext
)
:
base
(
dbContext
)
{
}
public
async
Task
<
Patient
>
GetByUserId
(
string
userId
)
{
var
spec
=
new
PatientWithMedicinesSpecification
();
spec
.
Criteria
=
p
=>
p
.
User
.
Id
==
userId
;
IQueryable
<
Patient
>
queryable
=
_table
;
queryable
=
GetQuery
(
queryable
,
spec
);
return
await
queryable
.
FirstOrDefaultAsync
();
}
}
}
Infrastructure/obj/Debug/net5.0/Infrastructure.csproj.AssemblyReference.cache
View file @
fdc4e589
No preview for this file type
Infrastructure/obj/Debug/net5.0/Infrastructure.csproj.CoreCompileInputs.cache
View file @
fdc4e589
35cbfd0c81bb22b7edd15e31ee71ff49ee100adb
ba80f8fbd17b5cd8f1231031e8a9c92aca903458
Infrastructure/obj/Debug/net5.0/Infrastructure.csproj.FileListAbsolute.txt
View file @
fdc4e589
...
@@ -5,7 +5,9 @@ C:\Users\HASAN\Desktop\Medic\Infrastructure\bin\Debug\net5.0\Infrastructure.dll
...
@@ -5,7 +5,9 @@ C:\Users\HASAN\Desktop\Medic\Infrastructure\bin\Debug\net5.0\Infrastructure.dll
C:\Users\HASAN\Desktop\Medic\Infrastructure\bin\Debug\net5.0\ref\Infrastructure.dll
C:\Users\HASAN\Desktop\Medic\Infrastructure\bin\Debug\net5.0\ref\Infrastructure.dll
C:\Users\HASAN\Desktop\Medic\Infrastructure\bin\Debug\net5.0\Infrastructure.pdb
C:\Users\HASAN\Desktop\Medic\Infrastructure\bin\Debug\net5.0\Infrastructure.pdb
C:\Users\HASAN\Desktop\Medic\Infrastructure\bin\Debug\net5.0\ApplicationCore.dll
C:\Users\HASAN\Desktop\Medic\Infrastructure\bin\Debug\net5.0\ApplicationCore.dll
C:\Users\HASAN\Desktop\Medic\Infrastructure\bin\Debug\net5.0\ApplicationDomain.dll
C:\Users\HASAN\Desktop\Medic\Infrastructure\bin\Debug\net5.0\ApplicationCore.pdb
C:\Users\HASAN\Desktop\Medic\Infrastructure\bin\Debug\net5.0\ApplicationCore.pdb
C:\Users\HASAN\Desktop\Medic\Infrastructure\bin\Debug\net5.0\ApplicationDomain.pdb
C:\Users\HASAN\Desktop\Medic\Infrastructure\obj\Debug\net5.0\Infrastructure.csproj.AssemblyReference.cache
C:\Users\HASAN\Desktop\Medic\Infrastructure\obj\Debug\net5.0\Infrastructure.csproj.AssemblyReference.cache
C:\Users\HASAN\Desktop\Medic\Infrastructure\obj\Debug\net5.0\Infrastructure.GeneratedMSBuildEditorConfig.editorconfig
C:\Users\HASAN\Desktop\Medic\Infrastructure\obj\Debug\net5.0\Infrastructure.GeneratedMSBuildEditorConfig.editorconfig
C:\Users\HASAN\Desktop\Medic\Infrastructure\obj\Debug\net5.0\Infrastructure.AssemblyInfoInputs.cache
C:\Users\HASAN\Desktop\Medic\Infrastructure\obj\Debug\net5.0\Infrastructure.AssemblyInfoInputs.cache
...
@@ -16,5 +18,3 @@ C:\Users\HASAN\Desktop\Medic\Infrastructure\obj\Debug\net5.0\Infrastructure.dll
...
@@ -16,5 +18,3 @@ C:\Users\HASAN\Desktop\Medic\Infrastructure\obj\Debug\net5.0\Infrastructure.dll
C:\Users\HASAN\Desktop\Medic\Infrastructure\obj\Debug\net5.0\ref\Infrastructure.dll
C:\Users\HASAN\Desktop\Medic\Infrastructure\obj\Debug\net5.0\ref\Infrastructure.dll
C:\Users\HASAN\Desktop\Medic\Infrastructure\obj\Debug\net5.0\Infrastructure.pdb
C:\Users\HASAN\Desktop\Medic\Infrastructure\obj\Debug\net5.0\Infrastructure.pdb
C:\Users\HASAN\Desktop\Medic\Infrastructure\obj\Debug\net5.0\Infrastructure.genruntimeconfig.cache
C:\Users\HASAN\Desktop\Medic\Infrastructure\obj\Debug\net5.0\Infrastructure.genruntimeconfig.cache
C:\Users\HASAN\Desktop\Medic\Infrastructure\bin\Debug\net5.0\ApplicationDomain.dll
C:\Users\HASAN\Desktop\Medic\Infrastructure\bin\Debug\net5.0\ApplicationDomain.pdb
Infrastructure/obj/Debug/net5.0/Infrastructure.dll
View file @
fdc4e589
No preview for this file type
Infrastructure/obj/Debug/net5.0/Infrastructure.pdb
View file @
fdc4e589
No preview for this file type
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