Skip to content

Commit

Permalink
Upgrade to .NET 5.0 and EF 5.0 (#102)
Browse files Browse the repository at this point in the history
* Upgraded EF, AspnNet, Sample projects to .net 5.0

* Updated other projects to .net 5

* removed langversion
fixed deprecated interfaces

* Fixed badge in docs

* Fixed dependency

* Updated MediatR and Benchmark.Net

* Test projects deps upgrade

* Serilog upgrade

* Upgraded packages

* Package upgrades

* Process manager sample

* Various changes after upgrade
  • Loading branch information
fraliv13 authored Dec 10, 2020
1 parent a289465 commit 4ac9189
Show file tree
Hide file tree
Showing 171 changed files with 531 additions and 1,524 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Authors>Totalsoft</Authors>
<Company>Totalsoft</Company>
<PackageTags>totalsoft nbb</PackageTags>

<LangVersion>latest</LangVersion>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
Expand Down
23 changes: 1 addition & 22 deletions NBB.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Messaging", "Messaging", "{
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NBB.Messaging.Abstractions", "src\Messaging\NBB.Messaging.Abstractions\NBB.Messaging.Abstractions.csproj", "{2D956C4C-140C-4C4B-8975-43F82EBC06B6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NBB.Messaging.Kafka", "src\Messaging\NBB.Messaging.Kafka\NBB.Messaging.Kafka.csproj", "{3DA45457-D5D3-4C20-BF33-62701B2344E2}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Domain", "Domain", "{77D2CC92-A3CB-499E-9A85-DDFB74D56580}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NBB.Domain.Abstractions", "src\Domain\NBB.Domain.Abstractions\NBB.Domain.Abstractions.csproj", "{5EDA8FDA-2639-464F-A835-97006BDB8C4F}"
Expand Down Expand Up @@ -102,8 +100,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NBB.Domain.Tests", "test\Un
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NBB.Contracts.ReadModel", "samples\MicroServices\NBB.Contracts\NBB.Contracts.ReadModel\NBB.Contracts.ReadModel.csproj", "{5169916E-092C-431A-8577-50F2713C10CB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NBB.Messaging.Kafka.Tests", "test\UnitTests\Messaging\NBB.Messaging.Kafka.Tests\NBB.Messaging.Kafka.Tests.csproj", "{BDEEFBFC-2997-4E51-A88B-C6B75EB903EA}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{14726095-DA28-43A6-A9A9-F16C605932E1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NBB.Core.Abstractions", "src\Core\NBB.Core.Abstractions\NBB.Core.Abstractions.csproj", "{2F591414-63E0-4CD8-AA1E-11132CC20EA9}"
Expand All @@ -120,7 +116,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NBB.EventStore.MessagingExt
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Benchmarks", "Benchmarks", "{BE777108-64EF-4E35-93DD-A90B93A631B9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TheBenchmarks", "test\Benchmarks\TheBenchmarks\TheBenchmarks.csproj", "{A648A670-0A7B-49BC-8017-E3462A89916D}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventStoreBenchmarks", "test\Benchmarks\EventStoreBenchmarks\EventStoreBenchmarks.csproj", "{A648A670-0A7B-49BC-8017-E3462A89916D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NBB.EventStore.AdoNet", "src\EventStore\NBB.EventStore.AdoNet\NBB.EventStore.AdoNet.csproj", "{25A21016-7DF7-4884-9241-AC21D7D35ABE}"
EndProject
Expand Down Expand Up @@ -168,8 +164,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NBB.Contracts.ReadModel.Dat
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NBB.Contracts.WriteModel.Data", "samples\MicroServices\NBB.Contracts\NBB.Contracts.WriteModel.Data\NBB.Contracts.WriteModel.Data.csproj", "{AA04B90E-5182-413C-BF93-1D48AB8286D9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MessagingBenchmarks", "test\Benchmarks\MessagingBenchmarks\MessagingBenchmarks.csproj", "{93629A09-D01D-4E36-A2F8-04254C5847A1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NBB.Invoices.Application.Commands", "samples\MicroServices\NBB.Invoices\NBB.Invoices.Application.Commands\NBB.Invoices.Application.Commands.csproj", "{943E5F4C-FC1C-4DB2-A86C-7DC8E467E085}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NBB.Payments.Application.Commands", "samples\MicroServices\NBB.Payments\NBB.Payments.Application.Commands\NBB.Payments.Application.Commands.csproj", "{7BD9B88A-B8E1-45FB-8C92-C4389C4FEFBB}"
Expand Down Expand Up @@ -315,10 +309,6 @@ Global
{2D956C4C-140C-4C4B-8975-43F82EBC06B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2D956C4C-140C-4C4B-8975-43F82EBC06B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2D956C4C-140C-4C4B-8975-43F82EBC06B6}.Release|Any CPU.Build.0 = Release|Any CPU
{3DA45457-D5D3-4C20-BF33-62701B2344E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3DA45457-D5D3-4C20-BF33-62701B2344E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3DA45457-D5D3-4C20-BF33-62701B2344E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3DA45457-D5D3-4C20-BF33-62701B2344E2}.Release|Any CPU.Build.0 = Release|Any CPU
{5EDA8FDA-2639-464F-A835-97006BDB8C4F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5EDA8FDA-2639-464F-A835-97006BDB8C4F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5EDA8FDA-2639-464F-A835-97006BDB8C4F}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -443,10 +433,6 @@ Global
{5169916E-092C-431A-8577-50F2713C10CB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5169916E-092C-431A-8577-50F2713C10CB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5169916E-092C-431A-8577-50F2713C10CB}.Release|Any CPU.Build.0 = Release|Any CPU
{BDEEFBFC-2997-4E51-A88B-C6B75EB903EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BDEEFBFC-2997-4E51-A88B-C6B75EB903EA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BDEEFBFC-2997-4E51-A88B-C6B75EB903EA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BDEEFBFC-2997-4E51-A88B-C6B75EB903EA}.Release|Any CPU.Build.0 = Release|Any CPU
{2F591414-63E0-4CD8-AA1E-11132CC20EA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2F591414-63E0-4CD8-AA1E-11132CC20EA9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2F591414-63E0-4CD8-AA1E-11132CC20EA9}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -547,10 +533,6 @@ Global
{AA04B90E-5182-413C-BF93-1D48AB8286D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AA04B90E-5182-413C-BF93-1D48AB8286D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AA04B90E-5182-413C-BF93-1D48AB8286D9}.Release|Any CPU.Build.0 = Release|Any CPU
{93629A09-D01D-4E36-A2F8-04254C5847A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{93629A09-D01D-4E36-A2F8-04254C5847A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{93629A09-D01D-4E36-A2F8-04254C5847A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{93629A09-D01D-4E36-A2F8-04254C5847A1}.Release|Any CPU.Build.0 = Release|Any CPU
{943E5F4C-FC1C-4DB2-A86C-7DC8E467E085}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{943E5F4C-FC1C-4DB2-A86C-7DC8E467E085}.Debug|Any CPU.Build.0 = Debug|Any CPU
{943E5F4C-FC1C-4DB2-A86C-7DC8E467E085}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -756,7 +738,6 @@ Global
GlobalSection(NestedProjects) = preSolution
{584C62C0-2AE6-4DD6-9BCF-8FF28B7122CE} = {7311E32F-C1B0-41C9-B5F1-DE9EBB6ABB55}
{2D956C4C-140C-4C4B-8975-43F82EBC06B6} = {584C62C0-2AE6-4DD6-9BCF-8FF28B7122CE}
{3DA45457-D5D3-4C20-BF33-62701B2344E2} = {584C62C0-2AE6-4DD6-9BCF-8FF28B7122CE}
{77D2CC92-A3CB-499E-9A85-DDFB74D56580} = {7311E32F-C1B0-41C9-B5F1-DE9EBB6ABB55}
{5EDA8FDA-2639-464F-A835-97006BDB8C4F} = {77D2CC92-A3CB-499E-9A85-DDFB74D56580}
{F031DBDA-5D3F-4CE6-B133-09CE7E212584} = {7311E32F-C1B0-41C9-B5F1-DE9EBB6ABB55}
Expand Down Expand Up @@ -796,7 +777,6 @@ Global
{50F9866B-D6A0-46D1-AAF2-36244698400F} = {0407911F-89FC-4138-BD4D-D4CFCFBB5DC1}
{0F083FAE-6716-4CA8-8003-252067B2FBF6} = {97A37162-5696-48A1-8C7B-DCA03A23170B}
{5169916E-092C-431A-8577-50F2713C10CB} = {A820C4C2-1472-46ED-BA95-47B588B1D7AF}
{BDEEFBFC-2997-4E51-A88B-C6B75EB903EA} = {A4361674-5AB7-442D-8DA7-7187C9BCA38F}
{14726095-DA28-43A6-A9A9-F16C605932E1} = {7311E32F-C1B0-41C9-B5F1-DE9EBB6ABB55}
{2F591414-63E0-4CD8-AA1E-11132CC20EA9} = {14726095-DA28-43A6-A9A9-F16C605932E1}
{602F852F-77EE-4335-BA45-170C32440575} = {584C62C0-2AE6-4DD6-9BCF-8FF28B7122CE}
Expand Down Expand Up @@ -828,7 +808,6 @@ Global
{341DA1A8-E1E3-4FDB-A53D-5433208B4305} = {A820C4C2-1472-46ED-BA95-47B588B1D7AF}
{CCD72C53-E7A9-4E1E-9FC4-AE53D96CDEF3} = {A820C4C2-1472-46ED-BA95-47B588B1D7AF}
{AA04B90E-5182-413C-BF93-1D48AB8286D9} = {A820C4C2-1472-46ED-BA95-47B588B1D7AF}
{93629A09-D01D-4E36-A2F8-04254C5847A1} = {BE777108-64EF-4E35-93DD-A90B93A631B9}
{943E5F4C-FC1C-4DB2-A86C-7DC8E467E085} = {8AA188B0-D775-49CD-BA6E-233B51B446D9}
{7BD9B88A-B8E1-45FB-8C92-C4389C4FEFBB} = {508F9587-A3CD-41EF-A5A3-36BE04BB6D1B}
{404998FD-60A3-414E-A30F-FAE46AE28158} = {90E022FB-CA1B-49DD-9BEA-CE7F8E74E8BB}
Expand Down
39 changes: 18 additions & 21 deletions dependencies.props
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
<Project>
<PropertyGroup Label="Package Versions">
<NewtonsoftJsonPackageVersion>11.0.2</NewtonsoftJsonPackageVersion>
<MediatRPackageVersion>4.1.0</MediatRPackageVersion>
<ScrutorPackageVersion>3.1.0</ScrutorPackageVersion>
<BenchmarkDotNetPackageVersion>0.10.14</BenchmarkDotNetPackageVersion>
<MoqPackageVersion>4.8.2</MoqPackageVersion>
<XunitPackageVersion>2.3.1</XunitPackageVersion>
<XunitRunnerVisualStudioPackageVersion>2.4.0-beta.1.build3958</XunitRunnerVisualStudioPackageVersion>
<FluentAssertionsPackageVersion>5.10.0</FluentAssertionsPackageVersion>
<MicrosoftExtensionsPackagesVersion>2.2.0</MicrosoftExtensionsPackagesVersion>
<MicrosoftEntityFrameworkPackagesVersion>2.1.4</MicrosoftEntityFrameworkPackagesVersion>
<MicrosoftAspNetCoreAppPackageVersion>2.1.5</MicrosoftAspNetCoreAppPackageVersion>
<MicrosoftCSharpPackageVersion>4.6.0</MicrosoftCSharpPackageVersion>
<SerilogPackageVersion>2.7.1</SerilogPackageVersion>
<SerilogExtensionsLoggingPackageVersion>2.0.2</SerilogExtensionsLoggingPackageVersion>
<SerilogSinksMSSqlServerPackageVersion>5.1.2</SerilogSinksMSSqlServerPackageVersion>
<SerilogAspNetCorePackageVersion>2.1.1</SerilogAspNetCorePackageVersion>
<AutoMapperPackageVersion>8.0.0</AutoMapperPackageVersion>
<OpenTracingPackageVersion>0.12.0</OpenTracingPackageVersion>
<OpenTracingContribPackageVersion>0.5.0</OpenTracingContribPackageVersion>
<JaegerPackageVersion>0.2.2</JaegerPackageVersion>
<NBBPackagesVersion>4.1.0</NBBPackagesVersion>
<NewtonsoftJsonPackageVersion>12.0.3</NewtonsoftJsonPackageVersion>
<MediatRPackageVersion>9.0.0</MediatRPackageVersion>
<ScrutorPackageVersion>3.3.0</ScrutorPackageVersion>
<BenchmarkDotNetPackageVersion>0.12.1</BenchmarkDotNetPackageVersion>
<MoqPackageVersion>4.15.2</MoqPackageVersion>
<XunitPackageVersion>2.4.1</XunitPackageVersion>
<XunitRunnerVisualStudioPackageVersion>2.4.3</XunitRunnerVisualStudioPackageVersion>
<FsUnitPackageVersion>4.0.2</FsUnitPackageVersion>
<FluentAssertionsPackageVersion>5.10.3</FluentAssertionsPackageVersion>
<MicrosoftExtensionsPackagesVersion>5.0.0</MicrosoftExtensionsPackagesVersion>
<MicrosoftEntityFrameworkPackagesVersion>5.0.0</MicrosoftEntityFrameworkPackagesVersion>
<MicrosoftCSharpPackageVersion>4.7.0</MicrosoftCSharpPackageVersion>
<SerilogPackageVersion>2.10.0</SerilogPackageVersion>
<SerilogExtensionsLoggingPackageVersion>3.0.1</SerilogExtensionsLoggingPackageVersion>
<SerilogSinksMSSqlServerPackageVersion>5.6.0</SerilogSinksMSSqlServerPackageVersion>
<SerilogAspNetCorePackageVersion>3.4.0</SerilogAspNetCorePackageVersion>
<AutoMapperPackageVersion>10.1.1</AutoMapperPackageVersion>
<OpenTracingPackageVersion>0.12.1</OpenTracingPackageVersion>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion docs/DocFx/DocFx.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

</Project>
2 changes: 1 addition & 1 deletion docs/DocFx/articles/domain_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ If you want to use an EventStore for Audit you can hook the *EventedCrudReposito
.AddScoped<ICrudRepository<Invoice>, EfCrudRepository<Invoice, InvoicesDbContext>>()
.Decorate<ICrudRepository<Invoice>, EventedCrudRepositoryDecorator<Invoice>>();

services.AddEntityFrameworkSqlServer().AddDbContext<InvoicesDbContext>(
services.AddDbContext<InvoicesDbContext>(
(serviceProvider, options) =>
{
var configuration = serviceProvider.GetService<IConfiguration>();
Expand Down
2 changes: 1 addition & 1 deletion docs/DocFx/index.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Build Status
[![Build status](https://abilauca.visualstudio.com/NBB/_apis/build/status/NBB-CI)](https://abilauca.visualstudio.com/NBB/_build/latest?definitionId=9)
[![Build status](https://dev.azure.com/totalsoft//NBB/_apis/build/status/NBB-CI-GitHub)](https://dev.azure.com/totalsoft/NBB/_build/latest?definitionId=35)
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
<UserSecretsId>NBB_Contracts_6a73f87d-2175-4be0-9a42-31cb73bc8e10</UserSecretsId>
</PropertyGroup>
Expand All @@ -25,14 +25,6 @@
<Folder Include="wwwroot\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" />
</ItemGroup>

<ItemGroup>
<None Include="appsettings.json">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
Expand All @@ -41,7 +33,6 @@

<ItemGroup>
<ProjectReference Include="..\..\..\..\src\Correlation\NBB.Correlation.AspNet\NBB.Correlation.AspNet.csproj" />
<ProjectReference Include="..\..\..\..\src\Messaging\NBB.Messaging.Kafka\NBB.Messaging.Kafka.csproj" />
<ProjectReference Include="..\..\..\..\src\Messaging\NBB.Messaging.MultiTenancy\NBB.Messaging.MultiTenancy.csproj" />
<ProjectReference Include="..\..\..\..\src\Messaging\NBB.Messaging.Nats\NBB.Messaging.Nats.csproj" />
<ProjectReference Include="..\..\..\..\src\MultiTenancy\NBB.MultiTenancy.AspNet\NBB.MultiTenancy.AspNet.csproj" />
Expand Down
20 changes: 11 additions & 9 deletions samples/MicroServices/NBB.Contracts/NBB.Contracts.Api/Program.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;

using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;

namespace NBB.Contracts.Api
{
public static class Program
{
{
public static void Main(string[] args)
{
BuildWebHost(args).Run();
CreateHostBuilder(args).Build().Run();
}

public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.Build();
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
}
}
10 changes: 8 additions & 2 deletions samples/MicroServices/NBB.Contracts/NBB.Contracts.Api/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Hosting;
using NBB.Contracts.Api.MultiTenancy;
using NBB.Contracts.ReadModel.Data;
using NBB.Correlation.AspNet;
Expand Down Expand Up @@ -46,7 +47,7 @@ public void ConfigureServices(IServiceCollection services)
}

// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.UseCorrelation();

Expand All @@ -57,7 +58,12 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)

//app.UseTenantMiddleware();

app.UseMvc();
app.UseRouting();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();

});
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,30 @@ public ContractCommandHandlers(IEventSourcedRepository<Contract> repository)
this._repository = repository;
}

public async Task Handle(CreateContract command, CancellationToken cancellationToken)
public async Task<Unit> Handle(CreateContract command, CancellationToken cancellationToken)
{
var contract = new Contract(command.ClientId);
await _repository.SaveAsync(contract, cancellationToken);

return Unit.Value;
}

public async Task Handle(AddContractLine command, CancellationToken cancellationToken)
public async Task<Unit> Handle(AddContractLine command, CancellationToken cancellationToken)
{
var contract = await _repository.GetByIdAsync(command.ContractId, cancellationToken);
contract.AddContractLine(command.Product, command.Price, command.Quantity);
await _repository.SaveAsync(contract, cancellationToken);

return Unit.Value;
}

public async Task Handle(ValidateContract command, CancellationToken cancellationToken)
public async Task<Unit> Handle(ValidateContract command, CancellationToken cancellationToken)
{
var contract = await _repository.GetByIdAsync(command.ContractId, cancellationToken);
contract.Validate();
await _repository.SaveAsync(contract, cancellationToken);

return Unit.Value;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<UserSecretsId>NBB_Contracts_6a73f87d-2175-4be0-9a42-31cb73bc8e10</UserSecretsId>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static void AddContractsReadModelDataAccess(this IServiceCollection servi
services.AddEfCrudRepository<ContractReadModel, ContractsReadDbContext>();
services.AddEfQuery<ContractReadModel, ContractsReadDbContext>();

services.AddEntityFrameworkSqlServer().AddDbContext<ContractsReadDbContext>(
services.AddDbContext<ContractsReadDbContext>(
(serviceProvider, options) =>
{
var configuration = serviceProvider.GetService<IConfiguration>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

</Project>
Loading

0 comments on commit 4ac9189

Please sign in to comment.