Commit 0aec6304 authored by hasan khaddour's avatar hasan khaddour

update ingredient service

parent 4eeb2db1
...@@ -11,7 +11,7 @@ namespace ApplicationCore.Interfaces.IServices ...@@ -11,7 +11,7 @@ namespace ApplicationCore.Interfaces.IServices
public interface IIngredientService : IService<IngredientModel> public interface IIngredientService : IService<IngredientModel>
{ {
public Task<MedicineIngredientModel> AddToMedicine(MedicineIngredientModel medicineIngredientModel); public Task<MedicineIngredientModel> AddToMedicine(MedicineIngredientModel medicineIngredientModel);
public void RemoveFromMedicine(MedicineIngredientModel medicineIngredientModel); public Task RemoveFromMedicine(MedicineIngredientModel medicineIngredientModel);
} }
} }
...@@ -15,7 +15,9 @@ namespace ApplicationCore.Interfaces.IServices ...@@ -15,7 +15,9 @@ namespace ApplicationCore.Interfaces.IServices
public Task<IEnumerable<MedicalStateModel>> GetPatientMedicalStates(int patientId); public Task<IEnumerable<MedicalStateModel>> GetPatientMedicalStates(int patientId);
public Task<MedicalStateModel> GetMedicalStateDetails(int id); public Task<MedicalStateModel> GetMedicalStateDetails(int id);
public Task<PatientModel> GetByUserEmail(String email ); public Task<PatientModel> GetByUserEmail(String email );
// public Task<IEnumerable<PatientModel>>GetAll(); public Task<PatientModel> GetByUserId(String email);
// public Task<IEnumerable<PatientModel>>GetAll();
public void AddMedicalState(int patientId, MedicalStateModel medicalState); public void AddMedicalState(int patientId, MedicalStateModel medicalState);
// public Patient GetDetails(int id); // public Patient GetDetails(int id);
// public void Insert(PatientModel patient); // public void Insert(PatientModel patient);
......
...@@ -34,7 +34,7 @@ namespace ApplicationCore.Services ...@@ -34,7 +34,7 @@ namespace ApplicationCore.Services
_unitOfWork.Commit(); _unitOfWork.Commit();
return medicineIngredientModel; return medicineIngredientModel;
} }
public async void RemoveFromMedicine(MedicineIngredientModel medicineIngredientModel) public async Task RemoveFromMedicine(MedicineIngredientModel medicineIngredientModel)
{ {
var ingredient = await _unitOfWork.Ingredients.GetById(medicineIngredientModel.IngredientId, _specification); var ingredient = await _unitOfWork.Ingredients.GetById(medicineIngredientModel.IngredientId, _specification);
......
...@@ -66,5 +66,11 @@ namespace ApplicationCore.Services ...@@ -66,5 +66,11 @@ namespace ApplicationCore.Services
return _mapper.Map<PatientModel>(ps.Where(p => p.User.Email == email).FirstOrDefault()); return _mapper.Map<PatientModel>(ps.Where(p => p.User.Email == email).FirstOrDefault());
} }
public async Task<PatientModel> GetByUserId(string id)
{
var ps = await _unitOfWork.Entity.GetAll(_specification);
return _mapper.Map<PatientModel>(ps.Where(p => p.User.Id == id).FirstOrDefault());
}
} }
} }
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