Skip to content

Commit eee67fc

Browse files
matherm-aboehmunchase
authored andcommitted
fix: Fix missing type hint for serializer in UserSettingsPersistenceHelper
1 parent 7c7c64d commit eee67fc

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

src/Unchase.OpenAPI.Connectedservice.Shared/Common/UserSettingsPersistenceHelper.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,12 @@ await ExecuteNoncriticalOperationAsync(
4242
{
4343
stream = null;
4444

45-
var dcs = new DataContractSerializer(userSettings.GetType());
4645
//TODO: use async serializer
46+
Type[] knownTypes = new[]
47+
{
48+
typeof(Microsoft.OpenApi.OData.Extensions.ODataRoutePathPrefixProvider)
49+
};
50+
var dcs = new DataContractSerializer(userSettings.GetType(), knownTypes);
4751
dcs.WriteObject(writer, userSettings);
4852

4953
await writer.FlushAsync();
@@ -100,8 +104,12 @@ await ExecuteNoncriticalOperationAsync(
100104
{
101105
stream = null;
102106

103-
var dcs = new DataContractSerializer(typeof(T));
104107
//TODO: use async serializer
108+
Type[] knownTypes = new[]
109+
{
110+
typeof(Microsoft.OpenApi.OData.Extensions.ODataRoutePathPrefixProvider)
111+
};
112+
var dcs = new DataContractSerializer(typeof(T), knownTypes);
105113
result = dcs.ReadObject(reader) as T;
106114
}
107115
}

0 commit comments

Comments
 (0)