mirror of https://github.com/Squidex/squidex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
1.1 KiB
28 lines
1.1 KiB
// ==========================================================================
|
|
// Squidex Headless CMS
|
|
// ==========================================================================
|
|
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
|
// All rights reserved. Licensed under the MIT license.
|
|
// ==========================================================================
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Squidex.Infrastructure;
|
|
using Squidex.Infrastructure.Json;
|
|
using Squidex.Infrastructure.Queries;
|
|
|
|
#pragma warning disable CS9107 // Parameter is captured into the state of the enclosing type and its value is also passed to the base constructor. The value might be captured by the base class as well.
|
|
|
|
namespace Squidex;
|
|
|
|
public abstract class ContentDbContext(DbContextOptions options, IJsonSerializer jsonSerializer)
|
|
: DbContext(options), IDbContextWithDialect
|
|
{
|
|
public abstract SqlDialect Dialect { get; }
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
modelBuilder.UseContent(jsonSerializer, Dialect.JsonColumnType(), options.Prefix());
|
|
|
|
base.OnModelCreating(modelBuilder);
|
|
}
|
|
}
|
|
|