Is there any way I can put Public Properties on a single line in VB.NET like I can in C#? I get a bunch of errors every time I try to move everything to one line.
C#:
public void Stub{ get { return _stub;} set { _stub = value; } }
VB.NET
Public Property Stub() As String
Get
Return _stub
End Get
Set(ByVal value As String)
_stub = value
End Set
End Property
Thanks
EDIT: I should have clarified, I’m using VB 9.0.
You can use automatically implemented properties in both VB 10 and C#, both of which will be shorter than the C# you’ve shown:
For non-trivial properties it sounds like you could get away with putting everything on one line in VB – but because it’s that bit more verbose, I suspect you’d end up with a really long line, harming readability…