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?
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();
-
0
What about integer autoincrement?
-
0
Hi,
You dont have to do anyting for integers. It's auto increment by default. Do you have any problem about it ?
-
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.