diff --git a/BrightGlimmer.Api/Controllers/CourseController.cs b/BrightGlimmer.Api/Controllers/CourseController.cs index 6bc8634..971329c 100644 --- a/BrightGlimmer.Api/Controllers/CourseController.cs +++ b/BrightGlimmer.Api/Controllers/CourseController.cs @@ -1,5 +1,7 @@ using MediatR; using Microsoft.AspNetCore.Mvc; +using System; +using System.Threading.Tasks; namespace BrightGlimmer.Api.Controllers { @@ -15,9 +17,34 @@ namespace BrightGlimmer.Api.Controllers } [HttpGet] - public ActionResult Get() + public async Task Get() { - return ""; + return new JsonResult(""); + } + + [HttpGet] + [Route("{id}")] + public async Task Get(Guid id) + { + return new JsonResult(""); + } + + [HttpPost] + public async Task Create([FromBody]object command) + { + return new JsonResult(""); + } + + [HttpPut] + public async Task Update([FromBody]object command) + { + return new JsonResult(""); + } + + [HttpDelete("{id}")] + public async Task Delete(Guid id) + { + return new JsonResult(""); } } } diff --git a/BrightGlimmer.Data/bright_glimmer.db b/BrightGlimmer.Data/bright_glimmer.db index a007be3..49dd8f9 100644 Binary files a/BrightGlimmer.Data/bright_glimmer.db and b/BrightGlimmer.Data/bright_glimmer.db differ diff --git a/BrightGlimmer.Service/Handlers/CommandHandlers/DeleteStudentCommandHandler.cs b/BrightGlimmer.Service/Handlers/CommandHandlers/DeleteStudentCommandHandler.cs index f795627..278a03c 100644 --- a/BrightGlimmer.Service/Handlers/CommandHandlers/DeleteStudentCommandHandler.cs +++ b/BrightGlimmer.Service/Handlers/CommandHandlers/DeleteStudentCommandHandler.cs @@ -22,12 +22,12 @@ namespace BrightGlimmer.Service.Handlers.CommandHandlers public async Task 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; diff --git a/BrightGlimmer.Service/Queries/GetCourseQuery.cs b/BrightGlimmer.Service/Queries/GetCourseQuery.cs new file mode 100644 index 0000000..af89ea3 --- /dev/null +++ b/BrightGlimmer.Service/Queries/GetCourseQuery.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BrightGlimmer.Service.Queries +{ + class GetCourseQuery + { + } +}