Resolve warnings

This commit is contained in:
Sipke Schoorstra 2021-06-19 12:10:52 +02:00
parent 543f5b78b5
commit 81ac5c2aed
17 changed files with 73 additions and 41 deletions

View file

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\common.props" />
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props"/>
<Import Project="..\..\..\..\configureawait.props"/>
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
@ -13,33 +13,20 @@
</PropertyGroup>
<ItemGroup>
<Compile Remove="Services\**" />
<EmbeddedResource Remove="Services\**" />
<None Remove="Services\**" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1"/>
<PackageReference Include="System.Text.Encodings.Web" Version="5.0.1"/>
</ItemGroup>
<ItemGroup>
<Compile Remove="Persistence\Decorators\InitializingStoreBase.cs" />
</ItemGroup>
<ItemGroup>
<Compile Include="Services\WebhookPublisher.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\core\Elsa.Core\Elsa.Core.csproj" />
<ProjectReference Include="..\..\..\server\Elsa.Server.Api\Elsa.Server.Api.csproj" />
<ProjectReference Include="..\..\Elsa.Activities.Http\Elsa.Activities.Http.csproj" />
<ProjectReference Include="..\Elsa.Webhooks.Abstractions\Elsa.Webhooks.Abstractions.csproj" />
<ProjectReference Include="..\Elsa.Webhooks.Persistence.EntityFramework.Core\Elsa.Webhooks.Persistence.EntityFramework.Core.csproj" />
<ProjectReference Include="..\Elsa.Webhooks.Persistence.EntityFramework.MySql\Elsa.Webhooks.Persistence.EntityFramework.MySql.csproj" />
<ProjectReference Include="..\Elsa.Webhooks.Persistence.EntityFramework.PostgreSql\Elsa.Webhooks.Persistence.EntityFramework.PostgreSql.csproj" />
<ProjectReference Include="..\Elsa.Webhooks.Persistence.EntityFramework.Sqlite\Elsa.Webhooks.Persistence.EntityFramework.Sqlite.csproj" />
<ProjectReference Include="..\Elsa.Webhooks.Persistence.EntityFramework.SqlServer\Elsa.Webhooks.Persistence.EntityFramework.SqlServer.csproj" />
<ProjectReference Include="..\..\..\core\Elsa.Core\Elsa.Core.csproj"/>
<ProjectReference Include="..\..\..\server\Elsa.Server.Api\Elsa.Server.Api.csproj"/>
<ProjectReference Include="..\..\Elsa.Activities.Http\Elsa.Activities.Http.csproj"/>
<ProjectReference Include="..\Elsa.Webhooks.Abstractions\Elsa.Webhooks.Abstractions.csproj"/>
<ProjectReference Include="..\Elsa.Webhooks.Persistence.EntityFramework.Core\Elsa.Webhooks.Persistence.EntityFramework.Core.csproj"/>
<ProjectReference Include="..\Elsa.Webhooks.Persistence.EntityFramework.MySql\Elsa.Webhooks.Persistence.EntityFramework.MySql.csproj"/>
<ProjectReference Include="..\Elsa.Webhooks.Persistence.EntityFramework.PostgreSql\Elsa.Webhooks.Persistence.EntityFramework.PostgreSql.csproj"/>
<ProjectReference Include="..\Elsa.Webhooks.Persistence.EntityFramework.Sqlite\Elsa.Webhooks.Persistence.EntityFramework.Sqlite.csproj"/>
<ProjectReference Include="..\Elsa.Webhooks.Persistence.EntityFramework.SqlServer\Elsa.Webhooks.Persistence.EntityFramework.SqlServer.csproj"/>
</ItemGroup>
</Project>

View file

@ -4,12 +4,12 @@ namespace Elsa.Webhooks.Persistence.YesSql.Documents
{
public class WebhookDefinitionDocument : YesSqlDocument
{
public string Id { get; set; } = default!;
public string WebhookDefinitionId { get; set; } = default!;
public string? TenantId { get; set; }
public string? Name { get; set; }
public string? Path { get; set; }
public string Name { get; set; } = default!;
public string Path { get; set; } = default!;
public string? Description { get; set; }
public string? PayloadTypeName { get; set; }
public bool IsEnabled { get; set; }
}
}
}

View file

@ -6,7 +6,7 @@ namespace Elsa.Webhooks.Persistence.YesSql.Indexes
{
public class WebhookDefinitionIndex : MapIndex
{
public string Id { get; set; } = default!;
public string WebhookDefinitionId { get; set; } = default!;
public string? TenantId { get; set; }
public bool IsEnabled { get; set; }
}
@ -21,11 +21,11 @@ namespace Elsa.Webhooks.Persistence.YesSql.Indexes
.Map(
webhookDefinition => new WebhookDefinitionIndex
{
Id = webhookDefinition.Id,
WebhookDefinitionId = webhookDefinition.WebhookDefinitionId,
TenantId = webhookDefinition.TenantId,
IsEnabled = webhookDefinition.IsEnabled
}
);
}
}
}
}

View file

