C# – Entity SaveChanges() for both insert and update

centity-framework

I'm having a function that should both update and insert, using the entity framework.

Was wondering if SaveChanges should be used in both cases?

if(Something == newThingy)
//do something
myobj.SaveChanges();

or is it done differently?
/M

Best Answer

Yes, it should.