paul1956 / CSharpToVB

New version of CSharpToVB converter
MIT License
25 stars 9 forks source link

private_set propertes is converted to public properties #21

Closed VBAndCs closed 4 years ago

VBAndCs commented 4 years ago

This C# code

public string BuyerId { get; private set; }

is converted to:

Public Property BuyerId As String

but it should be:

Dim _buyerId As String
Public Property BuyerId As String
   Get
       Return _buyerId
   End Get

   Private Set(value As String)
       _buyerId = value
   End Set
End Property
paul1956 commented 4 years ago

@VBAndCs I will post a fix for this case tonight. I don't know if it will fix all cases and some comments may be removed (needs more tests) also more comments were picked up around Properties. For MustOverride (Abstract) I don't think VB allows different modifiers for Get and Set. If it is allowed please proved syntax, right now I continue to convert as before.