public static async Task <IState> UpdateStateAsync <TModel>( this ResourceConfig <TModel> config, IClient client, IState target, CancellationToken cancellationToken, IShouldProcess shouldProcess, IProgressReport progressReport) where TModel : class { var context = new Context( new StateOperationContext(client, cancellationToken), target, shouldProcess, progressReport, config.GetProgressMap(target)); await context.UpdateStateAsync(config); return(context.Result); }
/// <summary> /// /// </summary> /// <typeparam name="TModel"></typeparam> /// <param name="config">A resource config.</param> /// <param name="client">Management client.</param> /// <param name="target">An Azure target state.</param> /// <param name="cancellationToken">A task cancellation token.</param> /// <param name="shouldProcess">A should process interface.</param> /// <param name="reportTaskProgress">A callback to report task progress.</param> /// <returns></returns> public static async Task <IState> UpdateStateAsync <TModel>( this ResourceConfig <TModel> config, IClient client, IState target, CancellationToken cancellationToken, IShouldProcess shouldProcess, Action <ITaskProgress> reportTaskProgress) where TModel : class { if (target.Get(config) == null) { return(new State()); } var context = new Context( new StateOperationContext(client, cancellationToken), target, shouldProcess, reportTaskProgress, config.GetProgressMap(target)); await context.UpdateStateAsync(config); return(context.Result); }