Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public class CustomTypedFactoryComponentSelector : DefaultTypedFactoryComponentSelector
{
protected override string GetComponentName(System.Reflection.MethodInfo method, object[] arguments)
{
if (method.Name == "Create" && arguments.Length == 4 && arguments[0] is int)
{
if (Convert.ToInt32(arguments[0]) > 0)
{
return "ErrorResult";
}
return "CreateReportResult";
}
return base.GetComponentName(method, arguments);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment