Exemplo n.º 1
0
        public async Task <IActionResult> Index()
        {
            var             store       = new UserStore <ApplicationUser>(new AppIdentityDbContext());
            var             userManager = new UserManager <ApplicationUser>(store);
            ApplicationUser user        = userManager.FindByNameAsync(User.Identity.Name).Result;
            FeedViewModel   viewModel   = FeedConverter.EntityToViewModel(await _feedService.GetFollowedGroups(user.Id));

            return(View(viewModel));
        }
Exemplo n.º 2
0
        public async Task <ActionResult> GetFeed(string userName, string feedName)
        {
            var feed = await feeds.Get(userName, feedName);

            var feedPosts = await posts.GetForFeed(feed);

            var xml = FeedConverter.Create(new Uri($"{Request.Scheme}://{Request.Host.Value}{Request.PathBase.Value}"), feed, feedPosts);

            return(Content(xml, "text/xml"));
        }
Exemplo n.º 3
0
        private static Feed Read(string sourceId)
        {
            var source = _sources.Find(source => source.Id == sourceId);

            var reader  = new FeedReader(_sources);
            var rawFeed = reader.Read(source);

            var converter = new FeedConverter(_sources);
            var feed      = converter.Convert(source.Id, rawFeed);

            return(feed);
        }