source/TestCommon/source/FunctionApp.TestCommon/EventHub/ResourceProvider/EventHubResourceBuilder.cs
/// <summary>
/// Create event hub according to configured builder.
/// </summary>
/// <returns>Instance with information about the created event hub.</returns>
Create event hub according to configured builder.
Create event hub according to configured builder .
public async Task<EventHubResource> CreateAsync()
        {
            ResourceProvider.TestLogger.WriteLine($"Creating event hub '{EventHubName}'");
            var managementClient = await ResourceProvider.LazyManagementClient
                .ConfigureAwait(false);
            var response = await managementClient.EventHubs
                .CreateOrUpdateAsync(
                    ResourceProvider.ResourceManagementSettings.ResourceGroup,
                    ResourceProvider.EventHubNamespace,
                    EventHubName,
                    CreateEventHubOptions)
                .ConfigureAwait(false);
            var eventHubResource = new EventHubResource(ResourceProvider, response);
            ResourceProvider.EventHubResources.Add(response.Name, eventHubResource);
            foreach (var postAction in PostActions)
            {
                postAction(response);
            }
            return eventHubResource;
        }
public async Task < EventHubResource > CreateAsync ( ) { ResourceProvider . TestLogger . WriteLine ( $" Creating event hub ' { EventHubName } ' " ) ; var managementClient = await ResourceProvider . LazyManagementClient . ConfigureAwait ( false ) ; var response = await managementClient . EventHubs . CreateOrUpdateAsync ( ResourceProvider . ResourceManagementSettings . ResourceGroup , ResourceProvider . EventHubNamespace , EventHubName , CreateEventHubOptions ) . ConfigureAwait ( false ) ; var eventHubResource = new EventHubResource ( ResourceProvider , response ) ; ResourceProvider . EventHubResources . Add ( response . Name , eventHubResource ) ; foreach ( var postAction in PostActions ) { postAction ( response ) ; } return eventHubResource ; }
Create event hub according to configured builder.
Create event hub according to configured builder .
Instance with information about the created event hub.
Instance with information about the created event hub .