29 lines
1.0 KiB
C#
29 lines
1.0 KiB
C#
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.AspNetCore.Http;
|
|
using Oqtane.Modules;
|
|
using Oqtane.Repository;
|
|
using Oqtane.Infrastructure;
|
|
using Oqtane.Repository.Databases.Interfaces;
|
|
|
|
namespace SZUAbsolventenverein.Module.EventRegistration.Repository
|
|
{
|
|
public class EventRegistrationContext : DBContextBase, ITransientService, IMultiDatabase
|
|
{
|
|
public virtual DbSet<Models.Event> Event { get; set; }
|
|
public virtual DbSet<Models.Response> Response { get; set; }
|
|
|
|
public EventRegistrationContext(IDBContextDependencies DBContextDependencies) : base(DBContextDependencies)
|
|
{
|
|
// ContextBase handles multi-tenant database connections
|
|
}
|
|
|
|
protected override void OnModelCreating(ModelBuilder builder)
|
|
{
|
|
base.OnModelCreating(builder);
|
|
|
|
builder.Entity<Models.Event>().ToTable(ActiveDatabase.RewriteName("SZUAbsolventenvereinEvent"));
|
|
builder.Entity<Models.Response>().ToTable(ActiveDatabase.RewriteName("SZUAbsolventenvereinEventResponse"));
|
|
}
|
|
}
|
|
}
|