In datasets there was a method WriteXml or ReadXml
Does anyone have any idea on how to this with Entity Framework?
Has anyone implemented this before?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Well basically I wanna have a back up of my database in XML, and I don’t want this backup to be handled from the server but from the application.
I think I will handle the event that is fired in the context and then save my data.
As I expext the xml file size not to grow too match (will hold like 100-300 small entity records of simple short data types), I decided to work synchronously against the XML DB:
Here is the partial class of the strongly typed dta set:
BTW, If you bother your self so I even made a quick perfoance test just to get an indication (don’t rely, it’s a very abstract test, test again if you ever intend to create an XmlDb of larger files!).
consider also that this file doesn’t test the xml file for external changes, can be good for a win application, in ASP.NET or when you want to allow multi requests, consider a way to implement checking on changes for the existing application, or making a DAL DLL that has a queue of committing changes.
24.8 seconds, big ah?
wanna hear how big is the xml file? 2062857146 bytes which is 1967.2938785553 MB