-
Notifications
You must be signed in to change notification settings - Fork 1.6k
make AddRange method example more readable #11910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
make AddRange method example more readable #11910
Conversation
Would it be better to remove the project file? It causes namespace conflicts. The same issue happens with #11781. |
Go for it @StuartMosquera |
snippets/csharp/System.Collections.Generic/ListT/.ctor/source1.cs
Outdated
Show resolved
Hide resolved
Sorry, that's the whole point of that Snippets 5000 status check. We should add back the project file and use different names to fix the build warnings. |
Yeah, it's compiling the folder via that project file. Simply change the names of the classes (or make them partial) and get the code compiling. This way we make sure we ship accurate code. |
Imports System.Collections.Generic | ||
|
||
Public Class Example | ||
Partial Public Class Example |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't want to sound like archeologist but there are also dinosaurs in this file
|
||
public class Example | ||
public partial class Example | ||
{ | ||
public static void Main() | ||
public static void ShowFruits() | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use top-level statements here
Partial Public Class Example | ||
|
||
Public Shared Sub Main() | ||
Public Shared Sub ShowDinos() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here
Summary
AddRange
method of theList<T>
class by replacing dinosaur names with fruits to enhance readability, for both C# and VB.NET.Fixes #11833