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.EntityFrameworkCore; | |
| using Microsoft.Extensions.Caching.Memory; | |
| namespace Solution.Data; | |
| public sealed class CustomerRepository : IDisposable | |
| { | |
| private readonly IDbContextFactory<DbContext> dbFactory; | |
| private readonly DatabaseMemoryCache databaseCache; |
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
| param resourceName string | |
| param subnetId string | |
| param appServicePlanId string | |
| param appsettingsProperties object | |
| param location string = resourceGroup().location | |
| param tags object = resourceGroup().tags | |
| param eventHubNames array | |
| resource appService 'Microsoft.Web/sites@2022-09-01' = { | |
| name: resourceName |
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
| <!-- | |
| Automatically copy the content of a CHANGELOG.md file into a NuGET package's change log section via the `<PackageReleaseNotes>` element in .csproj by doing the following: | |
| Put the following into your .csproj, e.g. `Lib.csproj`, and the content of your CHANGELOG.md will be embedded when the project is packaged. | |
| This assumes that the project structure is as follows: | |
| \CHANGELOG.md | |
| \src\Lib\Lib.csproj | |
| --> |
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
| function Invoke-With-Retry { | |
| [CmdletBinding()] | |
| Param( | |
| [Parameter(Position = 0, Mandatory = $true)] | |
| [scriptblock]$ScriptBlock, | |
| [Parameter(Position = 1, Mandatory = $false)] | |
| [int]$Retries = 5, | |
| [Parameter(Position = 2, Mandatory = $false)] |
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.Expressions; | |
| using System.Reflection; | |
| using System.Runtime.CompilerServices; | |
| using System.Runtime.Serialization; | |
| namespace Microsoft.Extensions.Options; | |
| public static class OptionsExtensions | |
| { |
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 Scheduler; | |
| public interface ITimeScheduler | |
| { | |
| DateTimeOffset UtcNow { get; } | |
| Task Delay(TimeSpan delay); | |
| Task Delay(TimeSpan delay, CancellationToken cancellationToken); |
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
| /// <summary> | |
| /// Represents a multi-cast <see cref="IAsyncEnumerable{T}"/> where | |
| /// each reader can consume the <typeparamref name="T"/> items | |
| /// at its own pace. | |
| /// </summary> | |
| /// <typeparam name="T">The item type produced by the enumerable.</typeparam> | |
| public sealed class MulticastAsyncEnumerable<T> : IAsyncEnumerable<T> | |
| { | |
| private readonly UnboundedChannelOptions channelOptions; | |
| private readonly object activeChannelsLock = new object(); |
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; | |
| using DiffPlex.DiffBuilder; | |
| using DiffPlex.DiffBuilder.Model; | |
| using FluentAssertions.Execution; | |
| using FluentAssertions.Primitives; | |
| using Microsoft.CodeAnalysis; | |
| using Microsoft.CodeAnalysis.CSharp; | |
| namespace FluentAssertions |
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.Globalization; | |
| using System.Linq; | |
| using System.Security.Cryptography; | |
| using System.Text; | |
| public static class IdFactory | |
| { | |
| public static string CreateId(IEnumerable<(string key, string value)> kvps) |
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; | |
| public abstract class Entity | |
| { | |
| public Guid Id { get; set; } | |
| } |