public static bool ResolveField(object model, string key, out object target, out PropertyInfo pi)
{
// For now we just lookup properties directly on the model (no depth search)
pi = model.GetType().GetProperty(key);
if (pi!=null)
{
target = model;
return true;
}
// Not found
target = null;
return false;
}