XML data type in EF 4.1 Code First

前端 未结 3 1560
陌清茗
陌清茗 2021-02-05 17:35

I would like to use SQL Server xml type as a column type for an entity class.

According to this thread it\'s possible to map such a column to st

3条回答
  •  逝去的感伤
    2021-02-05 18:17

    The problem was with my wrapper property:

    [NotMapped]
    public XElement XmlValueWrapper
    {
        get { return XElement.Parse(XmlValue); }
        set { XmlValue = value.ToString(); }
    }
    

    I didn't specified NotMapped attribute.

提交回复
热议问题