Код: Выделить всё
@page "/searchapp"
@inject IApplicationTableService ApplicationService
@using MudBlazor
@using BlazorAppDB.Shared.Models
.custom-width {
width: 100px;
}
.header {
position: sticky;
top: 0;
background-color: white;
padding: 10px;
z-index: 1000;
}
.input-group {
display: flex;
align-items: center;
}
.input-group .mud-button {
margin-left: 10px;
}
.mud-spacing {
margin-bottom: 10px;
}
.small-textfield {
width: 150px; /* Adjust the width as needed */
}
Search for an application in the App Inventory[/b][b]
SEARCH THE APPS DATABASE[/b][b]
Search
x.AppId" Title="App ID" />
If you didn't find the app you were looking for, try a new search.[/b][b]If your app was not in the DB, please consider creating an entry for it using this link.[/b] [url=/createapp]Create App[/url]
@code {
private IEnumerable applications = Enumerable.Empty();
private string applicationType;
private string applicationName;
private string applicationOwner;
protected override async Task OnInitializedAsync()
{
try
{
applications = await ApplicationService.GetAllApplicationsAsync();
}
catch (Exception ex)
{
Console.WriteLine($"Error fetching applications: {ex.Message}");
applications = Enumerable.Empty();
}
}
private async Task SearchApplications()
{
try
{
applications = await ApplicationService.SearchApplications(applicationType, applicationName, applicationOwner);
if (!applications.Any())
{
Console.WriteLine("No applications found.");
}
}
catch (Exception ex)
{
Console.WriteLine($"Error fetching applications: {ex.Message}");
applications = Enumerable.Empty();
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/787 ... or-project
Мобильная версия