Skip to content

Commit

Permalink
Include custom attributes in ExcelFunctionRegistration
Browse files Browse the repository at this point in the history
  • Loading branch information
altso authored Feb 16, 2022
1 parent adbe0b7 commit 689371c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Source/ExcelRna.Extensions.Hosting/IExcelFunctionsProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 689371c

Please sign in to comment.