Is it possible to do the following (If so I can\'t seem to get it working.. forgoing constraints for the moment)...
If the type (because it\'s ommitted) is inferred,
If you can't get make an interface for your type (or a common one between several types):
private void GetGenericTableContant(ref StringBuilder outputTableContent, T item, Func lineNumberAccessor)
{
outputTableContent.Append("" + lineNumberAccessor(item) + " ");
}
Usage:
GetGenericTableContent(ref outputTableContent, item, x => x.SpreadsheetLineNumbers);
(Or you could just pass the SpreadSheetLineNumbers property if you don't really need the item reference in your method: void GetGenericTableContant)