Skip to content

Commit c4c1172

Browse files
Merge pull request #219 from AntonioFalcao/release
Updating
2 parents e5753d2 + 0330fda commit c4c1172

34 files changed

Lines changed: 1627 additions & 1561 deletions

.github/workflows/build-and-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Setup .NET Core
1414
uses: actions/setup-dotnet@v1
1515
with:
16-
dotnet-version: 6.0.100-preview.2.21155.3
16+
dotnet-version: 6.0.100-preview.4.21255.9
1717
- name: Install dependencies
1818
run: dotnet restore -v m
1919
- name: Build
@@ -28,6 +28,6 @@ jobs:
2828
- name: Setup .NET Core
2929
uses: actions/setup-dotnet@v1
3030
with:
31-
dotnet-version: 6.0.100-preview.2.21155.3
31+
dotnet-version: 6.0.100-preview.4.21255.9
3232
- name: Test
3333
run: dotnet test --no-restore -v m

Directory.Build.props

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
1-
<Project>
2-
3-
<PropertyGroup Label="Common properties">
4-
<TargetFramework>net6.0</TargetFramework>
5-
<LangVersion>9</LangVersion>
6-
</PropertyGroup>
7-
8-
<PropertyGroup Label="Packages dependency versions">
9-
10-
<!--Microsoft-->
11-
<Microsoft_Extensions_Version>6.0.0-preview.3.21201.4</Microsoft_Extensions_Version>
12-
13-
<!--EF Core-->
14-
<Microsoft_EntityFrameworkCore_Version>6.0.0-preview.3.21201.2</Microsoft_EntityFrameworkCore_Version>
15-
<Microsoft_EntityFrameworkCore_DependencyInjection_Version>6.0.0-preview.2.21154.6</Microsoft_EntityFrameworkCore_DependencyInjection_Version>
16-
<Microsoft_HealthChecks_EntityFrameworkCore_Version>6.0.0-preview.3.21201.13</Microsoft_HealthChecks_EntityFrameworkCore_Version>
17-
18-
<!--GraphQL-->
19-
<GraphQL_Server_Version>5.0.2</GraphQL_Server_Version>
20-
<GraphQL_Client_Version>3.2.3</GraphQL_Client_Version>
21-
<GraphQL_Version>4.4.0</GraphQL_Version>
22-
23-
<!--AutoMapper-->
24-
<AutoMapper_DependencyInjection_Version>8.1.1</AutoMapper_DependencyInjection_Version>
25-
<AutoMapper_Version>10.1.1</AutoMapper_Version>
26-
27-
<!--Serilog-->
28-
<Serilog_Version>4.1.0</Serilog_Version>
29-
30-
<!--HealthChecks-->
31-
<HealthChecks_Version>5.0.1</HealthChecks_Version>
32-
33-
<!--Others-->
34-
<FluentValidation_Version>10.0.4</FluentValidation_Version>
35-
<Scrutor_Version>3.3.0</Scrutor_Version>
36-
37-
</PropertyGroup>
38-
39-
</Project>
1+
<Project>
2+
3+
<PropertyGroup Label="Common properties">
4+
<TargetFramework>net6.0</TargetFramework>
5+
<LangVersion>9</LangVersion>
6+
</PropertyGroup>
7+
8+
<PropertyGroup Label="Packages dependency versions">
9+
10+
<!--Microsoft-->
11+
<Microsoft_Extensions_Version>6.0.0-preview.4.21253.7</Microsoft_Extensions_Version>
12+
13+
<!--EF Core-->
14+
<Microsoft_EntityFrameworkCore_Version>6.0.0-preview.4.21253.1</Microsoft_EntityFrameworkCore_Version>
15+
<Microsoft_EntityFrameworkCore_DependencyInjection_Version>6.0.0-preview.2.21154.6</Microsoft_EntityFrameworkCore_DependencyInjection_Version>
16+
<Microsoft_HealthChecks_EntityFrameworkCore_Version>6.0.0-preview.4.21253.5</Microsoft_HealthChecks_EntityFrameworkCore_Version>
17+
18+
<!--GraphQL-->
19+
<GraphQL_Server_Version>5.0.2</GraphQL_Server_Version>
20+
<GraphQL_Client_Version>3.2.3</GraphQL_Client_Version>
21+
<GraphQL_Version>4.5.0</GraphQL_Version>
22+
23+
<!--AutoMapper-->
24+
<AutoMapper_DependencyInjection_Version>8.1.1</AutoMapper_DependencyInjection_Version>
25+
<AutoMapper_Version>10.1.1</AutoMapper_Version>
26+
27+
<!--Serilog-->
28+
<Serilog_Version>4.1.0</Serilog_Version>
29+
30+
<!--HealthChecks-->
31+
<HealthChecks_Version>5.0.1</HealthChecks_Version>
32+
33+
<!--Others-->
34+
<FluentValidation_Version>10.2.1</FluentValidation_Version>
35+
<Scrutor_Version>3.3.0</Scrutor_Version>
36+
37+
</PropertyGroup>
38+
39+
</Project>

