When specifying a given id to an entity before persisting it using a dynamic data store in episerver, the entity is not persisted. According to tutorials I have seen this should have been just fine. Any clues? No exceptions are thrown, and the Save call returns the Id of the entity I specified the id of.
var winnerEntity = new DailyXMasLotteryWinner
{
Id = Identity.NewIdentity(guid),
FullName = fullName,
Email = email,
Phone = phone,
WinnerTime = DateTime.Now
}
winnerStore.Save(winnerEntity); // does not persist to database!
winnerStore.Items().Count() == 0;
winnerEntity.Id = null;
winnerStore.Save(winnerEntity); // persists to database just fine!
winnerStore.Items().Count() == 1;
I'm not aware of your patterns but this is how I typically implement DDS
Tested with this
And it works
Obviously you should adapt this to your patterns, if it doesn't work it would probably be your database user that has insufficient rights.