fix defect

This commit is contained in:
Suphonchai Phoonsawat 2023-12-18 15:50:42 +07:00
parent c798439c19
commit 0a080b09e4
4 changed files with 57 additions and 12 deletions

View file

@ -51,13 +51,20 @@ namespace BMA.EHR.Application.Repositories
{
try
{
var profile = await _dbContext.Set<Profile>().FirstOrDefaultAsync(x => x.Id == profileId);
var profile = await _dbContext.Set<Profile>()
.AsQueryable()
.Include(x => x.Prefix)
.FirstOrDefaultAsync(x => x.Id == profileId);
if (profile == null)
{
throw new Exception(GlobalMessages.DataNotFound);
}
else
{
var fullName = $"{profile.Prefix.Name}{profile.FirstName} {profile.LastName}";
Console.WriteLine(fullName);
profile.DutyTimeId = roundId;
profile.DutyTimeEffectiveDate = effectiveDate;