From b25a854ee1029290579e6ade93b3bc010cdcd978 Mon Sep 17 00:00:00 2001 From: vuanh25 Date: Tue, 19 Dec 2023 09:41:02 +0700 Subject: [PATCH] update examHistory --- .../DTOs/Catalog/ExamHistoryDto/CreateExamHistoryDto.cs | 2 +- .../Implement/Catalog/ExamHistorys/ExamHistoryService.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VNH.Application/DTOs/Catalog/ExamHistoryDto/CreateExamHistoryDto.cs b/VNH.Application/DTOs/Catalog/ExamHistoryDto/CreateExamHistoryDto.cs index c1e7bae..f400307 100644 --- a/VNH.Application/DTOs/Catalog/ExamHistoryDto/CreateExamHistoryDto.cs +++ b/VNH.Application/DTOs/Catalog/ExamHistoryDto/CreateExamHistoryDto.cs @@ -9,7 +9,7 @@ namespace VNH.Application.DTOs.Catalog.ExamHistory public class CreateExamHistoryDto { - public Guid Id { get; set; } = Guid.NewGuid(); + public Guid? Id { get; set; } = Guid.Empty; public Guid MultipleChoiceId { get; set; } public Guid UserId { get; set; } diff --git a/VNH.Infrastructure/Implement/Catalog/ExamHistorys/ExamHistoryService.cs b/VNH.Infrastructure/Implement/Catalog/ExamHistorys/ExamHistoryService.cs index 6ee10db..ca2efba 100644 --- a/VNH.Infrastructure/Implement/Catalog/ExamHistorys/ExamHistoryService.cs +++ b/VNH.Infrastructure/Implement/Catalog/ExamHistorys/ExamHistoryService.cs @@ -38,7 +38,7 @@ public async Task> Create(CreateExamHistoryDt var user = await _userManager.FindByEmailAsync(name); var examhistory = _mapper.Map(requestDto); var multiples = await _dataContext.MultipleChoices.FirstOrDefaultAsync(x => x.Id.Equals(requestDto.MultipleChoiceId)); - + examhistory.Id = Guid.NewGuid(); examhistory.MultipleChoiceId = requestDto.MultipleChoiceId; examhistory.UserId = requestDto.UserId; examhistory.StarDate = requestDto.StarDate;