schangxiang@126.com
2025-05-13 25246d39da4b74b54a844b36d8a50752917b81cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using CMS.Plugin.HIAWms.Domain.Shared;
using Volo.Abp.Threading;
 
namespace CMS.Plugin.HIAWms.EntityFrameworkCore;
 
/// <summary>
/// EfCore实体扩展
/// </summary>
public static class CMSPluginEfCoreEntityExtensionMappings
{
    private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner();
 
    /// <summary>
    /// Configures this instance.
    /// </summary>
    public static void Configure()
    {
        CMSPluginModuleExtensionConfigurator.Configure();
 
        OneTimeRunner.Run(() =>
        {
            /* You can configure extra properties for the
             * entities defined in the modules used by your application.
             *
             * This class can be used to map these extra properties to table fields in the database.
             *
             * USE THIS CLASS ONLY TO CONFIGURE EF CORE RELATED MAPPING.
             * USE CMSModuleExtensionConfigurator CLASS (in the Domain.Shared project)
             * FOR A HIGH LEVEL API TO DEFINE EXTRA PROPERTIES TO ENTITIES OF THE USED MODULES
             *
             * Example: Map a property to a table field:
 
                 ObjectExtensionManager.Instance
                     .MapEfCoreProperty<WmsContainer, string>(
                         "MyProperty",
                         (entityBuilder, propertyBuilder) =>
                         {
                             propertyBuilder.HasMaxLength(128);
                         }
                     );
 
             * See the documentation for more:
             * https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Extending-Entities
             */
        });
    }
}