diff --git a/HrynCo.NotificationService.DAL.EF/Repositories/EmailChannelRepository.cs b/HrynCo.NotificationService.DAL.EF/Repositories/EmailChannelRepository.cs index 840bd74..bba5a2d 100644 --- a/HrynCo.NotificationService.DAL.EF/Repositories/EmailChannelRepository.cs +++ b/HrynCo.NotificationService.DAL.EF/Repositories/EmailChannelRepository.cs @@ -16,6 +16,7 @@ internal sealed class EmailChannelRepository : EfRepository, public async Task> GetAllAsync(CancellationToken ct = default) { var entities = await DbSet + .AsNoTracking() .OrderBy(x => x.ServiceName) .ThenBy(x => x.Priority) .ToListAsync(ct); @@ -26,6 +27,7 @@ internal sealed class EmailChannelRepository : EfRepository, public async Task> GetByServiceAsync(string serviceName, CancellationToken ct = default) { var entities = await DbSet + .AsNoTracking() .Where(x => x.ServiceName == serviceName) .OrderBy(x => x.Priority) .ToListAsync(ct); @@ -35,7 +37,7 @@ internal sealed class EmailChannelRepository : EfRepository, public async Task GetByIdAsync(Guid id, CancellationToken ct = default) { - EmailChannelEntity? entity = await DbSet.FindAsync([id], ct); + EmailChannelEntity? entity = await DbSet.AsNoTracking().FirstOrDefaultAsync(x => x.Id == id, ct); return entity is null ? null : MapToDomain(entity); } diff --git a/HrynCo.NotificationService.Web/Views/AdminChannels/Edit.cshtml b/HrynCo.NotificationService.Web/Views/AdminChannels/Edit.cshtml index 7beb11c..6c76202 100644 --- a/HrynCo.NotificationService.Web/Views/AdminChannels/Edit.cshtml +++ b/HrynCo.NotificationService.Web/Views/AdminChannels/Edit.cshtml @@ -123,7 +123,7 @@ @if (!Model.IsNew) { - } @@ -135,62 +135,64 @@ @if (!Model.IsNew) { - + +@section Scripts { + @RenderSection("Scripts", required: false) +} diff --git a/HrynCo.NotificationService.Web/Views/Shared/_Layout.cshtml b/HrynCo.NotificationService.Web/Views/Shared/_Layout.cshtml index 39b28bd..8a20aec 100644 --- a/HrynCo.NotificationService.Web/Views/Shared/_Layout.cshtml +++ b/HrynCo.NotificationService.Web/Views/Shared/_Layout.cshtml @@ -51,5 +51,6 @@ + @RenderSection("Scripts", required: false)