Skip to content

Commit 5611c40

Browse files
authored
Merge pull request #15 from altso/custom-attributes
Include custom attributes in ExcelFunctionRegistration
2 parents adbe0b7 + 689371c commit 5611c40

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Source/ExcelRna.Extensions.Hosting/IExcelFunctionsProvider.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ private static bool TryCreateFunctionRegistration(MethodInfo methodInfo, IServic
4646
excelFunctionAttribute.Name ??= lambda.Name;
4747
var parameters = methodInfo.GetParameters().Select(p => new ExcelParameterRegistration(p));
4848
registration = new ExcelFunctionRegistration(lambda, excelFunctionAttribute, parameters);
49+
registration.CustomAttributes.AddRange(methodInfo.GetCustomAttributes(true).Where(a => a is not ExcelFunctionAttribute));
50+
registration.ReturnRegistration.CustomAttributes.AddRange(methodInfo.ReturnParameter.GetCustomAttributes(true));
4951
return true;
5052
}
5153

0 commit comments

Comments
 (0)