Started to create authorization portion pt.2
This commit is contained in:
42
BrightGlimmer.Domain/Service/Phone.cs
Normal file
42
BrightGlimmer.Domain/Service/Phone.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text;
|
||||
|
||||
namespace BrightGlimmer.Domain.Service
|
||||
{
|
||||
[Table("Phones")]
|
||||
public class Phone : Entity
|
||||
{
|
||||
[JsonProperty]
|
||||
public PhoneType Type { get; private set; }
|
||||
[JsonProperty]
|
||||
public int AreaCode { get; private set; }
|
||||
[JsonProperty]
|
||||
public int Number { get; private set; }
|
||||
|
||||
protected Phone() { }
|
||||
|
||||
public Phone(PhoneType type, int areaCode, int number)
|
||||
{
|
||||
Type = type;
|
||||
AreaCode = areaCode;
|
||||
Number = number;
|
||||
}
|
||||
|
||||
public Phone(Phone phone)
|
||||
{
|
||||
Type = phone.Type;
|
||||
AreaCode = phone.AreaCode;
|
||||
Number = phone.Number;
|
||||
}
|
||||
|
||||
internal void Update(Phone phone)
|
||||
{
|
||||
Type = phone.Type;
|
||||
AreaCode = phone.AreaCode;
|
||||
Number = Number;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user