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.

21 lines
929 B

using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using CellularManagement.Domain.Entities.Device;
namespace CellularManagement.Infrastructure.Configurations.Device;
public class DeviceStatusConfiguration : IEntityTypeConfiguration<DeviceStatus>
{
public void Configure(EntityTypeBuilder<DeviceStatus> builder)
{
builder.ToTable("DeviceStatuses", t => t.HasComment("设备状态表"));
builder.HasKey(s => s.Id);
// 配置属性
builder.Property(s => s.Id).HasComment("状态ID");
builder.Property(s => s.Name).IsRequired().HasMaxLength(50).HasComment("状态名称");
builder.Property(s => s.Description).HasMaxLength(200).HasComment("状态描述");
builder.Property(s => s.CreatedAt).IsRequired().HasComment("创建时间");
builder.Property(s => s.UpdatedAt).IsRequired().HasComment("更新时间");
}
}