Started to create authorization portion pt.2
This commit is contained in:
75
BrightGlimmer.Domain/Service/Address.cs
Normal file
75
BrightGlimmer.Domain/Service/Address.cs
Normal file
@@ -0,0 +1,75 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text;
|
||||
|
||||
namespace BrightGlimmer.Domain.Service
|
||||
{
|
||||
[Table("Addresses")]
|
||||
public class Address : Entity
|
||||
{
|
||||
public string StreetAddress1 { get; private set; }
|
||||
public string StreetAddress2 { get; private set; }
|
||||
public string City { get; private set; }
|
||||
public string StateCode { get; private set; }
|
||||
public string County { get; private set; }
|
||||
public string ZipCode { get; private set; }
|
||||
[JsonIgnore]
|
||||
public decimal Latitude { get; private set; }
|
||||
[JsonIgnore]
|
||||
public decimal Longitude { get; private set; }
|
||||
|
||||
protected Address() { }
|
||||
|
||||
public Address(string streetAddress1,
|
||||
string streetAddress2,
|
||||
string city,
|
||||
string stateCode,
|
||||
string county,
|
||||
string zipCode)
|
||||
{
|
||||
StreetAddress1 = streetAddress1;
|
||||
StreetAddress2 = streetAddress2;
|
||||
City = city;
|
||||
StateCode = stateCode;
|
||||
County = county;
|
||||
ZipCode = zipCode;
|
||||
}
|
||||
|
||||
public Address(string streetAddress1,
|
||||
string streetAddress2,
|
||||
string city,
|
||||
string stateCode,
|
||||
string county,
|
||||
string zipCode,
|
||||
decimal latitude,
|
||||
decimal longitude)
|
||||
{
|
||||
StreetAddress1 = streetAddress1;
|
||||
StreetAddress2 = streetAddress2;
|
||||
City = city;
|
||||
StateCode = stateCode;
|
||||
County = county;
|
||||
ZipCode = zipCode;
|
||||
Latitude = latitude;
|
||||
Longitude = longitude;
|
||||
}
|
||||
|
||||
internal void Update(Address address)
|
||||
{
|
||||
StreetAddress1 = address.StreetAddress1;
|
||||
StreetAddress2 = address.StreetAddress2;
|
||||
City = address.City;
|
||||
StateCode = address.StateCode;
|
||||
County = address.County;
|
||||
ZipCode = address.ZipCode;
|
||||
}
|
||||
|
||||
public void SetLatitudeAndLongitude(decimal latitude, decimal longitude)
|
||||
{
|
||||
Latitude = latitude;
|
||||
Longitude = longitude;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user