This example request the current stock quote price for Apple:
public class AppleStock : IPropertyFunction
{
public string Execute(TemplateContext context, IServiceLocator services)
{
var stocks = services.GetInstance<IStockQuoteService>();
var quote = stocks.FindBySymbol("AAPL");
return quote.Price.ToString();
}
}
The code for this example is located in
src/Dovetail.PropertyExtensionExamples/Functions/AppleStock.cs
.