- Added core support for Microsoft.Extensions.Configuration and Microsoft.Extensions.DependencyInjection.
- Added
JsonModel<T>abstract base class that provides a simplified way to implementIJsonModel<T>for JSON serialization and deserialization.
- Fixed an issue with
ClientRetryPolicywhere delays were being calculated using the retry count instead of the attempt count, causing the initial retry to occur without delay and subsequent retries to be performed more quickly than intended.
- Fixed an issue with JsonPatch.TryGetValue throwing instead of returning false in some cases.
- Fixed an issue with JsonPatch decoding special characters in json when using GetString.
- Added
ClientRequestIdproperty toPipelineRequestwhich exposes the value that is used in logging and distributed tracing.
-
Added
ClientConnectionconstructor, accepting credentials and metadata. -
Added
JsonPatchwhich allows for applying JSON Patch operations to JSON documents.
- Fix the behavior of Roslyn not properly handling partial classes with attributes in different files
- Added
UserAgentPolicypipeline policy to allow adding the user agent to the request headers.
- Various updates to the
System.ClientModel.SourceGenerationpackage to supportModelReaderWriterBuildableAttribute.
- Fixed an issue where System.ClientModel.SourceGeneration was running slowly for large projects with many dependencies.
- The System.ClientModel.SourceGeneration used to auto-discover
IJsonModel<T>'s that were in the project as well as any typesTused inModelReaderWriter.Read<T>andModelReaderWriter.Write<T>. Now you must explicitly add aModelReaderWriterBuildableAttributewith each type that needs to have AOT friendly reading and writing.
- Added the following types for 3rd-party Authentication support:
AuthenticationTokenProvider,GetTokenOptions,AuthenticationToken,AuthenticationPolicy, andBearerTokenPolicy.
- Source Breaking Change: Updated
IJsonModel<T>.CreateandIPersistableModel<T>.Createmethod return types fromTtoT?to allow returningnullwhen deserialization fails. This change only affects code with nullable reference types enabled.- For consumers calling these methods: To fix compilation errors, either:
- Use null-conditional operators (
?.) when calling these methods, or - Add null-forgiving operators (
!) if you're certain the result won't be null, or - Add explicit null checks before using the returned value
- Use null-conditional operators (
- For implementers of these interfaces: Update method signatures in your models to return
T?instead ofT, and decide whether to returnnullor throw exceptions in error scenarios
- For consumers calling these methods: To fix compilation errors, either:
- Added the following types for 3rd-party Authentication support:
AuthenticationTokenProvider,GetTokenOptions,AuthenticationToken,AuthenticationPolicy, andBearerTokenPolicy.
- First part of performance improvements for System.ClientModel.SourceGeneration to shorten lengthy builds.
- Fixed an issue when a model builder was both IEnumerable and IPersistable.
- Added additional supported scenarios to System.ClientModel.SourceGeneration.
- Upgraded versions of dependencies on System.Diagnostics.DiagnosticSource, System.Text.Json, and Microsoft.Extensions.Logging.Abstractions.
- Renamed
ActivityExtensions.MarkFailedtoActivityExtensions.MarkClientActivityFailed. - Made
int maxSizeparameter toClientCacheconstructor required and removed default value. - Changed
IEquatable<object> clientIdparameter toobject clientIdinClientCache.GetClient - Renamed
ConnectionCollectiontoClientConnectionCollection - Renamed
ConnectionProvidertoClientConnectionProvider - Renamed
ToCollectiontoConvertCollectionBuilderinModelReadWriteTypeBuilder - Renamed
AddKeyValuePairtoAddItemWithKeyinModelReadWriteTypeBuilder
- Added additional supported scenarios to System.ClientModel.SourceGeneration.
- Added additional supported scenarios to System.ClientModel.SourceGeneration.
- Added additional supported scenarios to System.ClientModel.SourceGeneration.
- System.ClientModel.SourceGeneration adds the Default property even when no type builders exist.
- Added extensions to
System.Diagnostics.ActivityandSystem.Diagnostics.ActivitySourceto simplify instrumentation of client libraries - Added new overloads to
System.ClientModel.ModelReaderWriterwhich take in a new ModelReaderWriterContext which allows reading and writing of collections ofIPersistableModel<>. In addition any calls to the new overloads are AOT compatible.
- Added new connection management types in the
System.ClientModel.Primitivesnamespace:ConnectionProvider: Abstract base class for managing client connections, including retrieval of connection settings and subclient caching.ClientConnection: Readonly struct that encapsulates connection options with support for API key, token, or no authentication.ConnectionCollection: A keyed collection of client connections, supporting JSON serialization and providing an enhanced debugger view.ClientCache: Implements an LRU-based cache for efficient reuse of client instances and optimized retrieval.
- Removed debugging statement in pipeline creation when applying the
ClientLoggingOptions.AllowedHeaderNamesoption.
- Added default logging with sanitization to Event Source.
- Added new logging options type to configure logging behavior, disable all logging, or opt to use ILogger instead.
- Use
BinaryData.EmptyforPipelineResponse.Contentwhen HTTP message has no content (#46669).
- Upgraded
System.Text.Jsonpackage dependency to 6.0.10 for security fix (#46134).
- Upgraded
System.Memory.Datapackage dependency to 6.0.0 (#46134).
- Removed implicit cast from
stringtoApiKeyCredential(#45554). - Upgraded
System.Text.Jsonpackage dependency to 6.0.9 (#45416). - Removed
PageCollection<T>and related types in favor of usingCollectionResult<T>and related types as the return values from paginated service endpoints (#45961).
- Added
JsonModelConverterto allow integration with System.Text.Json.
- Removed
ReturnWhenenum in favor of using boolwaitUntilCompletedparameter in third-party client LRO method signatures. - Added abstract
UpdateStatusmethod toOperationResult.
- Added
OperationResultandReturnWhentypes to support long-running operations.
- Added support for delaying retrying a request until after the interval specified on a response
Retry-Afterheader.
- Added
AsyncPageCollection<T>andPageCollection<T>types as return types from paginated service operations, andContinuationTokentype for resuming collection state across processes.
- Renamed
AsyncResultCollection<T>andResultCollection<T>toAsyncCollectionResult<T>andCollectionResult<T>to standardize use of theResultsuffix in type names. - Removed
AsyncPageableCollection<T>andPageableCollection<T>that previously represented collections of items rather than collections of pages of items, and renamedResultPage<T>toPageResult<T>.
- Added
BufferResponseproperty toRequestOptionsso protocol method callers can turn off response buffering if desired. - Added
AsyncResultCollection<T>andResultCollection<T>for clients to return from service methods where the service response contains a collection of values. - Added
AsyncPageableCollection<T>,PageableCollection<T>andResultPage<T>for clients to return from service methods where collection values are delivered to the client over one or more service responses. - Added
SetRawResponsemethod toClientResultto allow the response held by the result to be changed, for example by derived types that obtain multiple responses from polling the service.
ClientResult.GetRawResponsewill now throwInvalidOperationExceptionif called before the result's raw response is set, for example by collection result types that delay sending a request to the service until the collection is enumerated.
- Added protected
Apply(PipelineMessage)method toRequestOptionsso that derived types can extend its functionality. - Added
Create(Stream)overload toBinaryContent.
- Removed
[Serializable]attribute and serialization constructor fromClientResultException. - Made
valueparameter nullable inPipelineMessage.SetPropertymethod. - Made
optionsparameter toPipelineMessage.Applynullable.
- Added
ExtractResponsemethod toPipelineMessageto enable returning an undisposedPipelineResponsefrom protocol methods. - Added
CreateAsyncfactory method toClientResultExceptionto allow creating exceptions in an async context. - Added an implicit cast from
stringtoApiKeyCredential. - Added an implicit cast from
ClientResult<T>toT.
- Changed
HttpClientPipelineTransport.SharedandClientRetryPolicy.Defaultfrom static readonly fields to static properties. - Changed
PipelineResponse.Contentproperty from abstract to virtual. - Removed the
ResponseBufferingPolicyand moved response buffering functionality intoPipelineTransport. - Made
CancellationTokenparameter passed toBinaryContent.WriteTooptional.
- Initial preview release of convenience types in the System.ClientModel namespace, including
ClientResult<T>,KeyCredential, andClientResultException. - Initial preview release of pipeline types, including
ClientPipeline,PipelinePolicy, andPipelineMessage.
- Initial release of ModelReaderWriter APIs for reading and writing models in different formats.
ModelReaderWriterandModelReaderWriterOptionshave moved to System.ClientModel.Primitives namespaceJsonModelConverterwas removed.
- ModelReaderWriter APIs for reading and writing models in different formats.