| | |
| | | b.HasKey(x => x.Id); |
| | | |
| | | // 字段配置 |
| | | b.Property(x => x.MaterialCode) |
| | | b.Property(x => x.MaterialNo) |
| | | .HasMaxLength(64) |
| | | .IsRequired() |
| | | .HasComment("物料编码(唯一标识)"); |
| | |
| | | b.Property(x => x.PurchaseType) |
| | | .HasComment("采购类型(枚举值)"); |
| | | |
| | | b.Property(x => x.MaterialType) |
| | | .HasComment("物料类型(枚举值)"); |
| | | b.Property(x => x.MaterialTypeCode) |
| | | .HasMaxLength(20) |
| | | .HasComment("物料类型编码"); |
| | | |
| | | b.Property(x => x.MaterialTypeDesc) |
| | | .HasMaxLength(20) |
| | | .HasComment("物料类型"); |
| | | |
| | | b.Property(x => x.PrimaryUnit) |
| | | .HasMaxLength(20) |
| | |
| | | b.Property(x => x.Certification) |
| | | .HasMaxLength(128) |
| | | .HasComment("证书编号"); |
| | | b.Property(x => x.MaterialModel) |
| | | .HasMaxLength(128) |
| | | .HasComment("型号"); |
| | | |
| | | // 冗余字段配置 |
| | | b.Property(x => x.RedundantField1) |
| | |
| | | .HasComment("是否禁用"); |
| | | |
| | | // 索引配置 |
| | | b.HasIndex(x => x.MaterialCode).IsUnique(); // 物料编码唯一索引 |
| | | b.HasIndex(x => x.MaterialNo).IsUnique(); // 物料编码唯一索引 |
| | | b.HasIndex(x => x.MaterialName); // 物料名称普通索引 |
| | | b.HasIndex(x => x.PurchaseType); // 采购类型索引(如需查询过滤) |
| | | b.HasIndex(x => x.MaterialType); // 物料类型索引(如需查询过滤) |
| | | b.HasIndex(x => x.MaterialTypeCode); // 物料类型索引(如需查询过滤) |
| | | |
| | | b.ApplyObjectExtensionMappings(); |
| | | }); |