When creating entity model types for consumption by Auto-Entity, the @Entity decorator is required. Currently, that decorator in turn requires an IEntityOptions object to be passed with at least a modelName string property. For many simpler use cases, the model name may be the only property required.
This proposal recommends that the @Entity decorator be enhanced to support simpler usage, by requiring either a string for the model name, or the full IEntityOptions object, be passed in. This would allow simple usage as follows:
@Entity('MyEntity')
export class MyEntity {
@Key id: number;
}
When creating entity model types for consumption by Auto-Entity, the
@Entity
decorator is required. Currently, that decorator in turn requires anIEntityOptions
object to be passed with at least amodelName
string property. For many simpler use cases, the model name may be the only property required.This proposal recommends that the
@Entity
decorator be enhanced to support simpler usage, by requiring either a string for the model name, or the fullIEntityOptions
object, be passed in. This would allow simple usage as follows: