views:

77

answers:

0

Hello all,

I have a situation where an XML file contains data similar to some content in database tables, and I would need to update the database to match exactly the contents of that XML file. I am wondering, if using NHibernate, or LINQ to SQL, I am able to do something like this:

  1. Load the database content into entity objects.
  2. Load the changes from XML into those same entity objects, so that changes are somehow identified.
  3. Call save(), which would update the database content to match the situation in the XML files. This last step should only write the necessary changes to the database.

The database tables contain an auto-incremented identity field, but that identity field should be ignored, as it is missing/incorrect in the XML files: instead a string value with a unique constraint should be used as the "identity key" for the changes.

I am wondering, if NHibernate, LINQ, or some other framework is able to do this comfortably for me. A complete solution is not necessary, of course, but some pointers at what to look at, or where to get started, are appreciated.