Esempio n. 1
0
 /// <summary>
 /// Get the treatments history of a client with specified id.
 /// </summary>
 /// <returns>The treatments history.</returns>
 /// <param name="id">Identifier.</param>
 public IEnumerable <ClientHistoryViewModel> GetTreatmentsHistory(Guid id)
 {
     return(_context.TreatmentsHistory.Where(x => x.Client_id == id)
            .Select(x => new ClientHistoryViewModel()
     {
         ClientId = x.Client_id,
         Treatment = _treatmentRepository.Get(x.Treatment_id),
         ThisStay = x.This_stay == 0 ? false : true,
         IsDone = x.Is_done == 0 ? false : true
     }));
 }