Browse Source

update basket api to dotnet 5 and nuget packages

pull/1547/head
Borja García Rodríguez 4 years ago
parent
commit
51251a3f75
8 changed files with 37 additions and 37 deletions
  1. +1
    -1
      src/Services/Basket/Basket.API/Basket.API.csproj
  2. +2
    -2
      src/Services/Basket/Basket.API/Dockerfile
  3. +12
    -12
      src/Services/Basket/Basket.API/Model/BasketCheckout.cs
  4. +6
    -6
      src/Services/Basket/Basket.API/Model/BasketItem.cs
  5. +3
    -3
      src/Services/Basket/Basket.API/Model/CustomerBasket.cs
  6. +1
    -1
      src/Services/Basket/Basket.FunctionalTests/Basket.FunctionalTests.csproj
  7. +8
    -8
      src/Services/Basket/Basket.UnitTests/Basket.UnitTests.csproj
  8. +4
    -4
      src/Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj

+ 1
- 1
src/Services/Basket/Basket.API/Basket.API.csproj View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>


+ 2
- 2
src/Services/Basket/Basket.API/Dockerfile View File

@ -1,8 +1,8 @@
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles


+ 12
- 12
src/Services/Basket/Basket.API/Model/BasketCheckout.cs View File

@ -2,29 +2,29 @@
namespace Basket.API.Model
{
public class BasketCheckout
public record BasketCheckout
{
public string City { get; set; }
public string City { get; init; }
public string Street { get; set; }
public string Street { get; init; }
public string State { get; set; }
public string State { get; init; }
public string Country { get; set; }
public string Country { get; init; }
public string ZipCode { get; set; }
public string ZipCode { get; init; }
public string CardNumber { get; set; }
public string CardNumber { get; init; }
public string CardHolderName { get; set; }
public string CardHolderName { get; init; }
public DateTime CardExpiration { get; set; }
public DateTime CardExpiration { get; init; }
public string CardSecurityNumber { get; set; }
public string CardSecurityNumber { get; init; }
public int CardTypeId { get; set; }
public int CardTypeId { get; init; }
public string Buyer { get; set; }
public string Buyer { get; init; }
public Guid RequestId { get; set; }
}


+ 6
- 6
src/Services/Basket/Basket.API/Model/BasketItem.cs View File

@ -3,15 +3,15 @@ using System.ComponentModel.DataAnnotations;
namespace Microsoft.eShopOnContainers.Services.Basket.API.Model
{
public class BasketItem : IValidatableObject
public record BasketItem : IValidatableObject
{
public string Id { get; set; }
public int ProductId { get; set; }
public string ProductName { get; set; }
public string Id { get; init; }
public int ProductId { get; init; }
public string ProductName { get; init; }
public decimal UnitPrice { get; set; }
public decimal OldUnitPrice { get; set; }
public int Quantity { get; set; }
public string PictureUrl { get; set; }
public int Quantity { get; init; }
public string PictureUrl { get; init; }
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
var results = new List<ValidationResult>();


+ 3
- 3
src/Services/Basket/Basket.API/Model/CustomerBasket.cs View File

@ -2,11 +2,11 @@
namespace Microsoft.eShopOnContainers.Services.Basket.API.Model
{
public class CustomerBasket
public record CustomerBasket
{
public string BuyerId { get; set; }
public string BuyerId { get; init; }
public List<BasketItem> Items { get; set; } = new List<BasketItem>();
public List<BasketItem> Items { get; init; } = new List<BasketItem>();
public CustomerBasket()
{


+ 1
- 1
src/Services/Basket/Basket.FunctionalTests/Basket.FunctionalTests.csproj View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>


+ 8
- 8
src/Services/Basket/Basket.UnitTests/Basket.UnitTests.csproj View File

@ -1,19 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MediatR" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="3.1.0" />
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="3.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
<PackageReference Include="Microsoft.NETCore.Platforms" Version="3.1.0" />
<PackageReference Include="Moq" Version="4.13.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<PackageReference Include="MediatR" Version="9.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="5.0.1" />
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="5.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="Microsoft.NETCore.Platforms" Version="5.0.0" />
<PackageReference Include="Moq" Version="4.15.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>


+ 4
- 4
src/Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
@ -67,10 +67,10 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="3.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="5.0.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>


Loading…
Cancel
Save