Skip to content

Commit a58a308

Browse files
Adjusts
1 parent ac74d56 commit a58a308

11 files changed

Lines changed: 387 additions & 1362 deletions

File tree

Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<!--GraphQL-->
1919
<GraphQL_Server_Version>5.0.2</GraphQL_Server_Version>
2020
<GraphQL_Client_Version>3.2.3</GraphQL_Client_Version>
21-
<GraphQL_Version>4.5.0</GraphQL_Version>
21+
<GraphQL_Version>4.4.0</GraphQL_Version>
2222

2323
<!--AutoMapper-->
2424
<AutoMapper_DependencyInjection_Version>8.1.1</AutoMapper_DependencyInjection_Version>
@@ -31,7 +31,7 @@
3131
<HealthChecks_Version>5.0.1</HealthChecks_Version>
3232

3333
<!--Others-->
34-
<FluentValidation_Version>10.1.0</FluentValidation_Version>
34+
<FluentValidation_Version>10.0.4</FluentValidation_Version>
3535
<Scrutor_Version>3.3.0</Scrutor_Version>
3636

3737
</PropertyGroup>

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System.Transactions;
21
using Dotnet6.GraphQL4.CrossCutting;
32
using Dotnet6.GraphQL4.Repositories.Abstractions.DependencyInjection.Options;
43
using Dotnet6.GraphQL4.Repositories.Abstractions.UnitsOfWork;
@@ -22,10 +21,12 @@ public static IServiceCollection AddRepositories(this IServiceCollection service
2221
public static IServiceCollection AddUnitOfWork(this IServiceCollection services)
2322
=> services.AddScoped<IUnitOfWork, UnitOfWork>();
2423

25-
public static OptionsBuilder<ApplicationTransactionOptions> ConfigureTransactionOptions(this IServiceCollection services, IConfigurationSection section)
24+
public static OptionsBuilder<TransactionOptions> ConfigureTransactionOptions(this IServiceCollection services, IConfigurationSection section)
2625
=> services
27-
.AddOptions<ApplicationTransactionOptions>()
26+
.AddOptions<TransactionOptions>()
2827
.Bind(section)
29-
.Validate(options => options.IsolationLevel is not IsolationLevel.Unspecified);
28+
.Validate(
29+
validation: options => options.IsolationLevel is not System.Transactions.IsolationLevel.Unspecified,
30+
failureMessage: "Transaction isolation level must be specified");
3031
}
3132
}

src/Dotnet6.GraphQL4.Repositories.Abstractions/DependencyInjection/Options/ApplicationTransactionOptions.cs

Lines changed: 0 additions & 9 deletions
This file was deleted.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ public class UnitOfWork : IUnitOfWork
1515
{
1616
private readonly DatabaseFacade _database;
1717
private readonly DbContext _dbContext;
18-
private readonly ApplicationTransactionOptions _options;
18+
private readonly TransactionOptions _options;
1919
private readonly INotificationContext _notificationContext;
2020

2121
public UnitOfWork(
2222
DbContext dbContext,
23-
IOptionsSnapshot<ApplicationTransactionOptions> optionsMonitor,
23+
IOptionsSnapshot<TransactionOptions> optionsMonitor,
2424
INotificationContext notificationContext)
2525
{
2626
_dbContext = dbContext;

src/Dotnet6.GraphQL4.Store.Repositories/Migrations/20210310173753_First migration.Designer.cs

Lines changed: 0 additions & 741 deletions
This file was deleted.

src/Dotnet6.GraphQL4.Store.Repositories/Migrations/20210310173753_First migration.cs

Lines changed: 0 additions & 223 deletions
This file was deleted.

src/Dotnet6.GraphQL4.Store.Repositories/Migrations/StoreDbContextModelSnapshot.cs

Lines changed: 371 additions & 370 deletions
Large diffs are not rendered by default.

src/Dotnet6.GraphQL4.Store.WebAPI/Program.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,7 @@ public static class Program
1414
{
1515
private static IHostBuilder CreateHostBuilder(string[] args)
1616
=> Host.CreateDefaultBuilder(args)
17-
.UseSerilog(
18-
(context, services, configuration)
19-
=> configuration
20-
.ReadFrom.Configuration(context.Configuration)
21-
.ReadFrom.Services(services)
22-
.Enrich.FromLogContext()
23-
.WriteTo.Console())
17+
.UseSerilog()
2418
.ConfigureWebHostDefaults(webBuilder => webBuilder.UseStartup<Startup>())
2519
.UseDefaultServiceProvider(
2620
(context, options) =>

src/Dotnet6.GraphQL4.Store.WebAPI/Startup.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
using Dotnet6.GraphQL4.Store.Repositories.Contexts;
55
using Dotnet6.GraphQL4.Store.WebAPI.Extensions.EndpointRouteBuilders;
66
using Dotnet6.GraphQL4.Repositories.Abstractions.DependencyInjection.Extensions;
7+
using Dotnet6.GraphQL4.Repositories.Abstractions.DependencyInjection.Options;
78
using Dotnet6.GraphQL4.Services.Abstractions.DependencyInjection.Extensions;
89
using Dotnet6.GraphQL4.Store.Repositories.DependencyInjection.Extensions;
10+
using Dotnet6.GraphQL4.Store.Repositories.DependencyInjection.Options;
911
using Dotnet6.GraphQL4.Store.WebAPI.DependencyInjection.Extensions;
1012
using Dotnet6.GraphQL4.Store.WebAPI.Graphs;
1113
using HealthChecks.UI.Client;
@@ -82,8 +84,8 @@ public void Configure(IApplicationBuilder app , ILoggerFactory loggerFactory)
8284

8385
public void ConfigureServices(IServiceCollection services)
8486
{
85-
services.ConfigureTransactionOptions(_configuration.GetSection("Transactions"));
86-
services.ConfigureSqlServerRetryingOptions(_configuration.GetSection("SqlServerRetryingOptions"));
87+
services.ConfigureTransactionOptions(_configuration.GetSection(nameof(TransactionOptions)));
88+
services.ConfigureSqlServerRetryingOptions(_configuration.GetSection(nameof(SqlServerRetryingOptions)));
8789

8890
services
8991
.AddLogging()

src/Dotnet6.GraphQL4.Store.WebAPI/appsettings.Development.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"MaxSecondsRetryDelay": 5,
55
"ErrorNumbersToAdd": []
66
},
7-
"Transactions": {
7+
"TransactionsOptions": {
88
"IsolationLevel": "ReadCommitted"
99
},
1010
"HealthChecksPatterns": {

0 commit comments

Comments
 (0)