I'm not sure what you are trying to do here. Basically this expression confuses me:
db, .
(.. ) ? , ?
EntityKey, .
, .AddObject, .Attach.
INSERT :
var newFoo = new Foo();
ctx.Foos.AddObject(newFoo);
newFoo.SaveChanges();
UPDATE :
var existingFoo = ctx.Foos.SingleOrDefault(x => x.Id == 1);
existingFoo.Name = "Changed foo";
newFoo.SaveChanges();
:
var existingFoo = new Foo();
existingFoo.Name = "Foo name";
ctx.Foos.Attach(existingFoo);
ctx.SaveChanges();
, , :
objContext.TheLargeObjects.Attach(newObject);
objContext.SaveChanges();
, , , , , .Attach. , , .AddObject.
, - , .SaveChanges().
.Attach , -, , .Attach .
, .