My xml looks like this:
<document>
<body>
<p>
<text>asdasdasdasd</text>
</p>
<text> </text>
<p>
<text>Bl abloa blasdasdasd</text>
</p>
</body>
</document>
So what i want to do is to parse body element as string.
[XmlRoot(ElementName = "document")]
public class Document
{
[XmlElement(ElementName = "body")]
public string Body { get; set; }
}
I've tried [XmlText] and different attributes on like this [XmlText(Type = typeof(string))]
I'm trying to do this directly as a parameter in my controller method:
[AllowAnonymous]
[HttpPost]
[Route("")]
public async Task SearchResult([FromBody] SearchResultDataContract searchResult)
{
try
Were SearchResultDataContract is the document object.
But I haven't managed to find any solutions.