README.md

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,6 @@ app.UseGraphQLPlayground(
197197

198198
Based on cloud-native concepts, **Readiness** and **Liveness** integrity verification strategies were implemented.
199199

200-
If using [xabarilcoding/healthchecksui](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/blob/master/doc/ui-docker.md) container image it will responde on `http://localhost:8000/healthchecks-ui/`.
201-
202200
> `/health`
203201
> Just check if the instance is running.
204202

@@ -208,14 +206,26 @@ If using [xabarilcoding/healthchecksui](https://github.com/Xabaril/AspNetCore.Di
208206
> `/health/ready`
209207
> Check if the instance and all the dependencies are ready to attend to all functionalities.
210208

211-
> `/healthz`
212-
> HealthReport specific for HealthCheck-UI.
213-
214209
Web API
215210

216211
`http://localhost:5000/health/ready`
217212

218-
![Readiness](./.assets/img/Readiness.png)
213+
```json
214+
{
215+
"status": "Healthy",
216+
"totalDuration": "00:00:00.2344435",
217+
"entries": {
218+
"Sql Server (Ready)": {
219+
"data": {},
220+
"duration": "00:00:00.2251420",
221+
"status": "Healthy",
222+
"tags": [
223+
"ready"
224+
]
225+
}
226+
}
227+
}
228+
```
219229

220230
Web MVC
221231

@@ -234,8 +244,8 @@ public void Configure(IApplicationBuilder app)
234244
{
235245
endpoints.MapDumpConfig(
236246
pattern: "/dump-config",
237-
configInfo: (_configuration as IConfigurationRoot).GetDebugView(),
238-
isDevelopment: _env.IsDevelopment());
247+
configurationRoot: _configuration as IConfigurationRoot,
248+
isProduction: _env.IsProduction());
239249
});
240250
}
241251
```

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"sdk": {
3-
"version": "6.0.100-preview.2.21155.3"
3+
"version": "6.0.100-preview.4.21255.9"
44
}
55
}

src/Dotnet6.GraphQL4.Repositories.Abstractions/DependencyInjection/Extensions/ServiceCollectionExtensions.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ public static OptionsBuilder<TransactionOptions> ConfigureTransactionOptions(thi
2525
=> services
2626
.AddOptions<TransactionOptions>()
2727
.Bind(section)
28+
.ValidateDataAnnotations()
2829
.Validate(
2930
validation: options => options.IsolationLevel is not System.Transactions.IsolationLevel.Unspecified,
30-
failureMessage: "Transaction isolation level must be specified");
31+
failureMessage: "Transaction isolation level must be specified")
32+
.ValidateOnStart();
3133
}
3234
}
Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
1-
using System.Transactions;
1+
using System.ComponentModel.DataAnnotations;
2+
using System.Transactions;
23

34
namespace Dotnet6.GraphQL4.Repositories.Abstractions.DependencyInjection.Options
45
{
56
public class TransactionOptions
67
{
7-
private const IsolationLevel DefaultIsolationLevel = IsolationLevel.ReadCommitted;
8-
private IsolationLevel? _isolationLevel;
9-
10-
public IsolationLevel IsolationLevel
11-
{
12-
get => _isolationLevel ?? DefaultIsolationLevel;
13-
set => _isolationLevel = value;
14-
}
8+
[Required, EnumDataType(typeof(IsolationLevel))]
9+
public IsolationLevel IsolationLevel { get; set; }
1510
}
1611
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2+
23
<ItemGroup>
34
<PackageReference Include="AutoMapper" Version="$(AutoMapper_Version)" />
45
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="$(Microsoft_EntityFrameworkCore_Version)" />
56
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="$(Microsoft_Extensions_Version)" />
67
<PackageReference Include="Scrutor" Version="$(Scrutor_Version)" />
8+
<PackageReference Include="Microsoft.Extensions.Hosting" Version="$(Microsoft_Extensions_Version)" />
9+
<PackageReference Include="Microsoft.Extensions.Options.DataAnnotations" Version="$(Microsoft_Extensions_Version)" />
710
</ItemGroup>
11+
812
<ItemGroup>
913
<ProjectReference Include="..\Dotnet6.GraphQL4.Domain.Abstractions\Dotnet6.GraphQL4.Domain.Abstractions.csproj" />
1014
</ItemGroup>
15+
1116
</Project>

src/Dotnet6.GraphQL4.Repositories.Abstractions/UnitsOfWork/UnitOfWork.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ public class UnitOfWork : IUnitOfWork
2020

2121
public UnitOfWork(
2222
DbContext dbContext,
23-
IOptionsSnapshot<TransactionOptions> optionsMonitor,
23+
IOptionsSnapshot<TransactionOptions> optionsSnapshot,
2424
INotificationContext notificationContext)
2525
{
2626
_dbContext = dbContext;
27-
_options = optionsMonitor.Value;
27+
_options = optionsSnapshot.Value;
2828
_database = _dbContext.Database;
2929
_notificationContext = notificationContext;
3030
}

src/Dotnet6.GraphQL4.Store.Repositories/Configurations/Products/BackpackConfiguration.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ public void Configure(EntityTypeBuilder<Backpack> builder)
1616

1717
builder
1818
.Property(x => x.BackpackType)
19-
.HasConversion(new EnumToStringConverter<BackpackType>());
19+
.HasConversion(new EnumToStringConverter<BackpackType>())
20+
.IsUnicode(false)
21+
.HasMaxLength(30);
2022
}
2123
}
2224
}

src/Dotnet6.GraphQL4.Store.Repositories/Configurations/Products/BootConfiguration.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ public void Configure(EntityTypeBuilder<Boot> builder)
1919

2020
builder
2121
.Property(x => x.BootType)
22-
.HasConversion(new EnumToStringConverter<BootType>());
22+
.HasConversion(new EnumToStringConverter<BootType>())
23+
.IsUnicode(false)
24+
.HasMaxLength(30);
2325
}
2426
}
2527
}

0 commit comments

Comments
 (0)