| Method | Mean | Error | StdDev | 
|---|---|---|---|
| Linq | 44.962 ns | 0.5980 ns | 0.5594 ns | 
| ForEach | 5.291 ns | 0.0383 ns | 0.0339 ns | 
  
    
      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
    
  
  
    
  | #!/bin/bash | |
| # This way you can customize which branches should be skipped when | |
| # prepending commit message. | |
| if [ -z "$BRANCHES_TO_SKIP" ]; then | |
| BRANCHES_TO_SKIP=(master develop test) | |
| fi | |
| BRANCH_NAME=$(git symbolic-ref --short HEAD) | |
| BRANCH_NAME="${BRANCH_NAME##*/}" | 
  
    
      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
    
  
  
    
  | namespace Benchmark.Console | |
| { | |
| public class SumNumbersBenchmark | |
| { | |
| private static readonly ExampleService process = new ExampleService(); | |
| [Benchmark] | |
| public void Linq() => process.Linq(); | |
| [Benchmark] | 
  
    
      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.Linq; | |
| namespace Benchmark.Core | |
| { | |
| public class ExampleService | |
| { | |
| public int[] Values = new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; | |
| public void Linq() | 
  
    
      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 ValueObject.Domain.ValueObjects; | |
| namespace ValueObject.Console | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| var nullValue = TelephoneNumber.From(null); // throws exception | |
| var emptyValue = TelephoneNumber.From(""); // throws exception | 
  
    
      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; | |
| namespace ValueObject.Exceptions | |
| { | |
| public class InvalidTelephoneNumberFormatException : Exception | |
| { | |
| public InvalidTelephoneNumberFormatException(string value, string message) : base($"Invalid telephone number format: {value}. {message}") | |
| { | |
| } | |
| } | 
  
    
      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.Text.RegularExpressions; | |
| using ValueObject.Exceptions; | |
| using ValueOf; | |
| namespace ValueObject.Domain.ValueObjects | |
| { | |
| public class TelephoneNumber : ValueOf<string, TelephoneNumber> | |
| { | |
| private const int MinLength = 8; | 
  
    
      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; | |
| namespace ValueObject.Exceptions | |
| { | |
| public class InvalidTelephoneNumberFormatException : Exception | |
| { | |
| public InvalidTelephoneNumberFormatException(string value, string message) : base($"Invalid telephone number format: {value}. {message}") | |
| { | |
| } | |
| } | 
  
    
      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 WeatherService : IWeatherService | |
| { | |
| private readonly HttpClient _httpClient; | |
| public WeatherService(HttpClient httpClient) | |
| { | |
| _httpClient = httpClient; | |
| } | |
| public async Task<WeatherRoot> GetWeatherAsync(WeatherServiceRequest request) | 
  
    
      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
    
  
  
    
  | version: '3.4' | |
| services: | |
| eventstore.db: | |
| image: eventstore/eventstore:20.10.2-buster-slim | |
| environment: | |
| - EVENTSTORE_CLUSTER_SIZE=1 | |
| - EVENTSTORE_RUN_PROJECTIONS=All | |
| - EVENTSTORE_START_STANDARD_PROJECTIONS=true | |
| - EVENTSTORE_EXT_TCP_PORT=1113 | 
NewerOlder