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
  •  | 
  •  

문제

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?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top