/// <summary> /// Create a new audience /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='body'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <object> PostAudienceAsync(this IFeatureManagementAppTierAPI operations, Audience body = default(Audience), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.PostAudienceWithHttpMessagesAsync(body, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
public async Task <IActionResult> Post(Audience audience) { if (audience == null) { return(BadRequest("Audience is required")); } using (IFeatureManagementAppTierAPI api = CreateFeatureManagementApi()) { HttpOperationResponse <object> result = await api.PostAudienceWithHttpMessagesAsync(audience); return(CreateResponse <Audience>(result)); } }