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
| using BenchmarkDotNet.Attributes; | |
| using BenchmarkDotNet.Columns; | |
| using BenchmarkDotNet.Configs; | |
| using BenchmarkDotNet.Jobs; | |
| using BenchmarkDotNet.Reports; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| namespace Benchmarks | |
| { |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| class Program | |
| { | |
| static void Main() | |
| { | |
| var payments = new List<Payment> | |
| { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using Xunit; | |
| public class StringReverser | |
| { | |
| // Method 1: Concise Implementation (2 lines) | |
| // Contract: Reverse the input string and return the result. | |
| public static string ReverseStringConcise(string input) |
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
| using System.Security.Cryptography; | |
| using System.Text; | |
| using System.Text.Json; | |
| using Microsoft.AspNetCore.Http; | |
| using Microsoft.AspNetCore.Mvc; | |
| using Microsoft.Azure.Functions.Worker; | |
| using Microsoft.Extensions.Logging; | |
| namespace AZFunctionsGHWebhooksDemo; |
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
| // appsettings.json (Configuration) | |
| { | |
| "BankingOptions": { | |
| "SavingsInterestRate": 3.5, | |
| "LoanLimit": 50000, | |
| "MinimumBalance": 1000 | |
| } | |
| } | |
| // BankingService.cs (Service that Reads Configuration Directly) |
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
| using Xunit; | |
| using System.Collections.Generic; | |
| public static class FizzBuzz | |
| { | |
| public static string GetOutput(int number) | |
| { | |
| return number switch | |
| { | |
| _ when number % 15 == 0 => "FizzBuzz", |
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
| using System; | |
| using Xunit; | |
| public class ListNode | |
| { | |
| public int Value; | |
| public ListNode Next; | |
| public ListNode(int value = 0, ListNode next = null) | |
| { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| using Microsoft.AspNetCore.Mvc; | |
| var builder = WebApplication.CreateBuilder(args); | |
| // 1. Define the Pricing Strategy Interface | |
| public interface ITicketPricingStrategy | |
| { | |
| decimal CalculatePrice(int basePrice, int seatTier); |