Following is the error message I get:
Store update, insert, or delete statement affected an unexpected number of rows (0). Entities may have been modified or deleted since entities were loaded. See http://go.microsoft.com/fwlink/?LinkId=472540 for information on understanding and handling optimistic concurrency exceptions.
My model consists of few columns, among them two columns which make up the primary key clustered:
[Key]
[Column(Order = 0)]
public string SourceName { get; set; }
[Key]
[Column(Order = 1)]
public string SourceType { get; set; }
Code to update using Entity Framework:
_Entities.SourceInfoes.Attach(entity);
_Entities.Entry(entity).State = EntityState.Modified;
_Entities.SaveChanges();
Can some one help me on how to solve the exception above?
entityis attached without (or with an expired) concurrency token. Not enough details to answer this question. - Gert Arnold