using System.Net.Http;
using System.Xml;

namespace PlatezhkaDemoApi
{
    internal class ControllerHelper
    {
        public static string GetControllerNameFromRequest(HttpRequestMessage request)
        {
            string data = request.Content.ReadAsStringAsync().Result;
            XmlDocument doc = new XmlDocument();
            doc.LoadXml(data);
            XmlNode node = doc.DocumentElement.SelectSingleNode("command");
            if (node == null) return string.Empty;
            return node.InnerText;
        }
    }
}