非常にシンプルな、
[TestMethod]
public void GetAllPatientsWithServices()
{
// Create a PetaPoco database object
var db = new chaosDB("localconnection");
// Calling stored procedure getallpatientswithservices()
var a = db.Fetch<view_patient>("Select * from getallpatientswithservices()");
foreach(var b in a)
{
Console.WriteLine("{0} - {1}", b.cpatient, b.chart_number);
}
}
または、混在ケースのプロシージャ名を持つ:
[TestMethod]
public void GetDxLibrary()
{
// Create a PetaPoco database object
var db = new chaosDB("localconnection");
// Calling stored procedure with mixed case name
var a = db.Fetch<icd9>("Select * from \"GetDxLibrary\"()");
foreach (var b in a)
{
Console.WriteLine("{0} - {1}", b.code,b.cdesc);
}
}