ozbob

My feedback

  1. 369 votes
    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)

      We’ll send you updates on this idea

      ozbob commented  · 

      XML support in EF Model workaround.

      For an XML column in a table called 'Metadata' the string Property in EF Model in C# could be represented with XElement like this:

      [Column(TypeName = "xml")]
      public string Metadata { get; set; } // Job XML as string: appointees; contact at practice;
      private XElement metaXML = null;
      [NotMapped]
      public XElement MetaXML
      {
      get
      {
      try
      {
      if (metaXML == null && (this.Metadata != null))
      {
      metaXML = XElement.Parse(this.Metadata);
      metaXML.Changed += (s, e) =>
      {
      this.Metadata = metaXML.ToString();
      };
      }
      }
      catch { }
      return metaXML;
      }

      set
      {
      metaXML = value;
      metaXML.Changed += (s, e) =>
      {
      this.Metadata = metaXML.ToString();
      };
      this.Metadata = value.ToString();
      }
      }

      ozbob commented  · 

      Another element of supporting XML data type is in CreateStoredProcedure in a migration. Currently XML parameters are not supported in generating scripts.

      http://data.uservoice.com/forums/72025-entity-framework-feature-suggestions/suggestions/9898446-createstoredprocedure-xml-parameterbuilder

    • 1 vote
      Sign in
      Check!
      (thinking…)
      Reset
      or sign in with
      • facebook
      • google
        Password icon
        Signed in as (Sign out)

        We’ll send you updates on this idea

        ozbob shared this idea  · 

      Feedback and Knowledge Base