Commit ae1463e6 authored by hasan khaddour's avatar hasan khaddour

add exception core

parent 9eece958
...@@ -7,6 +7,7 @@ namespace ApplicationDomain.Abstraction ...@@ -7,6 +7,7 @@ namespace ApplicationDomain.Abstraction
{ {
IGenericRepository<T> Entity { get; } IGenericRepository<T> Entity { get; }
void Save(); void Save();
} }
......
...@@ -17,8 +17,4 @@ ...@@ -17,8 +17,4 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="Exceptions\" />
</ItemGroup>
</Project> </Project>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApplicationDomain.Exceptions
{
public class CoreException : Exception
{
internal CoreException(string businessMessage)
: base(businessMessage)
{
}
internal CoreException(string message, Exception innerException)
: base(message, innerException)
{
}
}
}
using ApplicationDomain.Entities;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace ApplicationDomain.Repositories
{
public interface IIngredientRepository : IGenericRepository<Ingredient>
{
public Task<IEnumerable<Ingredient>> GetByName(string Name);
}
}
...@@ -12,5 +12,4 @@ namespace ApplicationDomain.Repositories ...@@ -12,5 +12,4 @@ namespace ApplicationDomain.Repositories
{ {
public Task<IEnumerable<Medicine>> GetByMedicalState(int medicalStateId ); public Task<IEnumerable<Medicine>> GetByMedicalState(int medicalStateId );
} }
} }
using ApplicationDomain.Entities;
using System.Threading.Tasks;
namespace ApplicationDomain.Repositories
{
public interface IPatientRepository : IGenericRepository<Patient>
{
public Task<Patient> GetByUserId(string userId);
}
}
...@@ -8,10 +8,10 @@ using System.Threading.Tasks; ...@@ -8,10 +8,10 @@ using System.Threading.Tasks;
namespace ApplicationDomain.Specification namespace ApplicationDomain.Specification
{ {
public class IngredientSpecification : BaseSpecification<Ingredient> public class IngredientWithMedicinesSpecification : BaseSpecification<Ingredient>
{ {
public IngredientSpecification() public IngredientWithMedicinesSpecification()
{ {
AddInclude(p => p.MedicineIngredients); AddInclude(p => p.MedicineIngredients);
......
...@@ -9,10 +9,10 @@ using System.Threading.Tasks; ...@@ -9,10 +9,10 @@ using System.Threading.Tasks;
namespace ApplicationDomain.Specification namespace ApplicationDomain.Specification
{ {
public class MedicalStateSpecification : BaseSpecification<MedicalState> public class MedicalStateWithMedicinesSpecification : BaseSpecification<MedicalState>
{ {
public MedicalStateSpecification(Expression<Func<MedicalState, bool>> criteria =null) public MedicalStateWithMedicinesSpecification(Expression<Func<MedicalState, bool>> criteria =null)
:base(criteria) :base(criteria)
{ {
......
...@@ -8,10 +8,10 @@ using System.Threading.Tasks; ...@@ -8,10 +8,10 @@ using System.Threading.Tasks;
namespace ApplicationDomain.Specification namespace ApplicationDomain.Specification
{ {
public class MedicineIngredientSpecification : BaseSpecification<Medicine> public class MedicineWithIngredientsSpecification : BaseSpecification<Medicine>
{ {
public MedicineIngredientSpecification( ) public MedicineWithIngredientsSpecification( )
{ {
AddInclude(p => p.MedicineIngredients); AddInclude(p => p.MedicineIngredients);
......
...@@ -8,9 +8,9 @@ using System.Threading.Tasks; ...@@ -8,9 +8,9 @@ using System.Threading.Tasks;
namespace ApplicationDomain.Specification namespace ApplicationDomain.Specification
{ {
public class PatientMedicinesSpecification : BaseSpecification<Patient> public class PatientWithMedicinesSpecification : BaseSpecification<Patient>
{ {
public PatientMedicinesSpecification() public PatientWithMedicinesSpecification()
{ {
AddInclude(p => p.MedicalStates); AddInclude(p => p.MedicalStates);
AddInclude(p => p.User); AddInclude(p => p.User);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment