Question:
I’m using Aspose.Words LINQ Reporting Engine and have registered a static helper class:
public static class dt
{
public static string DayOf(object date) => DateTime.Parse(date.ToString()).DayOfWeek.ToString();
public static DateTime GetDate(int y, int m, int d) => new DateTime(y, m, d);
}
In the template, I can call: <<[dt.DayOf("2025-06-12")]>>
Question: Is there any way to simplify this to call without the dt.
prefix,
like: <<[DayOf("2025-06-12")]>>
I’ve already tried:
engine.KnownTypes.Add(typeof(dt));
engine.KnownTypes.Add(typeof(dt), "d");
- Wrapping
dt
inside the data model
All of these still require a prefix (dt.
or d.
).
Is there a supported way to call helper methods directly in the expression without qualifying with the class name?
Thanks in advance!