Finished student controller and started course controller

This commit is contained in:
2019-05-03 13:56:16 -05:00
parent 1ee8747c8e
commit 08c92753f1
4 changed files with 41 additions and 4 deletions

View File

@@ -22,12 +22,12 @@ namespace BrightGlimmer.Service.Handlers.CommandHandlers
public async Task<bool> Handle(DeleteStudentCommand request, CancellationToken cancellationToken)
{
/* TODO: CHANGE TO SOFT DELETE */
var student = await repository.GetAsync(request.Id);
student.Address.Delete();
student.Address?.Delete();
student.AssignedCourses.ToList().ForEach(x => x.Delete());
student.Phones.ToList().ForEach(x => x.Delete());
student.Delete();
await repository.UnitOfWork.SaveChangesAsync();
return true;