Last post Jan 23, 2013 11:48 AM by adscnet
Jan 23, 2013 10:06 AM|adscnet|LINK
Kindly can anyone help in converting the below C# code to VB.net?
Private ReadOnly ProductContext _db = new ProductContext();
Public IQueryable<ToyCategory> GetCategories()
Online converters says there is an error in the syntax.
Jan 23, 2013 10:39 AM|David Anton|LINK
There is a problem with that syntax - the " : base ..." portion should be place before the opening brace, not after it.
After you correct for that it converts to the following:
'INSTANT VB WARNING: The following constructor is declared outside of its associated class:
'ORIGINAL LINE: Public ProductContext()
Public Sub New()
Private Private ReadOnly _db As New ProductContext()
Public Function GetCategories() As IQueryable(Of ToyCategory)
Jan 23, 2013 11:48 AM|adscnet|LINK
Thanks David for your help.