How do we give default value to Primary Key fields in websites created through ASP.NET Dynamic Data (Entities)

StackOverflow https://stackoverflow.com/questions/14221943

  •  14-01-2022
  •  | 
  •  

Frage

I am creating ASP.NET Dynamic Data Site (using entities) to manage master tables of my application. All my master table has a Primary Key of "UniqueIdentifier" in SQL Server. Where should I write "Guid.NewGuid()" in order to give default value (as new Guid) and to show them in textboxes bound with these fields?

War es hilfreich?

Lösung

ok, I found the solution myself. We need to open EDMX file, and ID property in each entity needs to be have StoreGeneratedPattern="Computed"

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top