0

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.

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
chris stevens
  • 316
  • 4
  • 14
  • Are you sure there is a value for the Guid property? Could it be that the property is of type nullable Guid (Guid?) and you have mapped it to a non-nullable column, and the value is not set? – alwayslearning Jul 11 '13 at 11:39

1 Answers1

3

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.

Dimitar Tachev
  • 575
  • 4
  • 14