Here is the function under test. It runs fine from the app.
public async Task<Dictionary<String, String>> LookupPrices(IOrdersContext context, string productName, DateTime from, DateTime to)
{
var result = new Dictionary<String, String>();
var productSnapshots = await context.Products
.TemporalFromTo(from, to)
.OrderBy(product => EF.Property<DateTime>(product, "PeriodStart"))
.Where(product => product.Name == productName)
.Select(product =>
new
{
Product = product,
PeriodStart = EF.Property<DateTime>(product, "PeriodStart"),
PeriodEnd = EF.Property<DateTime>(product, "PeriodEnd")
})
.ToListAsync();
foreach (var snapshot in productSnapshots)
{
result.Add(snapshot.Product.Name, snapshot.Product.Price.ToString());
}
return result;
}