Example #1
0
        /// <summary>
        /// 实体-创建property
        /// </summary>
        public void DynamicPropertyTest4()
        {
            var contractProperty      = _dynamicPropertyManager.Get("CompanyName");
            var dynamicEntityProperty = new DynamicEntityProperty
            {
                DynamicPropertyId = contractProperty.Id,
                EntityFullName    = typeof(Contract).FullName
            };

            _dynamicEntityPropertyManager.Add(dynamicEntityProperty);
        }
        public static DynamicEntityProperty Add <TEntity, TPrimaryKey>(this IDynamicEntityPropertyManager manager, int dynamicPropertyId, int?tenantId)
            where TEntity : IEntity <TPrimaryKey>
        {
            var entity = new DynamicEntityProperty()
            {
                DynamicPropertyId = dynamicPropertyId,
                EntityFullName    = typeof(TEntity).FullName,
                TenantId          = tenantId
            };

            manager.Add(entity);
            return(entity);
        }
 public static DynamicEntityProperty Add <TEntity, TPrimaryKey>(this IDynamicEntityPropertyManager manager, DynamicProperty dynamicProperty, int?tenantId)
     where TEntity : IEntity <TPrimaryKey>
 {
     return(manager.Add <TEntity, TPrimaryKey>(dynamicProperty.Id, tenantId));
 }
 public static DynamicEntityProperty Add <TEntity>(this IDynamicEntityPropertyManager manager, int dynamicPropertyId, int?tenantId)
     where TEntity : IEntity <int>
 {
     return(manager.Add <TEntity, int>(dynamicPropertyId, tenantId));
 }