COSMETIC: rename EventRepository
This commit is contained in:
@ -5,27 +5,27 @@ using Oqtane.Modules;
|
||||
|
||||
namespace SZUAbsolventenverein.Module.EventRegistration.Repository
|
||||
{
|
||||
public class EventRegistrationRepository : IEventRegistrationRepository, ITransientService
|
||||
public class EventRepository : IEventRepository, ITransientService
|
||||
{
|
||||
private readonly IDbContextFactory<EventRegistrationContext> _factory;
|
||||
|
||||
public EventRegistrationRepository(IDbContextFactory<EventRegistrationContext> factory)
|
||||
public EventRepository(IDbContextFactory<EventRegistrationContext> factory)
|
||||
{
|
||||
_factory = factory;
|
||||
}
|
||||
|
||||
public IEnumerable<Models.Event> GetEventRegistrations(int ModuleId)
|
||||
public IEnumerable<Models.Event> GetEvents(int ModuleId)
|
||||
{
|
||||
using var db = _factory.CreateDbContext();
|
||||
return db.Event.Where(item => item.ModuleId == ModuleId).ToList();
|
||||
}
|
||||
|
||||
public Models.Event GetEventRegistration(int EventRegistrationId)
|
||||
public Models.Event GetEvent(int EventRegistrationId)
|
||||
{
|
||||
return GetEventRegistration(EventRegistrationId, true);
|
||||
return GetEvent(EventRegistrationId, true);
|
||||
}
|
||||
|
||||
public Models.Event GetEventRegistration(int EventRegistrationId, bool tracking)
|
||||
public Models.Event GetEvent(int EventRegistrationId, bool tracking)
|
||||
{
|
||||
using var db = _factory.CreateDbContext();
|
||||
if (tracking)
|
||||
@ -38,7 +38,7 @@ namespace SZUAbsolventenverein.Module.EventRegistration.Repository
|
||||
}
|
||||
}
|
||||
|
||||
public Models.Event AddEventRegistration(Models.Event EventRegistration)
|
||||
public Models.Event AddEvent(Models.Event EventRegistration)
|
||||
{
|
||||
using var db = _factory.CreateDbContext();
|
||||
db.Event.Add(EventRegistration);
|
||||
@ -46,7 +46,7 @@ namespace SZUAbsolventenverein.Module.EventRegistration.Repository
|
||||
return EventRegistration;
|
||||
}
|
||||
|
||||
public Models.Event UpdateEventRegistration(Models.Event EventRegistration)
|
||||
public Models.Event UpdateEvent(Models.Event EventRegistration)
|
||||
{
|
||||
using var db = _factory.CreateDbContext();
|
||||
db.Entry(EventRegistration).State = EntityState.Modified;
|
||||
@ -54,7 +54,7 @@ namespace SZUAbsolventenverein.Module.EventRegistration.Repository
|
||||
return EventRegistration;
|
||||
}
|
||||
|
||||
public void DeleteEventRegistration(int EventRegistrationId)
|
||||
public void DeleteEvent(int EventRegistrationId)
|
||||
{
|
||||
using var db = _factory.CreateDbContext();
|
||||
Models.Event EventRegistration = db.Event.Find(EventRegistrationId);
|
@ -1,15 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SZUAbsolventenverein.Module.EventRegistration.Repository
|
||||
{
|
||||
public interface IEventRegistrationRepository
|
||||
{
|
||||
IEnumerable<Models.Event> GetEventRegistrations(int ModuleId);
|
||||
Models.Event GetEventRegistration(int EventRegistrationId);
|
||||
Models.Event GetEventRegistration(int EventRegistrationId, bool tracking);
|
||||
Models.Event AddEventRegistration(Models.Event EventRegistration);
|
||||
Models.Event UpdateEventRegistration(Models.Event EventRegistration);
|
||||
void DeleteEventRegistration(int EventRegistrationId);
|
||||
}
|
||||
}
|
15
Server/Repository/IEventRepository.cs
Normal file
15
Server/Repository/IEventRepository.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SZUAbsolventenverein.Module.EventRegistration.Repository
|
||||
{
|
||||
public interface IEventRepository
|
||||
{
|
||||
IEnumerable<Models.Event> GetEvents(int ModuleId);
|
||||
Models.Event GetEvent(int EventRegistrationId);
|
||||
Models.Event GetEvent(int EventRegistrationId, bool tracking);
|
||||
Models.Event AddEvent(Models.Event EventRegistration);
|
||||
Models.Event UpdateEvent(Models.Event EventRegistration);
|
||||
void DeleteEvent(int EventRegistrationId);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user