-
Notifications
You must be signed in to change notification settings - Fork 3
Add support for FunctionsApplicationBuilder #685
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ec04e93
to
d1dfe23
Compare
public static Microsoft.Extensions.Hosting.IHostApplicationBuilder AddNServiceBus(this Microsoft.Extensions.Hosting.IHostApplicationBuilder builder, string endpointName, System.Action<Microsoft.Extensions.Configuration.IConfiguration, NServiceBus.ServiceBusTriggeredEndpointConfiguration> configurationFactory) { } | ||
public static Microsoft.Extensions.Hosting.IHostApplicationBuilder AddNServiceBus(this Microsoft.Extensions.Hosting.IHostApplicationBuilder builder, string endpointName, string connectionString, System.Action<Microsoft.Extensions.Configuration.IConfiguration, NServiceBus.ServiceBusTriggeredEndpointConfiguration> configurationFactory) { } | ||
public static Microsoft.Extensions.Hosting.IHostApplicationBuilder AddNServiceBus(this Microsoft.Extensions.Hosting.IHostApplicationBuilder builder, string endpointName, string connectionString = null, System.Action<NServiceBus.ServiceBusTriggeredEndpointConfiguration> configurationFactory = null) { } | ||
public sealed class <G>$605D8CCF64349EA050C790D67C500BD9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment: I know this is not part of your implementation, but it is a bummer that it adds a hashed value here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What you're seeing there is that PublicApiGenerator doesn't yet have support for displaying C# 14 extensions in a more "expected" way, so it's showing the underlying implementation details of how the new extensions were implemented in the compiler so that the resulting assembly is still compatible with older compilers.
/// <summary> | ||
/// Configures an NServiceBus endpoint that can be injected into a function trigger as a <see cref="IFunctionEndpoint"/> via dependency injection. | ||
/// </summary> | ||
public IHostApplicationBuilder AddNServiceBus(Action<IConfiguration, ServiceBusTriggeredEndpointConfiguration> configurationFactory) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: I know again you didn't directly wrote this, but do you happen to know why on some of the extensions we set the default value of configurationFactory to null? I expected for all to have the start value or none of them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't know the reasoning, but it appears that the Action<ServiceBusTriggeredEndpointConfiguration>
parameters have a default value, and the Action<IConfiguration, ServiceBusTriggeredEndpointConfiguration>
parameters don't.
This PR adds support for
FunctionsApplicationBuilder
by addingAddNServiceBus
extensions methods forIHostApplicationBuilder
.Note
The previous
IHostBuilder
extension methods are namedUseNServiceBus
, butAdd
seems to be the more correct pattern to follow at this point, so the I decided to useAdd
for the new methods instead keeping it consistent.