I am trying to change the XElement XName to a readable format, but cant. How to replace the XElement name with an alias name? Below is my XElement code.
var root = new XElement("Reports",
from l in _userReportMasterDataList
join m in _userReportLocalDataList on l.UsrID equals m.TypeValue
select new XElement("Report",
new XElement("CreatedDate", (DateTime)(l.CreatedDate)),
new XElement("LogType", (string)(l.LogType)),
new XElement("LoginID", (string)(l.LoginID)),
new XElement("Name", (string)(m.Name)),
new XElement("AppVersion", (string)(l.AppVersion)),
new XElement("System", (string)(l.System)),
new XElement("UserIP", (string)(l.UserIPAddress)),
new XElement("LoginDate", (DateTime?)(l.LoginDate)),
new XElement("LogoutDate", (DateTime?)(l.LogoutDate)),
new XElement("Remarks", (string)(l.Remarks))), new XElement("Header",
new XElement("ReportID", (string)(r.ReportID)),
new XElement("GroupingColumn1", (string)(r.GroupingColumn1)),
new XElement("PrintedBy", (string)(r.ReqHdr.Server)),
new XElement("PrintedDate", (DateTime)(DateTime.UtcNow))));
In the place of the XName "CreatedDate", I want to replace it with Date Created, "UserIP" to "IP Address" etc.
Thanks,