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 ExampleTest(SiloFixture fixture) : IClassFixture<SiloFixture> | |
{ | |
[Fact] | |
public async Task Sending_data_to_stream() | |
{ | |
var message = "foo bar baz"; | |
var stream = fixture.GetStream<string>("grainId1"); | |
await stream.OnNextAsync(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 Orleans.Storage; | |
using R3; | |
namespace Egil.Orleans.Storage.Testing; | |
public sealed class StorageObserver(string storageName, IGrainStorage observableTarget) : IGrainStorage | |
{ | |
private readonly Subject<StorageOperation> operationsFeed = new(); | |
public Observable<StorageOperation> StorageOperationFeed => operationsFeed.AsObservable(); |
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.Collections.Concurrent; | |
using System.Globalization; | |
using Orleans.Storage; | |
// https://www.nuget.org/packages/R3 | |
using R3; | |
using Xunit.Sdk; | |
namespace Egil.Orleans.Storage.Testing; | |
public sealed class ObservableMemoryStorage : IGrainStorage |
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 = DistributedApplication.CreateBuilder(args); | |
var sqlPassword = builder.AddParameter("sql-password", secret: true); | |
var sqlserver = builder | |
.AddSqlServer("sqlserver", password: sqlPassword) | |
.WithDataVolume() | |
.WithLifetime(ContainerLifetime.Persistent); | |
var importSourceConnectionString = "Server=[REPLACE].database.windows.net;Authentication=Active Directory Interactive;Database=[REPLACE];Encrypt=True;" | |
var db = sqlserver |
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 sealed class RecordList<T> : List<T>, IEquatable<RecordList<T>> | |
where T : IEquatable<T> | |
{ | |
private static readonly int EmptyRecordListHashCode = typeof(RecordList<T>).FullName!.GetHashCode(StringComparison.Ordinal); | |
public RecordList() | |
{ | |
} | |
public RecordList(IEnumerable<T> collection) |
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 | |
{ |
NewerOlder