diff --git a/Source/ExcelRna.Extensions.Hosting/IExcelFunctionsProvider.cs b/Source/ExcelRna.Extensions.Hosting/IExcelFunctionsProvider.cs index c456326..94b85d0 100644 --- a/Source/ExcelRna.Extensions.Hosting/IExcelFunctionsProvider.cs +++ b/Source/ExcelRna.Extensions.Hosting/IExcelFunctionsProvider.cs @@ -46,6 +46,8 @@ private static bool TryCreateFunctionRegistration(MethodInfo methodInfo, IServic excelFunctionAttribute.Name ??= lambda.Name; var parameters = methodInfo.GetParameters().Select(p => new ExcelParameterRegistration(p)); registration = new ExcelFunctionRegistration(lambda, excelFunctionAttribute, parameters); + registration.CustomAttributes.AddRange(methodInfo.GetCustomAttributes(true).Where(a => a is not ExcelFunctionAttribute)); + registration.ReturnRegistration.CustomAttributes.AddRange(methodInfo.ReturnParameter.GetCustomAttributes(true)); return true; }