diff options
Diffstat (limited to 'Services/RaffleService.cs')
-rw-r--r-- | Services/RaffleService.cs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Services/RaffleService.cs b/Services/RaffleService.cs index 5d1901f..bbc20f4 100644 --- a/Services/RaffleService.cs +++ b/Services/RaffleService.cs @@ -1,5 +1,6 @@ using Microsoft.EntityFrameworkCore; using BackendPIA.Models; +using BackendPIA.Forms; namespace BackendPIA.Services { public class RaffleService : IRaffleService { @@ -65,5 +66,13 @@ namespace BackendPIA.Services { return await _context.RaffleWinners.Include(rw => rw.UserAccount).Include(rw => rw.Raffle).Include(rw => rw.Prize) .Where(rw => rw.RaffleId == id).ToListAsync(); } + + public bool RaffleExists(long id) { + return _context.Raffles.Any(r => r.Id == id); + } + + public IEnumerable<Prize> GetRafflePrizes(long id) { + return _context.Prizes.Where(p => p.RaffleId == id).ToList(); + } } }
\ No newline at end of file |