ErrorMessage :
Attaching an entity of type \'FaridCRMData.Models.Customer\' failed because another entity of the same type already has the same prim
Try simple change state for entity wich you trying update and SaveChanges()
SaveChanges()
public bool Update(TEntity entity) { context.Entry(entity).State = System.Data.EntityState.Modified; context.SaveChanges(); return true; }