Files
LaDOSE/LaDOSE.Src/LaDOSE.Service/Service/EventService.cs

29 lines
824 B
C#
Raw Normal View History

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