Example #1
0
 public List <AppointmentToTheDoctorTransaction> GetByDoctorId(string doctorId)
 {
     using (IDbConnection dbConnection = Connection)
     {
         dbConnection.Open();
         return(dbConnection
                .Query <TxInternal>("SELECT * FROM transactions where type == @Type and transaction->>'doctorId' = '@DoctorId';",
                                    new { DoctorId = doctorId, Type = TransactionType.VisitToTheDoctor })
                .Select(tx => TransactionExtensions.Deserialize <AppointmentToTheDoctorTransaction>(tx.Transaction)).ToList());
     }
 }
Example #2
0
 public List <AppointmentToTheDoctorTransaction> GetByUserId(string userId)
 {
     using (IDbConnection dbConnection = Connection)
     {
         dbConnection.Open();
         return(dbConnection
                .Query <TxInternal>("SELECT * FROM transactions where user_id=@UserId and type=@Type",
                                    new TxInternal {
             UserId = userId, Type = TransactionType.VisitToTheDoctor
         })
                .Select(tx => TransactionExtensions.Deserialize <AppointmentToTheDoctorTransaction>(tx.Transaction)).ToList());
     }
 }