0
andry3ag created
When creating new entities, is there any way to specify that an Id should be auto-incremented, or in the case of uniqueidentifier/GUID, invoke NEWID() as a default value?
Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)
4 Answer(s)
-
0
Hi,
You can define a base entity class which inherits from Entity<Guid> and set it's id property on constructor to new Guid();
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
What about integer autoincrement?
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi,
You dont have to do anyting for integers. It's auto increment by default. Do you have any problem about it ?
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi,
As Halil pointed out, there is also no need to set Guid identity fields. Because it's generated by abp with sequential guid generator.
It has better performance than regular guid generation.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)