using Microsoft.EntityFrameworkCore; using System.Threading.Tasks; using LCU.Api.Internal.DispatcherLib.Persistence; using LCU.Library.Internal.DispatcherModels.Entities; namespace LCU.Api.Internal.DispatcherLib.Repositories; public class ExecutionMessageRepository : BaseRepository, IExecutionMessageRepository { public ExecutionMessageRepository(AppDbContext context) : base(context) { } public async Task FindByIdAsync(int id) { return await _context.ExecutionMessages .AsNoTracking() .FirstOrDefaultAsync(workItemExecution => workItemExecution.ExecutionMessageId == id); } public async Task AddAsync(ExecutionMessage workItemExecution) { var result = await _context.ExecutionMessages.AddAsync(workItemExecution); return result.Entity; } }