Пример #1
0
        public static GrimRequest Deserialize(string inputXml)
        {
            var grimSerializer = new XmlSerializer(typeof(GrimRequest));

            using var reader = new StringReader(inputXml);

            GrimRequest requestReq = grimSerializer.Deserialize(reader) as GrimRequest;

            return(requestReq);
        }
Пример #2
0
        public static async Task <GrimRequest> Deserialize(Stream inputStream)
        {
            var serializer = new XmlSerializer(typeof(GrimRequest));

            Stream ms = new MemoryStream();
            await inputStream.CopyToAsync(ms);

            ms.Position = 0;

            GrimRequest requestReq = serializer.Deserialize(ms) as GrimRequest;

            return(requestReq);
        }