Assigning values in primary key field

Sep 9, 2015 at 4:35 PM
Edited Sep 9, 2015 at 10:04 PM
Hi,

I'm working with SqlCe and latest release (1.0.14007) trying to assign myself the value for a primary key field (not using identity), but without success.

I defined the KeyScheme as KeyScheme.None, and assigning the primary key field before inserting in the DataStore:
    [Entity(KeyScheme = KeyScheme.None, NameInStore="Table1")]
    public class ceTable1
    {

        [Field(IsPrimaryKey = true, AllowsNulls = false)]
        public int Id { get; set; }

    }
    ceTable1 ceTable1 = new ceTable1();
    ceTable1.Id = myIdVariable;

    DataContext.DataStore.Insert(ceTable1);
But apparently it's not taking the Id value, the insert fails with:
 The column cannot contain null values. [ Column name = Id,Table name = Table1 ]
What am I missing?

TIA