0
我正在使用以下內容將信息傳遞給保存功能。如何訪問底層xml值
List<XElement> listElements = new List<XElement>();
listElements.Addnew XElement(@"TextBox", new XElement("name"),
new XElement("Type", "System.String"),
new XElement("displayName", ""),
new XElement("length", "12"),
new XElement("key", false),
new XElement("required", false)));
listElements.Add(new XElement(@"ClassficationEnum", new XElement("name","TestForm"),
new XElement("Type", "System.String"),
new XElement("displayName", "TestForm"),
new XElement("length", "12"),
new XElement("key", false),
new XElement("required", false)));
我然後將它傳遞給update命令如下
portalContext.UpdateFormBuilder(formToUpdate, strName.ToString(), listElements.ToString());
,並保存到我的實體,我使用我有這個
var q = from forms in portalEntities.FormBuilders
where forms.Name == formName
select forms;
List<FormBuilder> formBuilderRecords = q.ToList();
foreach (FormBuilder formsBuilder in formBuilderRecords)
{
formsBuilder.Name = formName;
formsBuilder.ExtraFields = xml.ToString();
formsBuilder.title = Title;
}
return SaveChanges();
問題是,它只是將以下內容保存到數據庫中,我如何獲得所有值而不是僅僅這一點。
System.Collections.Generic.List`1 [System.Xml.Linq.XElement]