XML columns in a Code-First application

后端 未结 4 1646
傲寒
傲寒 2020-12-28 16:38

I\'m trying to create an XML column in Code First. I\'m well aware Entity Framework doesn\'t fully support XML columns, and that it reads them as a string. That\'s fine. I w

4条回答
  •  情深已故
    2020-12-28 17:11

    But what if XmlContent is null ??

    Maybe :

        public XElement XmlValueWrapper
        {
            get { return XmlContent != null ? XElement.Parse(XmlContent) : null; }
            set { XmlContent = value.ToString(); }
        }
    

提交回复
热议问题