Skip to content

Commit

Permalink
fixes #2601: AddDefaultODataServices should pass OData version to low…
Browse files Browse the repository at this point in the history
… layer (#2602)

* fixes #2601: AddDefaultODataServices should pass OData version to lower layer

* Update src/Microsoft.OData.Core/ContainerBuilderExtensions.cs

Co-authored-by: John Gathogo <john.gathogo@microsoft.com>

Co-authored-by: John Gathogo <john.gathogo@microsoft.com>
  • Loading branch information
xuzhg and gathogojr authored Jan 26, 2023
1 parent 0770ead commit 3ca5b81
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Microsoft.OData.Core/ContainerBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ public static IContainerBuilder AddDefaultODataServices(this IContainerBuilder b
builder.AddService<IJsonWriterFactoryAsync>(ServiceLifetime.Singleton, sp => new DefaultJsonWriterFactory());
builder.AddService(ServiceLifetime.Singleton, sp => ODataMediaTypeResolver.GetMediaTypeResolver(null));
builder.AddService<ODataMessageInfo>(ServiceLifetime.Scoped);
builder.AddServicePrototype(new ODataMessageReaderSettings());
builder.AddServicePrototype(new ODataMessageReaderSettings(odataVersion));
builder.AddService(ServiceLifetime.Scoped, sp => sp.GetServicePrototype<ODataMessageReaderSettings>().Clone());
builder.AddServicePrototype(new ODataMessageWriterSettings());
builder.AddServicePrototype(new ODataMessageWriterSettings { Version = odataVersion });
builder.AddService(ServiceLifetime.Scoped, sp => sp.GetServicePrototype<ODataMessageWriterSettings>().Clone());
builder.AddService(ServiceLifetime.Singleton, sp => ODataPayloadValueConverter.GetPayloadValueConverter(null));
builder.AddService<IEdmModel>(ServiceLifetime.Singleton, sp => EdmCoreModel.Instance);
Expand Down

0 comments on commit 3ca5b81

Please sign in to comment.