Register custom generic method to report designer

Hallo,

I want to register a custom genric method to the report designer control.

public static class Functions
{
    public static T Iif<T>(bool condition, T part1 , T part2) => (condition ? part1: part2);
}  

If i register this method with

RegisteredObjects.AddFunction(..);

ther is an error when I use this method in the report designer

The type or namespace name 'T' could not be found (are you missing a using directive or an assembly reference?)

Why isn't it possible to use the T Type ?

I hope somebody is able to help me with it.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.