This question is locked. New answers and comments are not allowed.
I'd like to embed fieldnames in a template document to be parsed in at runtime for said fieldnames. The result would be a document with all the fieldnames replaced by the corresponding data for the currently selected records.
Ie., for HTML there would be something like
in the template document.
Using Regex, I'll pull out "Customer.Name". I've looked at Customer.FieldValue<string>("Name"); but I think Customer.Select("c => c.Name") will let me use dynamic binding to avoid trying to find the type of the field and simply .ToString() on the var.
Is there any way to use the "Customer" portion of the string to select the correct object/table to use? I'd rather not have to put if clauses into the post parser:
if (tname == "Customer")
var fvalue = Customer.Select("c => c."+fname);
perhaps something like
var fvalue = dbModel.GetTable(tname).Select("c => c."+fname);
Ie., for HTML there would be something like
...<td>$Customer.Name$</td>...in the template document.
Using Regex, I'll pull out "Customer.Name". I've looked at Customer.FieldValue<string>("Name"); but I think Customer.Select("c => c.Name") will let me use dynamic binding to avoid trying to find the type of the field and simply .ToString() on the var.
Is there any way to use the "Customer" portion of the string to select the correct object/table to use? I'd rather not have to put if clauses into the post parser:
if (tname == "Customer")
var fvalue = Customer.Select("c => c."+fname);
perhaps something like
var fvalue = dbModel.GetTable(tname).Select("c => c."+fname);