Code First Friendly XSD Transform
I am new to actually using EF (started yesterday) and xsd files so please
bear with me. I have a form.vb class I created from a schema through the
use of the Microsoft tool xsd. This is a snippet of a very small portion
of this FORM class, since the generated file was around 2000 lines long. I
am using this class to de-serialize a message we get through a WCF.
I wish to use the Entity Framework to create the tables and key
relationships using the generated class. It works great with a test DB I
setup to play with this idea. However the issue is how to deal with the
array fields like Page().
I am not having much hope with this, but is there a tool to modify this
xsd file so that EF would cleanly be able to create a database
relationship using my form.vb? Would the modified form.vb still be able to
de-serialize the message from the WCF?
<System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.17929"), _
System.SerializableAttribute(), _
System.Diagnostics.DebuggerStepThroughAttribute(), _
System.ComponentModel.DesignerCategoryAttribute("code"), _
System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True), _
System.Xml.Serialization.XmlRootAttribute([Namespace]:="",
IsNullable:=False)> _
Partial Public Class FORM
Private _ID As Integer
Private pageField() As Page
Private companyField As String
Public Property ID As Integer
Get
Return Me._ID
End Get
Set(value As Integer)
Me._ID = value
End Set
End Property
<System.Xml.Serialization.XmlElementAttribute("Page")> _
Public Property Page() As Page()
Get
Return Me.pageField
End Get
Set(value As Page())
Me.pageField = value
End Set
End Property
<System.Xml.Serialization.XmlAttributeAttribute()> _
Public Property company() As String
Get
Return Me.companyField
End Get
Set(value As String)
Me.companyField = value
End Set
End Property
End Class
No comments:
Post a Comment