Files
2026-03-24 15:26:03 -05:00

23 lines
860 B
C#

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<ExecutionMessage> FindByIdAsync(int id)
{
return await _context.ExecutionMessages
.AsNoTracking()
.FirstOrDefaultAsync(workItemExecution => workItemExecution.ExecutionMessageId == id);
}
public async Task<ExecutionMessage> AddAsync(ExecutionMessage workItemExecution)
{
var result = await _context.ExecutionMessages.AddAsync(workItemExecution);
return result.Entity;
}
}