diff --git a/src/Services/Basket/Basket.API/Basket.API.csproj b/src/Services/Basket/Basket.API/Basket.API.csproj index b0e9ca4ca..4ec4811e5 100644 --- a/src/Services/Basket/Basket.API/Basket.API.csproj +++ b/src/Services/Basket/Basket.API/Basket.API.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net5.0 $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; ..\..\..\..\docker-compose.dcproj false diff --git a/src/Services/Basket/Basket.API/Dockerfile b/src/Services/Basket/Basket.API/Dockerfile index f04156711..53bcc38c4 100644 --- a/src/Services/Basket/Basket.API/Dockerfile +++ b/src/Services/Basket/Basket.API/Dockerfile @@ -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 diff --git a/src/Services/Basket/Basket.API/Model/BasketCheckout.cs b/src/Services/Basket/Basket.API/Model/BasketCheckout.cs index 410700773..70173611f 100644 --- a/src/Services/Basket/Basket.API/Model/BasketCheckout.cs +++ b/src/Services/Basket/Basket.API/Model/BasketCheckout.cs @@ -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; } } diff --git a/src/Services/Basket/Basket.API/Model/BasketItem.cs b/src/Services/Basket/Basket.API/Model/BasketItem.cs index 4d2e4f331..e0414884c 100644 --- a/src/Services/Basket/Basket.API/Model/BasketItem.cs +++ b/src/Services/Basket/Basket.API/Model/BasketItem.cs @@ -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 Validate(ValidationContext validationContext) { var results = new List(); diff --git a/src/Services/Basket/Basket.API/Model/CustomerBasket.cs b/src/Services/Basket/Basket.API/Model/CustomerBasket.cs index 9ae495d4f..c30393417 100644 --- a/src/Services/Basket/Basket.API/Model/CustomerBasket.cs +++ b/src/Services/Basket/Basket.API/Model/CustomerBasket.cs @@ -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 Items { get; set; } = new List(); + public List Items { get; init; } = new List(); public CustomerBasket() { diff --git a/src/Services/Basket/Basket.FunctionalTests/Basket.FunctionalTests.csproj b/src/Services/Basket/Basket.FunctionalTests/Basket.FunctionalTests.csproj index fa01363de..ed6c9214e 100644 --- a/src/Services/Basket/Basket.FunctionalTests/Basket.FunctionalTests.csproj +++ b/src/Services/Basket/Basket.FunctionalTests/Basket.FunctionalTests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net5.0 false diff --git a/src/Services/Basket/Basket.UnitTests/Basket.UnitTests.csproj b/src/Services/Basket/Basket.UnitTests/Basket.UnitTests.csproj index 920b4f1da..e97affa25 100644 --- a/src/Services/Basket/Basket.UnitTests/Basket.UnitTests.csproj +++ b/src/Services/Basket/Basket.UnitTests/Basket.UnitTests.csproj @@ -1,19 +1,19 @@  - netcoreapp3.1 + net5.0 false false - - - - - - - + + + + + + + all runtime; build; native; contentfiles; analyzers diff --git a/src/Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj b/src/Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj index 0239c1ade..950daac27 100644 --- a/src/Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj +++ b/src/Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net5.0 true false false @@ -67,10 +67,10 @@ - - + + - + all runtime; build; native; contentfiles; analyzers