locked
Syndication RRS feed

  • Question

  • Hello,

    I am trying to create a syndication feed. I have 2 feeds (RSS):

         Articles: http://www.mydomain.com/Syndication/Subscribe/1
    Documents: http://www.mydomain.com/Syndication/Subscribe/2

    And I also provide in Atom:

         Articles: http://www.mydomain.com/Syndication/Subscribe/3
    Documents: http://www.mydomain.com/Syndication/Subscribe/4

    The first one is for articles and the second is for documents.
    Both feeds display the content as expected but the titles of the items don't have a link.

    For example, I am mapping an Article Entity to a Syndication Item as follows:

              Mapper.CreateMap<Article, SyndicationItem>()
                .ForMember(d => d.AttributeExtensions, o => o.Ignore())
                .ForMember(d => d.Authors, o => o.Ignore())
                .ForMember(d => d.BaseUri, o => o.MapFrom(s => new Uri(controller.HttpContext.Request.Url, String.Concat("/Article/Show/", s.Id.ToString()))))
                .ForMember(d => d.Categories, o => o.Ignore())
                .ForMember(d => d.Content, o => o.MapFrom(s => new TextSyndicationContent(s.Excerpt.Strip(new String[] {}, true))))
                .ForMember(d => d.Contributors, o => o.Ignore())
                .ForMember(d => d.Copyright, o => o.Ignore())
                .ForMember(d => d.ElementExtensions, o => o.Ignore())
                .ForMember(d => d.Id, o => o.MapFrom(s => s.Id.ToString()))
                .ForMember(d => d.LastUpdatedTime, o => o.MapFrom(s => new DateTimeOffset(s.Updated, new TimeSpan(0))))
                .ForMember(d => d.Links, o => o.Ignore())
                .ForMember(d => d.PublishDate, o => o.MapFrom(s => new DateTimeOffset(s.Created, new TimeSpan(0))))
                .ForMember(d => d.SourceFeed, o => o.Ignore())
                .ForMember(d => d.Summary, o => o.Ignore())
                .ForMember(d => d.Title, o => o.MapFrom(s => new TextSyndicationContent(s.Title)));
    I debugged it and BaseUri of each item is something like:
    http://localhost:60495/Syndication/Subscribe/2
    http://localhost:60495/Syndication/Subscribe/3
    Etc

    But the titles don't have a link as it happens when I go for example to http://rss.cnn.com/rss/edition.rss

    The other question I have is:

    What should be the Feed Uri and Id?

          feed.BaseUri = new Uri(controller.HttpContext.Request.Url, "????");
          feed.Id = "???";

    Thanks,
    Miguel



    • Moved by Harry Zhu Wednesday, October 21, 2009 8:08 AM (From:Visual C# General)
    Monday, October 19, 2009 12:57 PM

Answers

All replies