2022-03-20 19:36:15 +01:00
|
|
|
|
using System.Linq;
|
2018-10-07 03:03:38 +02:00
|
|
|
|
using LaDOSE.Business.Interface;
|
2022-03-20 02:59:48 +01:00
|
|
|
|
using LaDOSE.Business.Provider.SmashProvider;
|
2018-10-07 03:03:38 +02:00
|
|
|
|
using LaDOSE.Entity;
|
|
|
|
|
|
using LaDOSE.Entity.Context;
|
2018-10-22 01:13:42 +02:00
|
|
|
|
using LaDOSE.Entity.Wordpress;
|
2018-10-07 15:15:11 +02:00
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
2018-10-07 03:03:38 +02:00
|
|
|
|
|
|
|
|
|
|
namespace LaDOSE.Business.Service
|
|
|
|
|
|
{
|
2022-03-20 02:59:48 +01:00
|
|
|
|
public class EventService : BaseService<Event>, IEventService
|
2018-10-07 03:03:38 +02:00
|
|
|
|
{
|
2022-03-20 19:36:15 +01:00
|
|
|
|
public EventService(LaDOSEDbContext context ) : base(context)
|
2022-03-20 02:59:48 +01:00
|
|
|
|
{
|
|
|
|
|
|
this._context = context;
|
2022-03-20 19:36:15 +01:00
|
|
|
|
|
2022-03-20 02:59:48 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-03-20 19:36:15 +01:00
|
|
|
|
public Event GetBySlug(string tournamentSlug)
|
2022-03-20 02:59:48 +01:00
|
|
|
|
{
|
2022-03-20 19:36:15 +01:00
|
|
|
|
return _context.Event.Include(e => e.Tournaments).FirstOrDefault(e => e.SmashSlug == tournamentSlug);
|
2022-03-20 02:59:48 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-03-20 19:36:15 +01:00
|
|
|
|
public Event GetByName(string name)
|
2022-03-20 02:59:48 +01:00
|
|
|
|
{
|
2022-03-20 19:36:15 +01:00
|
|
|
|
return _context.Event.Include(e=>e.Tournaments).FirstOrDefault(e => e.Name == name);
|
2022-03-20 02:59:48 +01:00
|
|
|
|
}
|
2018-10-07 03:03:38 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|