Since the answer from @Mark Oreta isn't complete:
Following the link he posted and reading the whole post revealed some different information: So DbContext.Entry(someEntity) actually is attaching the entity to the context if you set the correlating EntityState you need.
To attach a modified or added entity you could do:
using(var yourDbContext = new YourDbContext())
{
yourDbContext.Entry(yourEntity).State =
yourEntity.ID == 0 ?
System.Data.Entity.EntityState.Added :
System.Data.Entity.EntityState.Modified;
}
To attach an unmodified entity you could do:
using(var yourDbContext = new YourDbContext())
{
yourDbContext.Entry(yourEntity).State = System.Data.Entity.EntityState.Unchanged;
}