Linq2SQL Link Types

I have an object with a NameValueCollection property that I am manipulating Linq2SQL with. I was going to serialize it to an XML (xelement) column in the DB. My problem is that I don't actually have a hook to convert it to XML for persistence using Linq2SQL. I believe I can use the OnLoaded method to control the deserialization.

Does anyone have a good method for reference types that are stored in an XML column with Linq2SQL? I don't want to create a new table for this property.

Thank!

+1


source to share


1 answer


I solved this by using the extension methods OnLoaded () and OnValidate () to load and serialize my reference types into an XElement object. This seems to have worked well enough and now I have a way to store the NameValueCollection in our database.



+1


source







All Articles