¶Ô±ÈÐÂÎļþ |
| | |
| | | using CMS.Plugin.HIAWms.Domain; |
| | | using CMS.Plugin.HIAWms.Domain.WmsAreas; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.WmsAreas; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using Volo.Abp; |
| | | using Volo.Abp.EntityFrameworkCore.Modeling; |
| | | |
| | | namespace CMS.Plugin.HIAWms.EntityFrameworkCore.Extensions; |
| | | |
| | | /// <summary> |
| | | /// EfCoreæ©å± |
| | | /// </summary> |
| | | public static partial class CMSPluginEfCoreExtensions |
| | | { |
| | | /// <summary> |
| | | /// Includes the details. |
| | | /// </summary> |
| | | /// <param name="queryable">The queryable.</param> |
| | | /// <param name="include">if set to <c>true</c> [include].</param> |
| | | /// <returns></returns> |
| | | public static IQueryable<WmsArea> IncludeDetails(this IQueryable<WmsArea> queryable, bool include = true) |
| | | { |
| | | if (!include) |
| | | { |
| | | return queryable; |
| | | } |
| | | |
| | | return queryable; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Configures the wmsarea. |
| | | /// </summary> |
| | | /// <param name="builder">The builder.</param> |
| | | public static void ConfigureWmsArea(this ModelBuilder builder) |
| | | { |
| | | Check.NotNull(builder, nameof(builder)); |
| | | |
| | | builder.Entity<WmsArea>(b => |
| | | { |
| | | // Configure table & schema name |
| | | b.ToTable((CMSPluginDbProperties.DbTablePrefix + "_WmsAreas").ToLower(), CMSPluginDbProperties.DbSchema).HasComment("åºåºè¡¨"); |
| | | |
| | | b.ConfigureByConvention(); |
| | | |
| | | // Properties |
| | | b.Property(x => x.AreaNo).HasMaxLength(WmsAreaConsts.MaxNameLength).IsRequired().HasComment("åºåºç¼å·"); |
| | | b.Property(x => x.AreaName).HasMaxLength(WmsAreaConsts.MaxAreaNameLength).IsRequired().HasComment("åºåºåç§°"); |
| | | b.Property(x => x.AreaDesc).HasMaxLength(WmsAreaConsts.MaxAreaDescLength).IsRequired(false).HasComment("æè¿°"); |
| | | b.Property(x => x.AreaStatus).HasComment("åºåºç¶æ"); |
| | | b.Property(x => x.AreaType).HasComment("åºåºç±»å"); |
| | | b.Property(x => x.RedundantField1).HasMaxLength(WmsAreaConsts.MaxRedundantFieldLength).IsRequired(false).HasComment("åä½å段1 - é¢çæ©å±ç¨é"); |
| | | b.Property(x => x.RedundantField2).HasMaxLength(WmsAreaConsts.MaxRedundantFieldLength).IsRequired(false).HasComment("åä½å段2 - é¢çæ©å±ç¨é"); |
| | | b.Property(x => x.RedundantField3).HasMaxLength(WmsAreaConsts.MaxRedundantFieldLength).IsRequired(false).HasComment("åä½å段3 - é¢çæ©å±ç¨é"); |
| | | b.Property(x => x.StoreCode).HasMaxLength(WmsAreaConsts.MaxStoreCodeLength).IsRequired(false).HasComment("ä»åºä»£ç "); |
| | | b.Property(x => x.StoreName).HasMaxLength(WmsAreaConsts.MaxStoreNameLength).IsRequired(false).HasComment("ä»åºåç§°"); |
| | | b.Property(x => x.Sort).HasComment("æåº"); |
| | | b.Property(x => x.Remark).HasMaxLength(WmsAreaConsts.MaxRemarkLength).IsRequired(false).HasComment("夿³¨"); |
| | | b.Property(x => x.IsDisabled).IsRequired(false).HasComment("æ¯å¦ç¦ç¨"); |
| | | |
| | | // Indexes |
| | | b.HasIndex(u => u.AreaName); |
| | | |
| | | // Apply object extension mappings |
| | | b.ApplyObjectExtensionMappings(); |
| | | }); |
| | | } |
| | | } |