Hi,
I have an Entity that I am running the Save() method on. I have used this method of saving entities since I started using the pro tool with no problems however, I have come up against an issue that someone may be able to help with.
The only difference I can see with this entity compared to my other entities is that the entity contains a binary field, but dont believe this to be the problem.
When I call the Save() method the entity is in fact saved to the database and the new System.Guid is generated accordingly in the database, so in other works the Save works
When I examine the object after this save the Primary key (The System.Guid) has not been updated, I am sure this happens in all my other classes.
The System Guid is defined as a primary key and has default value (newid()) and is a row uid. I have placed the code below, and have checked that the Save() method returns true and also called a refetch() after the Save() but still no Guid.
Hope someone can help or point me in the right direction.
Cheers
Rich
OnlinePurchasePendingEntity pending = new OnlinePurchasePendingEntity();
pending.PendingCreated = DateTime.Now;
pending.PendingProvider = provider;
pending.UserUid = user.UserUID;
MemoryStream ms = new MemoryStream();
// create a new BinaryFormatter instance
BinaryFormatter b = new BinaryFormatter();
// serialize the class into the MemoryStream
b.Serialize(ms, purchase);
ms.Seek(0,0);
pending.PendingPurchaseObj = ms.ToArray();
pending.Save();
return pending;