December 2019
Intermediate to advanced
510 pages
11h 33m
English
To utilize the schema implemented in the ItemEntitySchemaDefinition class, we should apply it in the OnModelCreating method contained in the CatalogContext class:
using System.Threading;using System.Threading.Tasks;using Microsoft.EntityFrameworkCore;using Catalog.Domain.Entities;using Catalog.Domain.Repositories;using Catalog.Infrastructure.SchemaDefinitions;namespace Catalog.Infrastructure{ public class CatalogContext : DbContext, IUnitOfWork { public const string DEFAULT_SCHEMA = "catalog"; public DbSet<Item> Items { get; set; } public CatalogContext(DbContextOptions<CatalogContext> options) : base (options) { } protected override void OnModelCreating(ModelBuilder modelBuilder) ...
Read now
Unlock full access