Designing WCF DataContract Classes Using the LINQ to SQL Designer - Inheriting WCF DataContract classes visually using LINQ to SQL Designer
(Page 4 of 5 )
In the previous sections, we have seen how to work with "DataContract" classes using the "LINQ to SQL Designer." In this section, I will extend the same with inheritance.
We can also inherit existing DataContract classes and create new sub DataContract classes visually using the "LINQ to SQL Designer." Open the previously-created "EmpViews.dbml" and create a new class (EnameDnameSal) with inheritance as shown below:

Once it is created, we should have a new class created in "EmpViews.Designer.vb" as follows:
<DataContract()> _
Partial Public Class EnameDnameSal
Inherits EnameDname
Private _Sal As Double
Public Sub New()
MyBase.New
End Sub
<Column(Storage:="_Sal"), _
DataMember(Order:=1)> _
Public Property Sal() As Double
Get
Return Me._Sal
End Get
Set
If ((Me._Sal = value) _
= false) Then
Me._Sal = value
End If
End Set
End Property
End Class
In the above class, you must observe the "inherits" statement in the class declaration. It is automatically added by the designer!
Next: Inheriting WCF DataContract classes visually using the LINQ to SQL Designer: accessing >>
More Windows Scripting Articles
More By Jagadish Chaterjee