Given the following auto generated code:-
VB Code:
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.42000 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict Off Option Explicit On Namespace test Partial Public Class Duncan_s_Class_Test #Region "Private members" Private _Email As String Private _Height__cm As Integer Private _Blood_Alcohol As Decimal #End Region Sub New(ByVal DuncansClassIn As IDuncansClass) MyBase.New _Email = DuncansClassIn.Email _Height__cm = DuncansClassIn.Height__cm _Blood_Alcohol = DuncansClassIn.Blood_Alcohol End Sub Sub New(ByVal Email_In As String, ByVal Height__cm_In As Integer, ByVal Blood_Alcohol_In As Decimal) MyBase.New _Email = Email_In _Height__cm = Height__cm_In _Blood_Alcohol = Blood_Alcohol_In End Sub '''<summary> '''Email address of the user '''</summary> Public ReadOnly Property Email() As String Get Return _Email End Get End Property '''<summary> '''Recorded height in cm '''</summary> Public ReadOnly Property Height__cm() As Integer Get Return _Height__cm End Get End Property '''<summary> '''Recorded blood/alcohol '''</summary> Public ReadOnly Property Blood_Alcohol() As Decimal Get Return _Blood_Alcohol End Get End Property End Class End Namespace
Which constructor type do you prefer - individually explicitly named properties or instance of interface?




Reply With Quote