Beispiel #1
0
        public Patient GetById(Guid id)
        {
            var document = _bucket.GetDocument <PatientDb>(id.ToString());

            var mapper  = PatientDbMapper.Create();
            var patient = mapper.Map <Patient>(document.Content);

            return(patient);
        }
Beispiel #2
0
        public List <Patient> GetByFilter(params KeyValuePair <string, string>[] criteria)
        {
            var n1ql  = "select g.* from patients g";
            var query = QueryRequest.Create(n1ql);

            var result = _bucket.Query <PatientDb>(query);
            var rowsDb = result.Rows;

            var mapper = PatientDbMapper.Create();

            var patients = mapper.Map <List <Patient> >(rowsDb);

            return(patients);
        }