mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-30 03:28:28 -07:00
This commit is contained in:
parent
385d206287
commit
3cc45b3022
30 changed files with 317 additions and 126 deletions
|
@ -1,4 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
@ -16,11 +17,27 @@ namespace Ombi.Store.Repository.Requests
|
|||
|
||||
private IOmbiContext Db { get; }
|
||||
|
||||
public async Task<MovieRequests> GetRequest(int theMovieDbId)
|
||||
public async Task<MovieRequests> GetRequestAsync(int theMovieDbId)
|
||||
{
|
||||
return await Db.MovieRequests.Where(x => x.TheMovieDbId == theMovieDbId)
|
||||
try
|
||||
{
|
||||
return await Db.MovieRequests.Where(x => x.TheMovieDbId == theMovieDbId)
|
||||
.Include(x => x.RequestedUser)
|
||||
.FirstOrDefaultAsync();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e);
|
||||
throw;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public MovieRequests GetRequest(int theMovieDbId)
|
||||
{
|
||||
return Db.MovieRequests.Where(x => x.TheMovieDbId == theMovieDbId)
|
||||
.Include(x => x.RequestedUser)
|
||||
.FirstOrDefaultAsync();
|
||||
.FirstOrDefault();
|
||||
}
|
||||
|
||||
public IQueryable<MovieRequests> Get()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue