This file contains 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
<PropertyGroup> | |
<WixToolPath>$(MSBuildProjectDirectory)..\..\..\Tools\Wix\3.9</WixToolPath> | |
<WixTargetsPath>$(WixToolPath)\wix.targets</WixTargetsPath> | |
<WixTasksPath>$(WixToolPath)\WixTasks.dll</WixTasksPath> | |
</PropertyGroup> |
This file contains 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
<Target Name="BeforeBuild"> | |
<Exec Command="attrib -R %(ProjectReference.Filename).wxs" Condition="'%(ProjectReference.WebProject)'=='True'" /> | |
<MSBuild Projects="%(ProjectReference.FullPath)" Targets="Package" Properties="Configuration=$(Configuration);Platform=AnyCPU" Condition="'%(ProjectReference.WebProject)'=='True'" /> | |
<ItemGroup> | |
<LinkerBindInputPaths Include="%(ProjectReference.RootDir)%(ProjectReference.Directory)obj\$(Configuration)\Package\PackageTmp\" /> | |
</ItemGroup> | |
<HeatDirectory OutputFile="%(ProjectReference.Filename).wxs" Directory="%(ProjectReference.RootDir)%(ProjectReference.Directory)obj\$(Configuration)\Package\PackageTmp\" DirectoryRefId="INSTALLFOLDER" ComponentGroupName="%(ProjectReference.Filename)" AutogenerateGuids="True" SuppressCom="True" SuppressFragments="True" SuppressRegistry="True" ToolPath="$(WixToolPath)" Condition="'%(ProjectReference.WebProject)'=='True'" /> | |
</Target> |
This file contains 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 loadTest = NLoad.Test<MyTest>() | |
.WithNumberOfThreads(100) | |
.WithDurationOf(TimeSpan.FromMinutes(5)) | |
.WithDeleyBetweenThreadStart(TimeSpan.FromMilliseconds(50)) | |
.OnHeartbeat((s, e) => Console.WriteLine(e.Throughput)) | |
.Build(); | |
var result = loadTest.Run(); |
This file contains 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 MediatorPipeline<TRequest, TResponse> | |
: IRequestHandler<TRequest, TResponse> | |
where TRequest : IRequest<TResponse> | |
{ | |
private readonly IRequestHandler<TRequest, TResponse> _inner; | |
private readonly IPreRequestHandler<TRequest>[] _preRequestHandlers; | |
private readonly IAsyncPostRequestHandler<TRequest, TResponse>[] _postRequestHandlers; | |
public MediatorPipeline( | |
IRequestHandler<TRequest, TResponse> inner, |
This file contains 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 AsyncMediatorPipeline<TRequest, TResponse> : IAsyncRequestHandler<TRequest, TResponse> | |
where TRequest : IAsyncRequest<TResponse> | |
{ | |
private readonly IAsyncRequestHandler<TRequest, TResponse> _inner; | |
private readonly IAsyncPreRequestHandler<TRequest>[] _preRequestHandlers; | |
private readonly IAsyncPostRequestHandler<TRequest, TResponse>[] _postRequestHandlers; | |
public AsyncMediatorPipeline( | |
IAsyncRequestHandler<TRequest, TResponse> inner, | |
IAsyncPreRequestHandler<TRequest>[] preRequestHandlers, |
This file contains 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 interface IPreRequestHandler<in TRequest> | |
{ | |
void Handle(TRequest request); | |
} | |
public interface IAsyncPreRequestHandler<in TRequest> | |
{ | |
Task Handle(TRequest request); | |
} |
This file contains 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 MediatorPipelineModule : Autofac.Module | |
{ | |
protected override void Load(ContainerBuilder builder) | |
{ | |
RegisterPipeline(builder); | |
RegisterAsyncPreRequestHandlers(builder); | |
RegisterAsyncPostRequestHandlers(builder); | |
RegisterPreRequestHandlers(builder); | |
RegisterPostRequestHandlers(builder); | |
} |
This file contains 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
class SignalGenerator | |
{ | |
long startTime = Stopwatch.GetTimestamp(); | |
long ticksPerSecond = Stopwatch.Frequency; | |
float amplitude = 1f; | |
float frequency = 1f; | |
float phase = 1f; | |
float offset = 0f; | |
This file contains 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
class SignalGenerator | |
{ | |
long startTime = Stopwatch.GetTimestamp(); | |
long ticksPerSecond = Stopwatch.Frequency; | |
float amplitude = 1f; | |
float frequency = 1f; | |
float phase = 1f; | |
float offset = 0f; | |
This file contains 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 Autofac; | |
using Autofac.Core; | |
using Cloudinator.Portal.WebApi.Infrastructure; | |
using Cloudinator.Portal.WebApi.Infrastructure.Handlers; | |
using FluentValidation; | |
using MediatR; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Reflection; |
OlderNewer