using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Query; using Ombi.Store.Context; using Ombi.Store.Entities; namespace Ombi.Store.Repository { public class UserPlayedMovieRepository : ExternalRepository, IUserPlayedMovieRepository { protected ExternalContext Db { get; } public UserPlayedMovieRepository(ExternalContext db) : base(db) { Db = db; } public async Task Get(int theMovieDbId, string userId) { return await Db.UserPlayedMovie.FirstOrDefaultAsync(x => x.TheMovieDbId == theMovieDbId && x.UserId == userId); } } }