using AX.FireTrainingSys.Models; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace AX.FireTrainingSys.EntityConfigurations { public class FoamHydrantConfig : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder entity) { //组合键 entity.HasKey(key => new { key.CoursewareId, key.Id }); entity.Property(e => e.CoursewareId) .IsUnicode(false) .IsFixedLength(); entity.Property(e => e.Id) .IsUnicode(false); } } }