我非常喜歡Cassandra。我發現很難對附加的XML文件建模。從XML和C建模Cassandra#
我的要求是:
- 我得到很多的XML文件,每天都在下面給出。我需要編寫一個C#程序來讀取XML並存儲在Cassandra中。
- 一旦存儲,數據將由1000年的客戶讀取1000次。一旦數據被存儲,它不會再被更新。
注意:每個父節點(例如:客戶/站點...)可能會出現更多的不可能。的時代。即我可能有顧客2,站點2,另一EquipmentDetails節點等
我的XML:
<?xml version="1.0" standalone="yes"?>
<MyAnalystXMLReport>
<MC-DomainID ID="XYZ123">
<Customer Name="CUSTOMER1" ID="53043">
<Site Name="SITE1" ID="488688">
<EquipmentDetails>
<EquipmentDescription>Test Desc</EquipmentDescription>
<EquipmentRefId>T3567111</EquipmentRefId>
<ComponentDescription>COM Oil</ComponentDescription>
<ComponentRefId>
</ComponentRefId>
<AnanlystNo>1235LKJU</AnanlystNo>
<ComponentType>TestComp</ComponentType>
<Sample SampleNo="976023696">
<SampleCondition>USUAL</SampleCondition>
<AnalysisComments>Test Comments</AnalysisComments>
<DateRecieved>2015-12-10</DateRecieved>
<DateAnalysed>2015-12-18</DateAnalysed>
<EquipmentLife>
</EquipmentLife>
<LubricantLife>
</LubricantLife>
<TopUpVolume>0</TopUpVolume>
<FuelUsed>
</FuelUsed>
<Tests>
<TestGroup Name="Group NAME1" ID="667">
<Test Name="Test Name1" ID="1785">
<Result>171.3</Result>
</Test>
</TestGroup>
<TestGroup Name="Group NAME2" ID="617">
<Test Name="Test NAME2" ID="1763">
<Result>153.40</Result>
</Test>
</TestGroup>
</Tests>
</Sample>
</EquipmentDetails>
</Site>
</Customer>
</MC-DomainID>
</MyAnalystXMLReport>
如何將我這個XML在有效的方式進行建模來實現這一要求? 什麼是最簡單的方法來存儲這個數據數據數據數據&模型在卡桑德拉使用C#。任何例子將不勝感激。
感謝您的幫助。