ErrorMessage :
Attaching an entity of type \'FaridCRMData.Models.Customer\' failed because another entity of the same type already has the same prim
have you tried to mark your entity as modified BEFORE attach it to the context?
like this:
public bool Update(TEntity entity)
{
var entry = context.Entry(entity);
if (entry.State == EntityState.Detached || entry.State == EntityState.Modified)
{
entry.State = EntityState.Modified; //do it here
context.Set().Attach(entity); //attach
context.SaveChanges(); //save it
}
return true;
}