using CMS.Plugin.MyExtension.Domain;
using CMS.Plugin.PipeLineLems.Domain;
using CMS.Plugin.PipeLineLems.Domain.Shared.MyTestEntityNames;
using CMS.Plugin.PipeLineLems.Domain.CallMaterialOrder;
using Microsoft.EntityFrameworkCore;
using Volo.Abp;
using Volo.Abp.EntityFrameworkCore.Modeling;
namespace CMS.Plugin.PipeLineLems.EntityFrameworkCore.Extensions;
///
/// EfCore扩展
///
public static partial class CMSPluginEfCoreExtensions
{
///
/// Includes the details.
///
/// The queryable.
/// if set to true [include].
///
public static IQueryable IncludeDetails(this IQueryable queryable, bool include = true)
{
if (!include)
{
return queryable;
}
return queryable;
}
///
/// Configures the mytestentityname.
///
/// The builder.
public static void ConfigureCallMaterialOrder(this ModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));
builder.Entity(b =>
{
//Configure table & schema name
b.ToTable((CMSPluginDbProperties.DbTablePrefix + "_CallMaterialOrders").ToLower(), CMSPluginDbProperties.DbSchema).HasComment("叫料单表");
b.ConfigureByConvention();
// Configure properties
b.Property(x => x.CallMaterialStatus).IsRequired().HasComment("叫料状态");
b.Property(x => x.DataIdentifier).IsRequired().HasMaxLength(256).HasComment("原料标识");
b.Property(x => x.MaterialMode).HasMaxLength(256).HasComment("原料型号");
b.Property(x => x.Quantity).HasComment("叫料数量");
b.Property(x => x.WmsRetResult).HasComment("WMS返回结果");
b.Property(x => x.WmsTaskNo).HasComment("WMS任务号");
b.ConfigureMyCmsEntity();
// Configure indexes
b.HasIndex(u => u.DataIdentifier).IsUnique();
b.HasIndex(u => u.DataIdentifier);
b.ApplyObjectExtensionMappings();
});
}
}