public static Task <TModel> CreateOrUpdateAsync <TModel>( this ResourceConfig <TModel> config, IClient client, TModel model, CancellationToken cancellationToken) where TModel : class => config.Strategy.CreateOrUpdateAsync( client, CreateOrUpdateAsyncParams.Create( config.GetResourceGroupName(), config.Name, model, cancellationToken));
public static async Task <TModel> GetAsync <TModel>( this ResourceConfig <TModel> config, IClient client, CancellationToken cancellationToken) where TModel : class { try { return(await config.Strategy.GetAsync( client, new GetAsyncParams(config.GetResourceGroupName(), config.Name, cancellationToken))); } catch (CloudException e) when(e.Response.StatusCode == HttpStatusCode.NotFound) { return(null); } }