You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Any custom attributes applied to the method wrapped as a KernelFunction should be available on the Metadata property (e.g., in ASP.NET it's common to use the Authorize attribute for authorization scenarios, the same concept could be applied here and validated in a custom function filter).
The text was updated successfully, but these errors were encountered:
github-actionsbot
changed the title
New Feature: Expose any custom attributes on the underlying function method
.Net: New Feature: Expose any custom attributes on the underlying function method
Aug 26, 2024
@anthonypuppo - good idea. Do you have more scenarios that you are looking into?
The attributes from System.ComponentModel.DataAnnotations (i.e., parameter validation) is another use case that comes to mind. This would involve extracting attributes off the arguments and not just the method itself though.
Lots of different use cases here, especially when combined with filters. You can essentially create your own custom execution pipeline with attributes acting as behavior flags (similar to how the ASP.NET middleware works).
Any custom attributes applied to the method wrapped as a
KernelFunction
should be available on theMetadata
property (e.g., in ASP.NET it's common to use theAuthorize
attribute for authorization scenarios, the same concept could be applied here and validated in a custom function filter).The text was updated successfully, but these errors were encountered: