Continued to work on the update student handler

This commit is contained in:
Giovani
2019-04-29 13:54:10 -04:00
parent 125a9d4bb6
commit a25ff270c5
10 changed files with 114 additions and 24 deletions

View File

@@ -1,4 +1,5 @@
using System;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;
@@ -8,9 +9,12 @@ namespace BrightGlimmer.Domain
[Table("Phones")]
public class Phone : Entity
{
public PhoneType Type { get; set; }
public int AreaCode { get; set; }
public int Number { get; set; }
[JsonProperty]
public PhoneType Type { get; private set; }
[JsonProperty]
public int AreaCode { get; private set; }
[JsonProperty]
public int Number { get; private set; }
private Phone() { }
@@ -20,5 +24,19 @@ namespace BrightGlimmer.Domain
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;
}
}
}