About
…its me… Morshed Anwar. Currently working in offshore company as a Software Engineer . I have lil more work experiences with Java and .Net platform.Here I am going to share my lil knowledge(?!!) and I am just starting to bolg that to documented my activites and will try to keep this regular.



I still have the same pblm during rollback:
Store update, insert, or delete statement affected an unexpected number of rows (0). Entities may have been modified or deleted since entities were loaded. Refresh ObjectStateManager entries.
please try to help me solve this pblm.
Hema
May 11, 2009
as u said – Store update, insert, or delete statement affected an unexpected number of rows (0) .Did u get any excepceptionlike it has already added into the list? if that so then u can try this-
if (null != auditTrailList)
{
foreach (var audit in auditTrailList)
{
ObjectStateEntry _entry;
if (!this.ObjectStateManager.TryGetObjectStateEntry(audit, out _entry))
{
//add into the audit list
this.AddToDBAudit(audit);
}
}
}//end if
and one think that I must have to say , U must ensure that audit will be done in master detail order ….I mean to say master table will be insert first and then detail…..you can use creation time to main tain this as I did …..but If children and master in created at same time then Implement u own EquilityComparer to the objectStatetEntry while creating audit. Very soon I am going to upload a blog on this EquilityComparer which based on Parent-Child relationship of entity models. During roll back U just need to sort the entities in desending oder with CreationTime (named as RevistionStamp in my sample Model).
morshedanwar
May 21, 2009
I came across your article “Implementing Repository Pattern with Entity Framework” and attempted to setup your code and I could not get it to work. I downloaded your sample and it generated the same error as when I worked thorough the sample code on The Code Project. The EntitySet name ‘XXX’ could not be found.
Do you have an updated sample that runs in Visual Studio 2010 built on Entity Framework 4 or do you k now off hand what is causing this error and how I can get rid of it?
Clara
December 18, 2010