Skip to content

Commit

Permalink
#291 С# features: Dictionary to FrozenDictionary and other updates
Browse files Browse the repository at this point in the history
  • Loading branch information
nkz-soft committed Sep 13, 2024
1 parent ac90490 commit 1327690
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 22 deletions.
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ updates:
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
34 changes: 17 additions & 17 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
<PackageVersion Include="EasyCaching.Serialization.MessagePack" Version="1.9.0" />
<PackageVersion Include="FluentValidation" Version="11.9.2" />
<PackageVersion Include="HotChocolate.Abstractions" Version="13.9.11" />
<PackageVersion Include="HotChocolate.Diagnostics" Version="13.9.11" />
<PackageVersion Include="HotChocolate.AspNetCore" Version="13.9.11" />
<PackageVersion Include="HotChocolate.Data" Version="13.9.11" />
<PackageVersion Include="HotChocolate.Data.EntityFramework" Version="13.9.11" />
<PackageVersion Include="HotChocolate.Diagnostics" Version="13.9.12" />
<PackageVersion Include="HotChocolate.AspNetCore" Version="13.9.12" />
<PackageVersion Include="HotChocolate.Data" Version="13.9.12" />
<PackageVersion Include="HotChocolate.Data.EntityFramework" Version="13.9.12" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
<PackageVersion Include="NKZSoft.FluentValidation.Options" Version="1.2.0" />
<PackageVersion Include="Npgsql.OpenTelemetry" Version="8.0.3" />
<PackageVersion Include="Npgsql.OpenTelemetry" Version="8.0.4" />
<PackageVersion Include="OpenTelemetry" Version="1.9.0" />
<PackageVersion Include="OpenTelemetry.Api" Version="1.9.0" />
<PackageVersion Include="OpenTelemetry.Exporter.Console" Version="1.9.0" />
Expand All @@ -27,10 +27,10 @@
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.9.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.MassTransit" Version="1.0.0-beta.3" />
<PackageVersion Include="OpenTelemetry.Instrumentation.GrpcNetClient" Version="1.0.0-rc9.14" />
<PackageVersion Include="StackExchange.Redis" Version="2.8.0" />
<PackageVersion Include="StackExchange.Redis" Version="2.8.16" />
<PackageVersion Include="System.ServiceModel.Primitives" Version="8.0.0" />
<PackageVersion Include="AspNetCore.HealthChecks.UI.Client" Version="8.0.1" />
<PackageVersion Include="AspNetCore.HealthChecks.Rabbitmq" Version="8.0.1" />
<PackageVersion Include="AspNetCore.HealthChecks.Rabbitmq" Version="8.0.2" />
<PackageVersion Include="Microsoft.NETCore.Platforms" Version="7.0.4" />
<PackageVersion Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.8" />
<PackageVersion Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
Expand Down Expand Up @@ -58,7 +58,7 @@
<PackageVersion Include="Ardalis.GuardClauses" Version="4.6.0" />
<PackageVersion Include="Ardalis.Specification" Version="8.0.0" />
<PackageVersion Include="Scrutor" Version="4.2.2" />
<PackageVersion Include="MediatR" Version="12.4.0" />
<PackageVersion Include="MediatR" Version="12.4.1" />
<PackageVersion Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="11.1.0" />
<PackageVersion Include="MassTransit" Version="8.2.5" />
<PackageVersion Include="MassTransit.AspNetCore" Version="7.3.1" />
Expand All @@ -69,7 +69,7 @@
<PackageVersion Include="Mapster" Version="7.4.0" />
<PackageVersion Include="Mapster.Async" Version="2.0.1" />
<PackageVersion Include="Mapster.DependencyInjection" Version="1.0.1" />
<PackageVersion Include="Google.Protobuf" Version="3.28.0" />
<PackageVersion Include="Google.Protobuf" Version="3.28.1" />
<PackageVersion Include="protobuf-net" Version="3.2.30" />
<PackageVersion Include="protobuf-net.Grpc.AspNetCore" Version="1.1.1" />
<PackageVersion Include="protobuf-net.Grpc.AspNetCore.Reflection" Version="1.1.1" />
Expand All @@ -82,7 +82,7 @@
<PackageVersion Include="Serilog.AspNetCore" Version="8.0.2" />
<PackageVersion Include="FluentValidation.AspNetCore" Version="11.3.0" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.8" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageVersion Include="xunit" Version="2.9.0" />
<PackageVersion Include="Xunit.Extensions.Ordering" Version="1.4.5" />
<PackageVersion Include="Xunit.DependencyInjection" Version="9.3.1" />
Expand All @@ -95,15 +95,15 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
<PackageVersion Include="FluentAssertions" Version="6.12.1" />
<PackageVersion Include="Respawn" Version="6.2.1" />
<PackageVersion Include="Moq" Version="4.20.70" />
<PackageVersion Include="Testcontainers" Version="3.9.0" />
<PackageVersion Include="Testcontainers.PostgreSql" Version="3.9.0" />
<PackageVersion Include="Testcontainers.RabbitMq" Version="3.9.0" />
<PackageVersion Include="Testcontainers.Redis" Version="3.9.0" />
<PackageVersion Include="Moq" Version="4.20.72" />
<PackageVersion Include="Testcontainers" Version="3.10.0" />
<PackageVersion Include="Testcontainers.PostgreSql" Version="3.10.0" />
<PackageVersion Include="Testcontainers.RabbitMq" Version="3.10.0" />
<PackageVersion Include="Testcontainers.Redis" Version="3.10.0" />
<PackageVersion Include="Shouldly" Version="4.2.1" />
<PackageVersion Include="RestSharp" Version="111.4.1" />
<PackageVersion Include="RestSharp" Version="112.0.0" />
<PackageVersion Include="NKZSoft.Service.Configuration.MassTransit.RabbitMq" Version="1.2.0" />
<PackageVersion Include="NKZSoft.Service.Configuration.Logger" Version="1.3.0" />
<PackageVersion Include="NKZSoft.Service.Configuration.Swagger" Version="1.0.3" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
namespace NKZSoft.Template.Application.TodoItems.Specifications;

