locked
Customized atom feed using ADO.NET Data services + Entity Framework RRS feed

  • Question

  • Hi,

    When I refer to the post at http://blogs.msdn.com/phaniraj/archive/2009/03/21/ado-net-data-services-friendly-feeds-mapping-clr-types.aspx which says that ado.net data services acutally allows the returned atom feed to be customized using: EntityPropertyMapping

    However, when I use the entity framework which generates the class automatically, i place
    [global::System.Data.Services.Common.EntityPropertyMapping("Latitude", "lat", "geo", "http://www.georss.org/georss", true)]
    [global::System.Data.Services.Common.EntityPropertyMapping("Longitude", "long", "geo", "http://www.georss.org/georss", true)]
    on top of the partial class generated to have additional customized tag to make the returned feed GeoRss atom feed, but it doesn't work.

    Do I need to config the mapping in the edmx file also? Does anyone know how should I achive this?
    (using this method is because I can still query over the data but returned format is GeoRss)
       
    Tuesday, January 12, 2010 5:42 PM

Answers

  • Hi,

    Currently we don't support specifying where should the namespace declaration appear. You could use WCF and postprocess the response to move the namespace declarations but that's rather slow.
    We added this feature assuming that consumers would be able to correctly parse a valid XML (doesn't seem like too much to ask), unfortunately in your case it seems the consumer doesn't follow the XML spec, which is sad.
    Thanks for the suggestion though, I'll add it to the list of possible improvements in the next round.

    Thanks,
    Vitek Karas [MSFT]
    • Marked as answer by Huang Sile Wednesday, January 13, 2010 4:43 PM
    Wednesday, January 13, 2010 9:56 AM
    Moderator
  • Thanks Vitek,

    You are correct.  We have confirmed Virtual Earth (now Bing Maps?) is able to consume the GeoRSS feed correctly and so does a few others.  For some reason though, Google Maps was not able to process this valid GeoRSS document. 

    Keep up the great work!  We love ADO.NET Data Services.
    • Marked as answer by Huang Sile Wednesday, January 13, 2010 4:43 PM
    Wednesday, January 13, 2010 4:36 PM

All replies