public class XmlYDataConvertAttribute : DataConvertAttribute
{
public override void Execute(IDataContext dataContext, HttpRequest request)
{
if (request.Length > 0)
{
using (request.Stream.LockFree())
{
string value = "";
using (System.IO.StreamReader streamReader = new System.IO.StreamReader(request.Stream))
{
value = streamReader.ReadToEnd();
if (!string.IsNullOrEmpty(value))
{
dataContext.SetValue("ywXml", value);
}
}
}
}
}
}
public class XmlYDataConvertAttribute : DataConvertAttribute { public override void Execute(IDataContext dataContext, HttpRequest request) { if (request.Length > 0) { using (request.Stream.LockFree()) { string value = ""; using (System.IO.StreamReader streamReader = new System.IO.StreamReader(request.Stream)) { value = streamReader.ReadToEnd(); if (!string.IsNullOrEmpty(value)) { dataContext.SetValue("ywXml", value); } } } } } }