Skip to content

Commit

Permalink
Merge pull request #15 from altso/custom-attributes
Browse files Browse the repository at this point in the history
Include custom attributes in ExcelFunctionRegistration
  • Loading branch information
altso authored Feb 16, 2022
2 parents adbe0b7 + 689371c commit 5611c40
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 5611c40

Please sign in to comment.