mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
Add details view for tested media with data display and initialization logic
This commit is contained in:
1495
Aaru.Server/Components/Admin/Pages/TestedMedia/Details.razor
Normal file
1495
Aaru.Server/Components/Admin/Pages/TestedMedia/Details.razor
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,28 @@
|
|||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using DbContext = Aaru.Server.Database.DbContext;
|
||||||
|
|
||||||
|
namespace Aaru.Server.Components.Admin.Pages.TestedMedia;
|
||||||
|
|
||||||
|
public partial class Details
|
||||||
|
{
|
||||||
|
bool _initialized;
|
||||||
|
CommonTypes.Metadata.TestedMedia? _model;
|
||||||
|
[Parameter]
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
protected override async Task OnInitializedAsync()
|
||||||
|
{
|
||||||
|
await base.OnInitializedAsync();
|
||||||
|
|
||||||
|
StateHasChanged();
|
||||||
|
|
||||||
|
await using DbContext ctx = await DbContextFactory.CreateDbContextAsync();
|
||||||
|
|
||||||
|
_model = await ctx.TestedMedia.FirstOrDefaultAsync(m => m.Id == Id);
|
||||||
|
|
||||||
|
_initialized = true;
|
||||||
|
|
||||||
|
StateHasChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user