zeroframework/Services/DeviceCenter/ZeroFramework.DeviceCenter.Infrastructure/IntegrationEvents/IntegrationEventLogConfiguration.cs
2023-12-05 17:22:48 +08:00

20 lines
872 B
C#

using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace ZeroFramework.DeviceCenter.Infrastructure.IntegrationEvents
{
public class IntegrationEventLogConfiguration : IEntityTypeConfiguration<IntegrationEventLog>
{
public void Configure(EntityTypeBuilder<IntegrationEventLog> builder)
{
builder.ToTable("IntegrationEventLogs", Constants.DbConstants.DefaultTableSchema);
builder.HasKey(e => e.Id);
builder.Property(e => e.Id).IsRequired();
builder.Property(e => e.Content).IsRequired();
builder.Property(e => e.CreationTime).IsRequired();
builder.Property(e => e.Status).IsRequired();
builder.Property(e => e.TimesSent).IsRequired();
builder.Property(e => e.EventTypeName).IsRequired();
}
}
}