Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -250,3 +250,5 @@ paket-files/
# JetBrains Rider
.idea/
*.sln.iml

.vscode/
22 changes: 17 additions & 5 deletions Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ if(Test-Path .\artifacts) {
}

& dotnet restore --no-cache
if($LASTEXITCODE -ne 0) { exit 1 }

$branch = @{ $true = $env:APPVEYOR_REPO_BRANCH; $false = $(git symbolic-ref --short -q HEAD) }[$env:APPVEYOR_REPO_BRANCH -ne $NULL];
$revision = @{ $true = "{0:00000}" -f [convert]::ToInt32("0" + $env:APPVEYOR_BUILD_NUMBER, 10); $false = "local" }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
Expand All @@ -32,6 +33,17 @@ foreach ($src in ls src/*) {
Pop-Location
}

foreach ($test in ls test/*.Tests) {
Push-Location $test

echo "build: Testing project in $test"

& dotnet test -c Release
if($LASTEXITCODE -ne 0) { exit 3 }

Pop-Location
}

foreach ($test in ls test/*.Benchmarks) {
Push-Location $test

Expand All @@ -43,13 +55,13 @@ foreach ($test in ls test/*.Benchmarks) {
Pop-Location
}

foreach ($test in ls test/*.Tests) {
Push-Location $test
foreach ($sample in ls example/*) {
Push-Location $sample

echo "build: Testing project in $test"
echo "build: Building sample project in $sample"

& dotnet test -c Release
if($LASTEXITCODE -ne 0) { exit 3 }
& dotnet build -c Release
if($LASTEXITCODE -ne 0) { exit 2 }

Pop-Location
}
Expand Down
2 changes: 1 addition & 1 deletion example/SeqTail/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static void Main(string[] args)
{
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Verbose()
.WriteTo.LiterateConsole()
.WriteTo.Console()
.CreateLogger();

TaskScheduler.UnobservedTaskException += (s,e) => Log.Fatal(e.Exception, "Unobserved task exception");
Expand Down
6 changes: 3 additions & 3 deletions example/SeqTail/SeqTail.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Threading.Tasks" Version="4.0.11" />
<PackageReference Include="System.Threading.Tasks" Version="4.3.0" />
<PackageReference Include="docopt.net" Version="0.6.1.9" />
<PackageReference Include="Serilog.Formatting.Compact.Reader" Version="1.0.0-dev-00008" />
<PackageReference Include="Serilog.Sinks.Literate" Version="2.0.0" />
<PackageReference Include="Serilog.Formatting.Compact.Reader" Version="1.0.1" />
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
<PackageReference Include="System.Reactive" Version="3.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
</ItemGroup>
Expand Down
20 changes: 16 additions & 4 deletions src/Seq.Api/ResourceGroups/EntityResourceGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,21 @@ internal EntityResourceGroup(string name, ISeqConnection connection) : base(name
protected async Task<TResponse> GroupCreateAsync<TEntity, TResponse>(TEntity entity,
IDictionary<string, object> parameters = null) where TEntity : ILinked
{
var link = entity.Links.ContainsKey("Create") ? "Create" : "Items";
var group = await LoadGroupAsync().ConfigureAwait(false);
return await Client.PostAsync<TEntity, TResponse>(group, link, entity, parameters).ConfigureAwait(false);
ILinked resource;
string link;

if (entity.Links.ContainsKey("Create"))
{
resource = entity;
link = "Create";
}
else
{
resource = await LoadGroupAsync().ConfigureAwait(false);
link = "Items";
}

return await Client.PostAsync<TEntity, TResponse>(resource, link, entity, parameters).ConfigureAwait(false);
}
}
}
}
6 changes: 3 additions & 3 deletions src/Seq.Api/Seq.Api.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Description>Client library for the Seq HTTP API.</Description>
<VersionPrefix>4.2.0</VersionPrefix>
<VersionPrefix>4.2.1</VersionPrefix>
<Authors>Datalust;Contributors</Authors>
<TargetFrameworks>netstandard1.3;net452</TargetFrameworks>
<NoWarn>$(NoWarn);CS1591</NoWarn>
Expand Down Expand Up @@ -34,4 +34,4 @@
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Net.Http" />
</ItemGroup>
</Project>
</Project>
6 changes: 3 additions & 3 deletions test/Seq.Api.Tests/Seq.Api.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-preview-20170106-08" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0-beta5-build1225" />
<PackageReference Include="xunit" Version="2.2.0-beta5-build3474" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
<PackageReference Include="xunit" Version="2.3.1" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net46' ">
Expand Down