コード例 #1
0
        public async Task <TimelinesResource> GetTimelinesAsync(CancellationToken cancellationToken)
        {
            HomeResource home = await GetHomeAsync(cancellationToken);

            string timelinesUrl = home == null ? null : home.Links.Url(Relations.Timelines);

            if (timelinesUrl != null)
            {
                return(await SendAsync <TimelinesResource>(timelinesUrl, HttpMethod.Get, null, cancellationToken));
            }
            return(null);
        }
コード例 #2
0
        public async Task <TagCombinationListResource> PostTagCombinationsAsync(TagCombinationListResource tagCombinationList, CancellationToken cancellationToken)
        {
            HomeResource home = await GetHomeAsync(cancellationToken);

            string tagCombinationListUrl = home == null ? null : home.Links.Url(Relations.TagCombinationList);

            if (tagCombinationListUrl == null)
            {
                return(null);
            }
            return(await SendAsync <TagCombinationListResource>(tagCombinationListUrl, HttpMethod.Post, tagCombinationList, cancellationToken));
        }
コード例 #3
0
        public async Task <TimelineResource> PublishTimeline(TimelineResource timeline, CancellationToken cancellationToken)
        {
            HomeResource home = await GetHomeAsync(cancellationToken);

            string timelinesUrl = home == null ? null : home.Links.Url(Relations.Timelines);

            if (timelinesUrl == null)
            {
                throw new InvalidOperationException("Cannot publish timeline. Timelines url not found.");
            }

            return(await SendAsync <TimelineResource>(timelinesUrl, HttpMethod.Post, timeline, cancellationToken));
        }
コード例 #4
0
ファイル: HomeController.cs プロジェクト: circleupx/Chinook
 public HomeController(HomeResource homeResource)
 {
     this.homeResource = homeResource;
 }
コード例 #5
0
 public HomeHandler(HomeResource home)
 {
     this.home = home;
 }