mirror of
https://github.com/project-redbud/FunGame-Core.git
synced 2025-12-05 08:09:02 +00:00
为ReadPropertyName方法添加JsonSerializerOptions (#44)
* 为ReadPropertyName方法添加JsonSerializerOptions * 添加reader.read(); --------- Co-authored-by: Yezi <53083103+yeziuku@users.noreply.github.com>
This commit is contained in:
parent
20926ebb09
commit
9631267010
@ -4,6 +4,6 @@ namespace Milimoe.FunGame.Core.Interface.Base
|
||||
{
|
||||
internal interface IEntityConverter<T>
|
||||
{
|
||||
public void ReadPropertyName(ref Utf8JsonReader reader, string propertyName, ref T? result);
|
||||
public void ReadPropertyName(ref Utf8JsonReader reader, string propertyName, JsonSerializerOptions options, ref T? result);
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,13 +17,14 @@ namespace Milimoe.FunGame.Core.Library.Common.Architecture
|
||||
if (reader.TokenType == JsonTokenType.PropertyName)
|
||||
{
|
||||
string propertyName = reader.GetString() ?? "";
|
||||
ReadPropertyName(ref reader, propertyName, ref result);
|
||||
reader.Read();
|
||||
ReadPropertyName(ref reader, propertyName, options, ref result);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public abstract void ReadPropertyName(ref Utf8JsonReader reader, string propertyName, ref T? result);
|
||||
public abstract void ReadPropertyName(ref Utf8JsonReader reader, string propertyName, JsonSerializerOptions options, ref T? result);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user