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(); }
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(); }
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)); }
public async Task <bool> AddFeed(FeedItemRequest item) { return(await K_AkicaClient.AddFeedItemAsync(item)); }