I have a property in my model where it automatically generates the Id when it is inserted in Db, but I have a specific case where I need to put the Id manually, is there any way to prevent EF from generating the automatic Id if I create and send the object with the fixed Id ignores it and generates a new one.
My question is: Is it possible to save an option to bypass automatic generation? In a specific case I need this, in the others the generation should be automatic as is the code below. Just to clarify, the problem is in the database Seed, where I need to add a user with fixed Id where it is related to the properties and other relationships of another system, in the others will be generated automatically therefore: I can not remove this automatic ID generation property.
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public override Guid Id
{
get => base.Id;
set => base.Id = value;
}