コード例 #1
0
        public async Task Post(FeedItemRequest value)
        {
            var pooper = await m_context.Poopers.FindAsync(value.PooperId);

            await m_context.FeedItems.AddAsync(value.AsFeedItem(pooper));

            await m_context.SaveChangesAsync();
        }
コード例 #2
0
        public async Task Put(int id, [FromBody] FeedItemRequest value)
        {
            var existing = await m_context.FeedItems.FindAsync(id);

            var pooper = await m_context.Poopers.FindAsync(value.PooperId);

            existing.UpdateFromRequest(value, pooper);

            m_context.FeedItems.Update(existing);
            await m_context.SaveChangesAsync();
        }
コード例 #3
0
        public static async Task <bool> AddFeedItemAsync(FeedItemRequest item)
        {
            var holder = new ClientHolder()
            {
                Uri           = $"{ApiUri.AbsoluteUri}/FeedItems",
                OperationType = OperationType.Post,
                Content       = MakeContent(item)
            };

            return(await ConsumeApi(holder));
        }
コード例 #4
0
 public async Task <bool> AddFeed(FeedItemRequest item)
 {
     return(await K_AkicaClient.AddFeedItemAsync(item));
 }