Skip to content

unlock LangVersion latest for all c# snippets #46228

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions samples/snippets/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<LangVersion Condition="$(MSBuildProjectExtension) == '.csproj'">latest</LangVersion>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
using System;

namespace Prime.Services
namespace Prime.Services;

public class PrimeService
{
public class PrimeService
public bool IsPrime(int candidate)
{
public bool IsPrime(int candidate)
if (candidate < 2)
{
if (candidate < 2)
{
return false;
}
throw new NotImplementedException("Please create a test first");
return false;
}
throw new NotImplementedException("Please create a test first");
}
}