- Change return type to tuple (Bill, string[]) - Remove custom parsing methods (ParseSwissQrBillContent, MapAddress, DetermineReferenceType) - Use Codecrete QRBill.DecodeQrCodeText() for parsing - Add SkiaSharp.QrCode v1.0.0 for QR decoding - Remove obsolete ZXing and System.Drawing dependencies - Add StringExtensions for QR code detection - Raw lines properly split and trimmed from QR text
16 lines
438 B
C#
16 lines
438 B
C#
using System.Xml.Serialization;
|
|
|
|
namespace DocumentOperator.Infrastructure.Services;
|
|
|
|
public static class StringExtensions
|
|
{
|
|
public static T? DeserializeXml<T>(this string xmlText)
|
|
{
|
|
if (string.IsNullOrWhiteSpace(xmlText))
|
|
return default;
|
|
|
|
var serializer = new XmlSerializer(typeof(T));
|
|
using var reader = new StringReader(xmlText);
|
|
return (T?)serializer.Deserialize(reader);
|
|
}
|
|
} |