Hello,
I have a tabel with an Identity Key column:
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Behörde_ID { get; set; }
the problem is that there are a key row with value = 0 and the concurrency checking in the CreateBehörde checks with the value = 0
var existingItem = Context.Behördes
.Where(i => i.Behörde_ID == behörde.Behörde_ID)
.FirstOrDefault();
if (existingItem != null)
{
throw new Exception("Item already available");
}
how to tell EF to check not with 0 but with another value (-1)
robert