Question

I am trying to add a relatively simple entity via Telerik.OpenAccess.

One property of this entity is a GUID set via c#'s GUID.NewGuid().

The property is set fine right before the call to SaveChanges() but then looking in SQL Profiler the value is all 0's.

Anyone experienced this? Couldn't find any advice here or on Telerik's forums and am not sure how to progress.

Was it helpful?

Solution

I suppose that the GUID column is an identity column of your table and the Telerik OpenAccess ORM is configured to leave the SQL Server populating the identity column value.

In order to change this configuration you could select the problematic class in the Visual Designer, press F4 to open its properties window and set its Identity Mechanism to Default. Most probably it is currently set to DatabaseServerCalculated as a default one using the database first scenario:

enter image description here

In this way OpenAccess ORM will respect the given value before calling the SaveChanges method instead of waiting for the Server to populate the column.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top