using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; using System; using System.Collections.Generic; using System.Text; namespace Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF { public class IntegrationEventLogContext : DbContext { public IntegrationEventLogContext(DbContextOptions options) : base(options) { } public DbSet IntegrationEventLogs { get; set; } protected override void OnModelCreating(ModelBuilder builder) { builder.Entity(ConfigureIntegrationEventLogEntry); } void ConfigureIntegrationEventLogEntry(EntityTypeBuilder builder) { builder.ToTable("IntegrationEventLog"); builder.HasKey(e => e.EventId); builder.Property(e => e.EventId) .IsRequired(); builder.Property(e => e.Content) .IsRequired(); builder.Property(e => e.CreationTime) .IsRequired(); builder.Property(e => e.State) .IsRequired(); builder.Property(e => e.TimesSent) .IsRequired(); builder.Property(e => e.EventTypeName) .IsRequired(); } } }