Database temporarily generate and increment Id
MG1376 opened this issue · 0 comments
MG1376 commented
this is part of my base entity:
public abstract class EntityBase
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
still I need to set a unique Id in my entity so that it can be added and saved, While this feature is what I want (since I want to sync with my server and save server generated items locally), Occasionally I want to add an item and database generate an Id.
is there any EF core and linq way to do this?