แก้บั้กบันทึกคำสั่งไม่ได้

เพิ่มการใส่ค่าผู้ทำรายการใน GenericRepoository
This commit is contained in:
Suphonchai Phoonsawat 2023-08-04 09:47:58 +07:00
parent 71c8ff95e4
commit e8607f76fa
4 changed files with 29 additions and 12 deletions

View file

@ -42,6 +42,15 @@ namespace BMA.EHR.Application.Repositories.Commands
.FirstOrDefaultAsync(x => x.Id == id);
}
public override async Task<Command> AddAsync(Command command)
{
var status = await _dbContext.Set<CommandStatus>().FirstOrDefaultAsync(c => c.Sequence == 1);
command.CommandStatus = status!;
_dbContext.Attatch(status!);
return await base.AddAsync(command);
}
#endregion
public async Task<List<CommandReceiver>> GetReceiverByCommmandIdAsync(Guid Id)