1
0
mirror of synced 2025-03-01 16:00:28 +01:00
GC-local-server-rewrite/Application/Common/Extensions/XmlSerializationExtensions.cs
2023-02-09 17:25:42 +08:00

17 lines
392 B
C#

using ChoETL;
using Throw;
namespace Application.Common;
public static class XmlSerializationExtensions
{
public static T DeserializeCardData<T>(this string source) where T : class
{
using var reader = new ChoXmlReader<T>(new StringReader(source)).WithXPath("/root/data");
var result = reader.Read();
result.ThrowIfNull();
return result;
}
}