@ -11,7 +11,7 @@ namespace Elsa.Webhooks.Persistence.YesSql
{
SchemaBuilder.CreateMapIndexTable<WebhookDefinitionIndex>(
table => table
.Column<string>(nameof(WebhookDefinitionIndex.Id))
.Column<string>(nameof(WebhookDefinitionIndex.WebhookDefinitionId))
.Column<string?>(nameof(WebhookDefinitionIndex.TenantId))
.Column<bool>(nameof(WebhookDefinitionIndex.IsEnabled)),
CollectionNames.WebhookDefinitions);

View file

@ -12,7 +12,7 @@ using AutoMapper;
using Elsa.Webhooks.Models;
using Microsoft.Extensions.Logging;
using YesSql;
using IIdGenerator = Elsa.Services.IIdGenerator;
using IIdGenerator = Elsa.Services.IIdGenerator;
namespace Elsa.Webhooks.Persistence.YesSql.Stores
{
@ -22,13 +22,13 @@ namespace Elsa.Webhooks.Persistence.YesSql.Stores
{
}
protected override async Task<WebhookDefinitionDocument?> FindDocumentAsync(ISession session, WebhookDefinition entity, CancellationToken cancellationToken) => await Query<WebhookDefinitionIndex>(session, x => x.Id == entity.Id).FirstOrDefaultAsync();
protected override async Task<WebhookDefinitionDocument?> FindDocumentAsync(ISession session, WebhookDefinition entity, CancellationToken cancellationToken) => await Query<WebhookDefinitionIndex>(session, x => x.WebhookDefinitionId == entity.Id).FirstOrDefaultAsync();
protected override IQuery<WebhookDefinitionDocument> MapSpecification(ISession session, ISpecification<WebhookDefinition> specification)
{
return specification switch
{
EntityIdSpecification<WebhookDefinition> s => Query<WebhookDefinitionIndex>(session, x => x.Id == s.Id),
EntityIdSpecification<WebhookDefinition> s => Query<WebhookDefinitionIndex>(session, x => x.WebhookDefinitionId == s.Id),
_ => AutoMapSpecification<WebhookDefinitionIndex>(session, specification)
};
}

View file

@ -7,13 +7,14 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="YesSql.Provider.Sqlite" Version="3.0.6" />
<PackageReference Include="System.Text.Encodings.Web" Version="5.0.1"/>
<PackageReference Include="YesSql.Provider.Sqlite" Version="3.0.6"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\activities\Elsa.Activities.Http\Elsa.Activities.Http.csproj" />
<ProjectReference Include="..\..\..\core\Elsa\Elsa.csproj" />
<ProjectReference Include="..\..\..\persistence\Elsa.Persistence.YesSql\Elsa.Persistence.YesSql.csproj" />
<ProjectReference Include="..\..\..\activities\Elsa.Activities.Http\Elsa.Activities.Http.csproj"/>
<ProjectReference Include="..\..\..\core\Elsa\Elsa.csproj"/>
<ProjectReference Include="..\..\..\persistence\Elsa.Persistence.YesSql\Elsa.Persistence.YesSql.csproj"/>
</ItemGroup>
</Project>

View file

@ -5,6 +5,10 @@
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Text.Encodings.Web" Version="5.0.1"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\activities\Elsa.Activities.Http\Elsa.Activities.Http.csproj" />
<ProjectReference Include="..\..\..\core\Elsa\Elsa.csproj" />

View file

@ -6,6 +6,10 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Text.Encodings.Web" Version="5.0.1"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\activities\Elsa.Activities.Http\Elsa.Activities.Http.csproj" />
<ProjectReference Include="..\..\..\core\Elsa\Elsa.csproj" />

View file

@ -5,6 +5,10 @@
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Text.Encodings.Web" Version="5.0.1"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\activities\Elsa.Activities.Http\Elsa.Activities.Http.csproj" />
<ProjectReference Include="..\..\..\core\Elsa\Elsa.csproj" />

View file

@ -5,6 +5,10 @@
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Text.Encodings.Web" Version="5.0.1"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\activities\Elsa.Activities.Http\Elsa.Activities.Http.csproj" />
<ProjectReference Include="..\..\..\core\Elsa\Elsa.csproj" />

View file

@ -4,6 +4,10 @@
<TargetFramework>net5.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Text.Encodings.Web" Version="5.0.1"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\activities\Elsa.Activities.Http\Elsa.Activities.Http.csproj" />

View file

@ -5,6 +5,10 @@
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Text.Encodings.Web" Version="5.0.1"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\activities\Elsa.Activities.Http\Elsa.Activities.Http.csproj" />
<ProjectReference Include="..\..\..\core\Elsa\Elsa.csproj" />

View file

@ -6,6 +6,10 @@
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Text.Encodings.Web" Version="5.0.1"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\activities\Elsa.Activities.Http\Elsa.Activities.Http.csproj" />
<ProjectReference Include="..\..\..\activities\Elsa.Activities.Temporal.Quartz\Elsa.Activities.Temporal.Quartz.csproj" />

View file

@ -5,6 +5,10 @@
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Text.Encodings.Web" Version="5.0.1"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\activities\Elsa.Activities.Http\Elsa.Activities.Http.csproj" />
<ProjectReference Include="..\..\..\core\Elsa\Elsa.csproj" />

View file

@ -5,6 +5,10 @@
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Text.Encodings.Web" Version="5.0.1"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\activities\Elsa.Activities.Http\Elsa.Activities.Http.csproj" />
<ProjectReference Include="..\..\..\core\Elsa\Elsa.csproj" />

View file

@ -4,6 +4,10 @@
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Text.Encodings.Web" Version="5.0.1"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\activities\Elsa.Activities.Http\Elsa.Activities.Http.csproj" />
<ProjectReference Include="..\..\..\core\Elsa\Elsa.csproj" />

View file

@ -5,6 +5,10 @@
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Text.Encodings.Web" Version="5.0.1"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\activities\Elsa.Activities.Http\Elsa.Activities.Http.csproj" />
<ProjectReference Include="..\..\..\activities\Elsa.Activities.Temporal.Quartz\Elsa.Activities.Temporal.Quartz.csproj" />