9.3.1 Extending the Domain Model; Listing 9-8 The Contents of the ShippingDetails.cs File

chap09
Jason Zhu 2021-09-22 11:34:57 +10:00
parent 4027f863cc
commit 35419556fe
2 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SportsStore.Domain.Entities
{
public class ShippingDetails
{
[Required(ErrorMessage = "Please enter a name")]
public string Name { get; set; }
[Required(ErrorMessage = "Please enter the first address line")]
public string Line1 { get; set; }
public string Line2 { get; set; }
public string Line3 { get; set; }
[Required(ErrorMessage = "Please enter a city name")]
public string City { get; set; }
[Required(ErrorMessage = "Please enter a state name")]
public string State { get; set; }
public string Zip { get; set; }
[Required(ErrorMessage = "Please enter a country name")]
public string Country { get; set; }
public bool GiftWrap { get; set; }
}
}

View File

@ -77,6 +77,7 @@
<Compile Include="Concrete\EFProductRepository.cs" />
<Compile Include="Entities\Cart.cs" />
<Compile Include="Entities\Product.cs" />
<Compile Include="Entities\ShippingDetails.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>