using System.Collections.Frozen;
using Common.Exceptions;
using Common.Filters;
using Common.Paging;
using Models;

internal sealed class ToDoItemSpecification : Specification<ToDoItem>
{
private static readonly Dictionary<string, Expression<Func<ToDoItem, object>>> SortExpressions =
private static readonly FrozenDictionary<string, Expression<Func<ToDoItem, object>>> SortExpressions =
new Dictionary<string, Expression<Func<ToDoItem, object>>>(StringComparer.OrdinalIgnoreCase)
{
{ nameof(ToDoItemFilter.Id), c => c.Id },
{ nameof(ToDoItemFilter.Title), c => c.Title },
};
}.ToFrozenDictionary();

private ToDoItemSpecification()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<Version>2.0.2</Version>
<Version>2.0.3</Version>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace NKZSoft.Template.Common.Tests;

using System.Collections.Frozen;
using Testcontainers;
using Testcontainers.PostgreSql;
using Testcontainers.RabbitMq;
Expand All @@ -10,7 +11,7 @@ public class BaseWebApplicationFactory<TStartup> : WebApplicationFactory<TStartu
{
protected const string EnvironmentName = "Test";

private Dictionary<Type, IContainer> Containers { get; }
private FrozenDictionary<Type, IContainer> Containers { get; }

protected BaseWebApplicationFactory()
{
Expand All @@ -27,7 +28,7 @@ protected BaseWebApplicationFactory()
{
typeof(RedisContainer), ContainerFactory.Create<RedisContainer>()
}
};
}.ToFrozenDictionary();
}

public async Task InitializeAsync()
Expand Down

0 comments on commit 1327690

Please sign in to comment.