Can any one explain what does it mean by class User extends Model<UserAttribute UserCreationAttribute> means?

Viewed 16

See Problem Image

If UserCreationAttribute is created by Omiting one field in UserAttribute Why we using both in that Arrow and what does it mean I'm confused.

1 Answers

The first generic parameter UserAttribute is used to control what fields can be in the model and the second one UserCreationAttribute is used to validate a set of fields while creating an instance of this model. Usually a primary key field is omitted from creation attributes because it's auto generated. You should add all optional fields there along with the PK field that are not needed if you create a model instance.
It's your responsibility to define creation attributes as a subset of all attributes that's why it's recommended to use Optional with attributes.

Related