HelloI've written a CustomMacroMethod, which is returning a class, looking like:public class ReturningObject {
public string Name {get; set;}
public int Id {get; set;}
}
In my CustomMacroMethod, I have the following code:[assembly: RegisterExtension(typeof(CustomContactMacroMethod), typeof(ReturningObject))]
namespace CMSAppAppCode.Old_App_Code
{
public class CustomContactMacroMethod : MacroMethodContainer
{
/// @summary@
/// Function to get the object
/// @/summary@
/// @param name=@context@@@/param@
/// @param name=@parameters@@@/param@
/// @returns@Returns the object@/returns@
[MacroMethod(typeof(ReturningObject), @Returns the current office@, 1)]
[MacroMethodParam(0, @CurrentPage@, typeof(ReturningObject), @The current rendered page@)]
public static ReturningObject GetObject(EvaluationContext context, params object[] parameters)
{
var object = new ReturningObject {
Name = @test@,
Id = 0
};
return object;
}
}
}
When I in Kentico asks for GetObjecc(currentDocument).Name, it returns an empty string.Is there something I do wrong?
↧