-
Notifications
You must be signed in to change notification settings - Fork 58
Expand file tree
/
Copy pathUserShippingAddressUpdateModel.cs
More file actions
36 lines (28 loc) · 1.14 KB
/
UserShippingAddressUpdateModel.cs
File metadata and controls
36 lines (28 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System.ComponentModel.DataAnnotations;
using DevBetterWeb.Core.Entities;
namespace DevBetterWeb.Web.Pages.User;
public class UserShippingAddressUpdateModel
{
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
public UserShippingAddressUpdateModel()
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
{
}
public UserShippingAddressUpdateModel(Member member)
{
#pragma warning disable CS8602 // Dereference of a possibly null reference.
this.Street = member.ShippingAddress.Street;
#pragma warning restore CS8602 // Dereference of a possibly null reference.
this.City = member.ShippingAddress.City;
this.State = member.ShippingAddress.State;
this.PostalCode = member.ShippingAddress.PostalCode;
this.Country = member.ShippingAddress.Country;
}
[Required]
public string City { get; set; }
[Required]
public string Country { get; set; }
public string State { get; set; }
public string Street { get; set; }
public string PostalCode { get; set; }
}