EasyAbp / AbpHelper.CLI

Providing code generation and more features to help you develop applications and modules with the ABP framework.
MIT License
285 stars 95 forks source link

Support no primary key entity code generation #54

Closed gdlcf88 closed 4 years ago

gdlcf88 commented 4 years ago

The entity code:

public class ResourceItemContent : FullAuditedEntity
{
        public virtual Guid ResourceItemId { get; protected set; }

        [NotNull]
        public virtual string Content { get; protected set; }

        public override object[] GetKeys()
        {
            return new object[] {ResourceItemId};
        }
}

Problem 1: Wrong base class. image image

Problem 2: Need to set b.HasKey(), or the migration will not work well. But how do we know what the keys are? (Only GetKeys() in entity class know this information) image