This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "servers": { | |
| "github/github-mcp-server": { | |
| "type": "http", | |
| "url": "https://api.githubcopilot.com/mcp/", | |
| "version": "0.13.0" | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ImmutableStack<int> stack = [1, 2, 3, 4, 5]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [CollectionBuilder(typeof(ImmutableStackBuilder), nameof(ImmutableStackBuilder.Create))] | |
| public class ImmutableStack<T> | |
| { | |
| private readonly ImmutableList<T> _items; | |
| internal ImmutableStack(){} | |
| internal ImmutableStack(ImmutableList<T> items) | |
| { | |
| _items = items; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var stack = new ImmutableStack<int>(new[] { 1, 2, 3, 4, 5 }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class ImmutableStack<T> | |
| { | |
| private readonly ImmutableList<T> _items; | |
| public ImmutableStack(IEnumerable<T> items) | |
| { | |
| _items = ImmutableList.CreateRange(items); | |
| } | |
| // Stack operations... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int[] numbers = [1, 2, 3, 4, 5]; | |
| List<string> names = ["Alice", "Bob", "Charlie"]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| new ServiceProviderOptions | |
| { | |
| ValidateOnBuild = true, | |
| ValidateScopes = true // Enabled by default in Development | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var builder = WebApplication.CreateBuilder(args); | |
| builder.Services.AddScoped<OrderService>(); | |
| // Still forgot IPaymentProcessor... | |
| // Enable validation | |
| builder.Host.UseServiceProviderFactory(new ServiceProviderFactory( | |
| new ServiceProviderOptions | |
| { | |
| ValidateOnBuild = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| services.AddScoped<OrderService>(); // Depends on IPaymentProcessor | |
| // Oops! Forgot to register IPaymentProcessor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [AllowAnonymous] | |
| public class HomeController : Controller | |
| { | |
| public IActionResult Index() | |
| { | |
| return View(); | |
| } | |
| [AllowAnonymous] | |
| public IActionResult About() |
NewerOlder