Continued to work on the update student handler

This commit is contained in:
2019-04-29 13:54:10 -04:00
parent 8cacaa36ce
commit 9f2b9bcff9
10 changed files with 114 additions and 24 deletions

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
namespace BrightGlimmer.Domain
@@ -47,18 +48,33 @@ namespace BrightGlimmer.Domain
MiddleName = student.MiddleName;
LastName = student.LastName;
Email = student.Email;
}
if ()
public void UpdateAddress(Address address)
{
Address.Update(address);
}
public bool UpdatePhone(Phone phone)
{
var existingPhone = Phones.SingleOrDefault(x => x.Id == phone.Id);
if (existingPhone == null)
{
return false;
}
existingPhone.Update(phone);
return true;
}
public void AddPhone(Phone phone)
{
phones.Add(phone);
phones.Add(new Phone(phone));
}
public void AddAssignedCourse(AssignedCourse assignedCourse)
{
assignedCourses.Add(assignedCourse);
assignedCourses.Add(new AssignedCourse(assignedCourse));
}
}
}