Note that there are some explanatory texts on larger screens.

plurals
  1. POVB.Net 'Overridable' is not valid on a member variable declaration
    text
    copied!<p>I'm using several code converters which produce the same VB.Net coding but VS will not except this line of code:</p> <pre><code>Private Overridable m_Products As ICollection(Of Product) </code></pre> <p>VS states:</p> <p>'Overridable' is not valid on a member variable declaration.</p> <p>The C# coding is from a tutorial on the ASP.Net web site at:</p> <pre><code>http://www.asp.net/web-forms/tutorials/aspnet-45/getting-started-with-aspnet-45-web-forms/create_the_data_access_layer </code></pre> <p>VS also states I should remove the Overridable keyword. If I do that, will I break something in the tutorial? </p> <p>This is the C# coding I'm running through the converters:</p> <pre><code>using System.Collections.Generic; using System.ComponentModel.DataAnnotations; namespace WingtipToys.Models { public class Category { [ScaffoldColumn(false)] public int CategoryID { get; set; } [Required, StringLength(100), Display(Name = "Name")] public string CategoryName { get; set; } [Display(Name = "Product Description")] public string Description { get; set; } public virtual ICollection&lt;Product&gt; Products { get; set; } } } </code></pre> <p>This is the result of the conversion:</p> <pre><code>Imports System.Collections.Generic Imports System.ComponentModel.DataAnnotations Namespace WingtipToys.Models Public Class Category &lt;ScaffoldColumn(False)&gt; _ Public Property CategoryID() As Integer Get Return m_CategoryID End Get Set m_CategoryID = Value End Set End Property Private m_CategoryID As Integer &lt;Required, StringLength(100), Display(Name := "Name")&gt; _ Public Property CategoryName() As String Get Return m_CategoryName End Get Set m_CategoryName = Value End Set End Property Private m_CategoryName As String &lt;Display(Name := "Product Description")&gt; _ Public Property Description() As String Get Return m_Description End Get Set m_Description = Value End Set End Property Private m_Description As String Public Overridable Property Products() As ICollection(Of Product) Get Return m_Products End Get Set m_Products = Value End Set End Property Private Overridable m_Products As ICollection(Of Product) End Class End Namespace </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload