Click here to Skip to main content
14,207,916 members
Click here to Skip to main content
Articles » Web Development » ASP.NET » General » Alternatives
Alternatives (1)
Add your own
alternative version


2 bookmarked
Posted 24 Oct 2011
Licenced CPOL

Extension Method to help with EF Code First updating

, 24 Oct 2011
An Extension Method that might help you copy over the values from one object to another, provided they are of the same type.


Members may post updates or alternatives to this current article in order to show different approaches or add new features.

1 Nov 2011
Daniel Lo Nigro
As far as I know, the "UpdateModel" method is designed to do this. Something like this should work, but I haven't tested it:public ActionResult Edit(Entity entity){ var entityInDbSet = _context.Set.SingleOrDefault(x => x.Id == entity.Id); UpdateModel(entityInDbSet); ...


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

George Danila
Software Developer (Junior) IT Perspectives
Romania Romania
No Biography provided

| | Privacy | Cookies | Terms of Use | Mobile
Web06 | 2.8.190612.1 | Last Updated 24 Oct 2011
Article Copyright 2011 by George Danila
Everything else Copyright © CodeProject, 1999-2019
Layout: fixed | fluid