Very simple,
[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);
}
}
Or, with a mixed-case procedure name:
[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);
}
}