ディスクから読み取った XML ファイルから、WCF Data Service と Entity Framework を介してデータベースを更新したいと考えています。XML ファイルを読み取るために DataSet を使用していますが、Entity Framework 部分を介してデータセットからデータベースを更新する方法がわかりません。私は DataSet を使用して XML を読み取っていますが、それは非常にうまく機能するためですが、Entity Framework を介してデータベースに XML を読み取る別の方法があれば、それは素晴らしいことです。私が欲しいコードは次のようになります。
private void AddToDBFromXMLFile(string xmlFile)
{
// this is reading my XML just fine, but i suspect there is another way to
// get the XML into the
// database, otherwise how can I get the XML into the database via the EF?
DataSet dataSet = new DataSet();
dataSet.ReadXml(xmlFile, XmlReadMode.InferSchema);
// this is working and can update and retrieve my data using the usual methods
var proxy = new TestApp.ServiceReference.TestEntities(new
Uri("http://localhost:4976/TestWcfDataService.svc/"));
// how do I update the database from the dataset?
//proxy << dataset
}