Skip to content

Instantly share code, notes, and snippets.

@rionmonster
Created April 4, 2016 22:00
Show Gist options
  • Save rionmonster/4641b5e04f50b12a04e138dcb6372002 to your computer and use it in GitHub Desktop.
Save rionmonster/4641b5e04f50b12a04e138dcb6372002 to your computer and use it in GitHub Desktop.
public COMP UpdateComp(COMP newObj, int idOriginal)
{
var original = _context.Comps.FirstOrDefault(m => m.ID == idOriginal);
// Update these properties using your new information
original.CHECKLISTs = newObj.CHECKLISTs;
original.Division = newObj.Division;
_context.SaveChanges();
// When you return the original it should have those changes made
return original;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment