public bool GetIfVideoExists(long tweetId, out TwitterVideo video) { bool exists = context.TwitterVideos .Any(x => x.ParentTweetId == tweetId); video = default; if (exists) { video = context.TwitterVideos .Where(x => x.ParentTweetId == tweetId) .FirstOrDefault(); } return(exists); }
public async Task CaptureTwitterVideoAndRequestAsync(TwitterVideoRequest request, TwitterVideo twitterVideo) { context.Add(twitterVideo); context.Add(request); await context.SaveChangesAsync(); }