C# - Serializing and Deserializing Linq Tables whilst maintaining Relationships -
I want to test my code! A great goal I'm sure is you agree.
I need to fool the datacontactors for my regression tests, by running a test, it will be verified that for any code change, we produce the same input to the same input. / P>
I'm mimicking my data references. It's awesome and simple, I recommend it, I can take it if it's much lighter but it's another story.
To get the data for me, I want to serialize a small amount of data stored in an MSSQL DB. To allow linux-to-SQL classes to be serialized, I've instructed the serialization mode property to set unidirectional set as the set. This allows me to serialize a line on the XML.
When I want to serial a table, I must call ToList () and drag it to the first memory. This is because Linq.Data.Table is not automatically serialized .
So now I have a file for each table, then I can decrypt XML, create Linq tables with files and lists, then we make a representative and use it for imitating the data reference. Do it in the form. All this has clearly been explained.
I have problems with maintaining relationships between tables, how can I serial a line with all its dependencies and then deserialize in such a way that they are still accessible .
Example
- I have Tables customers and purchases in my Live DB
- Many people are present in one customer Relation to purchase from
-
In the application code I want to test as I use syntax;
var firstCustomerPurchases = Customer.First (). Purchase
-
This will not work as customer with my MockDataContext in my test cases and purchases are just lists that are not bound to each other.
Post text "itemprop =" text ">
Have you thought about converting your Linux table into a dataset, which maintains the Nd relationships that are serialable?
Comments
Post a Comment