FirelyTeam / spark

Firely and Incendi's open source FHIR server
BSD 3-Clause "New" or "Revised" License
259 stars 166 forks source link

Providing Generics for Read Methods #805

Open ole404 opened 2 weeks ago

ole404 commented 2 weeks ago

It would make interacting with the library a lot easier if one can use generics to Methods like ReadAsyncs. For example when i want to Request a Patient I don't want to type

FhirResponse patResponse = fhirService.ReadAsync(key);
Patient pat = (Patient)patResponse.Resource;

doSomething(pat)

but i could quickly write

patResponse = await fhirService.ReadAsync<Patient>(key);
doSomething(pat.Resource);

It would improve Development experience and Code readibility.

kennethmyhra commented 1 week ago

I like the idea!