24 Commits

Author SHA1 Message Date
c475d0e6a4 Add pages for sound synthesizers. 2025-11-16 16:48:24 +00:00
9f89186dde Add endpoints to get computers by sound synthesizers. 2025-11-16 16:47:54 +00:00
733dc59f7b Add processors list and details pages. 2025-11-16 16:09:20 +00:00
5b709755c7 Add endpoint to retrieve machines by processor. 2025-11-16 16:09:02 +00:00
959a48b36c Fixed navigation for GPU details. 2025-11-16 16:07:48 +00:00
4b02dd6d2c Refactor GPU detail page header to use NavigationBar for improved navigation 2025-11-16 15:32:05 +00:00
f308668f69 Add GPU details page. 2025-11-16 04:56:26 +00:00
e5f1d766b5 Fix endpoint that gets resolutions by GPUs. 2025-11-16 04:56:16 +00:00
cc2738e45d Add endpoint to get gpus by machine. 2025-11-16 04:55:45 +00:00
981cd3c27c Add list of GPUs. 2025-11-16 02:35:59 +00:00
5c64e59f8f Fix showing enumerations in photo details page. 2025-11-16 02:13:48 +00:00
01c24ae987 Do not redirect to HTTPS in development. 2025-11-16 02:13:22 +00:00
a60fb39687 Hardcode CORS. 2025-11-16 02:13:07 +00:00
497251be86 Change DTOs to use underlying nullable numerical values instead of nullable enumerations as they're not supported by Kiota. 2025-11-16 02:12:29 +00:00
195b23f755 Add photo detail page. 2025-11-15 22:45:55 +00:00
edc8d33bb2 Fix wrong cache folder. 2025-11-15 22:45:36 +00:00
dbef655a3d No need to use untypenode extraction anymore. 2025-11-15 22:44:02 +00:00
4f59f6870d Update Kiota client. 2025-11-15 22:41:01 +00:00
c3e75175f9 Make OpenApi not generate all numeric fields with "string" as acceptable format.
This stupidity just made Kiota generate unusable DTOs.
2025-11-15 22:40:01 +00:00
1dcb062c35 Show machine photo thumbnails in machine details. 2025-11-15 20:07:52 +00:00
6a52c1f067 Add machine photo cache. 2025-11-15 18:55:17 +00:00
c35fdbb0e4 Do not constrain company logo horizontally. 2025-11-15 18:45:36 +00:00
0368e12974 Show company logo in companies list. 2025-11-15 18:42:11 +00:00
fe2c3a082d Add carousel of logos on company detail. 2025-11-15 18:09:54 +00:00
194 changed files with 7428 additions and 4776 deletions

View File

@@ -34,4 +34,14 @@
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.11"/>
<PackageVersion Include="Microsoft.AspNetCore.Components.Authorization" Version="9.0.11"/>
</ItemGroup>
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">
<PackageVersion Include="CommunityToolkit.WinUI.UI.Controls" Version="7.1.2" />
<!-- Add more community toolkit references here -->
</ItemGroup>
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) != 'windows'">
<PackageVersion Include="Uno.CommunityToolkit.WinUI.UI.Controls" Version="7.1.200" />
<!-- Add more uno community toolkit references here -->
</ItemGroup>
</Project>

View File

@@ -14,9 +14,16 @@ using Uno.UI;
using CompanyDetailViewModel = Marechai.App.Presentation.ViewModels.CompanyDetailViewModel;
using ComputersListViewModel = Marechai.App.Presentation.ViewModels.ComputersListViewModel;
using ComputersViewModel = Marechai.App.Presentation.ViewModels.ComputersViewModel;
using GpuDetailViewModel = Marechai.App.Presentation.ViewModels.GpuDetailViewModel;
using GpuListViewModel = Marechai.App.Presentation.ViewModels.GpusListViewModel;
using MachineViewViewModel = Marechai.App.Presentation.ViewModels.MachineViewViewModel;
using MainViewModel = Marechai.App.Presentation.ViewModels.MainViewModel;
using NewsViewModel = Marechai.App.Presentation.ViewModels.NewsViewModel;
using PhotoDetailViewModel = Marechai.App.Presentation.ViewModels.PhotoDetailViewModel;
using ProcessorDetailViewModel = Marechai.App.Presentation.ViewModels.ProcessorDetailViewModel;
using ProcessorsListViewModel = Marechai.App.Presentation.ViewModels.ProcessorsListViewModel;
using SoundSynthDetailViewModel = Marechai.App.Presentation.ViewModels.SoundSynthDetailViewModel;
using SoundSynthsListViewModel = Marechai.App.Presentation.ViewModels.SoundSynthsListViewModel;
namespace Marechai.App;
@@ -32,7 +39,7 @@ public partial class App : Application
}
protected Window? MainWindow { get; private set; }
protected IHost? Host { get; private set; }
public IHost? Host { get; private set; }
protected override async void OnLaunched(LaunchActivatedEventArgs args)
{
@@ -109,6 +116,7 @@ public partial class App : Application
// Register application services
services.AddSingleton<FlagCache>();
services.AddSingleton<CompanyLogoCache>();
services.AddSingleton<MachinePhotoCache>();
services.AddSingleton<NewsService>();
services.AddSingleton<NewsViewModel>();
services.AddSingleton<ComputersService>();
@@ -120,6 +128,10 @@ public partial class App : Application
services.AddSingleton<CompanyDetailService>();
services.AddSingleton<CompanyDetailViewModel>();
services.AddSingleton<MachineViewViewModel>();
services.AddSingleton<GpusService>();
services.AddSingleton<ProcessorsService>();
services.AddSingleton<SoundSynthsService>();
services.AddTransient<PhotoDetailViewModel>();
services
.AddSingleton<IComputersListFilterContext,
@@ -131,6 +143,12 @@ public partial class App : Application
services.AddTransient<ComputersListViewModel>();
services.AddTransient<ConsolesListViewModel>();
services.AddTransient<GpuListViewModel>();
services.AddTransient<GpuDetailViewModel>();
services.AddTransient<ProcessorsListViewModel>();
services.AddTransient<ProcessorDetailViewModel>();
services.AddTransient<SoundSynthsListViewModel>();
services.AddTransient<SoundSynthDetailViewModel>();
})
.UseNavigation(RegisterRoutes));
@@ -156,6 +174,13 @@ public partial class App : Application
new ViewMap<CompaniesPage, CompaniesViewModel>(),
new ViewMap<CompanyDetailPage, CompanyDetailViewModel>(),
new ViewMap<MachineViewPage, MachineViewViewModel>(),
new ViewMap<PhotoDetailPage, PhotoDetailViewModel>(),
new ViewMap<GpuListPage, GpuListViewModel>(),
new ViewMap<GpuDetailPage, GpuDetailViewModel>(),
new ViewMap<ProcessorListPage, ProcessorsListViewModel>(),
new ViewMap<ProcessorDetailPage, ProcessorDetailViewModel>(),
new ViewMap<SoundSynthListPage, SoundSynthsListViewModel>(),
new ViewMap<SoundSynthDetailPage, SoundSynthDetailViewModel>(),
new DataViewMap<SecondPage, SecondViewModel, Entity>());
routes.Register(new RouteMap("",
@@ -193,10 +218,37 @@ public partial class App : Application
views.FindByViewModel<CompaniesViewModel>(),
Nested:
[
new RouteMap("detail",
new RouteMap("company-details",
views.FindByViewModel<
CompanyDetailViewModel>())
]),
new RouteMap("gpus",
views.FindByViewModel<GpuListViewModel>(),
Nested:
[
new RouteMap("gpu-details",
views.FindByViewModel<
GpuDetailViewModel>())
]),
new RouteMap("processors",
views.FindByViewModel<ProcessorsListViewModel>(),
Nested:
[
new RouteMap("processor-details",
views.FindByViewModel<
ProcessorDetailViewModel>())
]),
new RouteMap("sound-synths",
views.FindByViewModel<SoundSynthsListViewModel>(),
Nested:
[
new RouteMap("sound-synth-details",
views.FindByViewModel<
SoundSynthDetailViewModel>()),
new RouteMap("machine-view",
views.FindByViewModel<
MachineViewViewModel>())
]),
new RouteMap("Second",
views.FindByViewModel<SecondViewModel>())
])

View File

@@ -1,61 +0,0 @@
using Microsoft.Kiota.Abstractions.Serialization;
namespace Marechai.App.Helpers;
/// <summary>
/// Helper class for extracting values from Kiota UntypedNode objects.
/// </summary>
public static class UntypedNodeExtractor
{
/// <summary>
/// Extracts an integer value from an UntypedNode.
/// </summary>
/// <param name="node">The UntypedNode to extract from. Can be null.</param>
/// <returns>The extracted integer value, or 0 if extraction fails.</returns>
public static int ExtractInt(UntypedNode? node)
{
if(node == null) return 0;
try
{
// Cast to UntypedInteger to access the Value property
if(node is UntypedInteger intNode) return intNode.GetValue();
// Fallback: try to parse ToString() result
var stringValue = node.ToString();
if(!string.IsNullOrWhiteSpace(stringValue) && int.TryParse(stringValue, out int result)) return result;
return 0;
}
catch
{
return 0;
}
}
/// <summary>
/// Extracts a long value from an UntypedNode.
/// </summary>
/// <param name="node">The UntypedNode to extract from. Can be null.</param>
/// <returns>The extracted long value, or 0 if extraction fails.</returns>
public static long ExtractLong(UntypedNode? node)
{
if(node == null) return 0;
try
{
if(node is UntypedInteger intNode) return intNode.GetValue();
var stringValue = node.ToString();
if(!string.IsNullOrWhiteSpace(stringValue) && long.TryParse(stringValue, out long result)) return result;
return 0;
}
catch
{
return 0;
}
}
}

View File

@@ -40,10 +40,10 @@
</UnoFeatures>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Marechai.Data\Marechai.Data.csproj"/>
<ProjectReference Include="..\Marechai.Data\Marechai.Data.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Humanizer"/>
<PackageReference Include="Humanizer" />
</ItemGroup>
<ItemGroup>
<Compile Update="Presentation\Views\Shell.xaml.cs">
@@ -80,4 +80,14 @@
</Compile>
</ItemGroup>
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">
<PackageReference Include="CommunityToolkit.WinUI.UI.Controls" />
<!-- Add more community toolkit references here -->
</ItemGroup>
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) != 'windows'">
<PackageReference Include="Uno.CommunityToolkit.WinUI.UI.Controls" />
<!-- Add more uno community toolkit references here -->
</ItemGroup>
</Project>

View File

@@ -0,0 +1,35 @@
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2003-2026 Natalia Portillo
*******************************************************************************/
namespace Marechai.App.Presentation.Models;
/// <summary>
/// Navigation parameter for the GpuDetailPage containing both the GPU ID and the navigation source.
/// </summary>
public class GpuDetailNavigationParameter
{
public required int GpuId { get; init; }
public object? NavigationSource { get; init; }
}

View File

@@ -0,0 +1,35 @@
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2003-2026 Natalia Portillo
*******************************************************************************/
namespace Marechai.App.Presentation.Models;
/// <summary>
/// Navigation parameter for the ProcessorDetailPage containing both the processor ID and the navigation source.
/// </summary>
public class ProcessorDetailNavigationParameter
{
public required int ProcessorId { get; init; }
public object? NavigationSource { get; init; }
}

View File

@@ -3,12 +3,14 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Input;
using Marechai.App.Helpers;
using Marechai.App.Presentation.Models;
using Marechai.App.Services;
using Marechai.App.Services.Caching;
using Microsoft.UI.Xaml.Media.Imaging;
using Uno.Extensions.Navigation;
namespace Marechai.App.Presentation.ViewModels;
@@ -19,6 +21,7 @@ public partial class CompaniesViewModel : ObservableObject
private readonly CompaniesService _companiesService;
private readonly IStringLocalizer _localizer;
private readonly ILogger<CompaniesViewModel> _logger;
private readonly CompanyLogoCache _logoCache;
private readonly INavigator _navigator;
[ObservableProperty]
@@ -45,10 +48,11 @@ public partial class CompaniesViewModel : ObservableObject
[ObservableProperty]
private string _searchQuery = string.Empty;
public CompaniesViewModel(CompaniesService companiesService, IStringLocalizer localizer,
ILogger<CompaniesViewModel> logger, INavigator navigator)
public CompaniesViewModel(CompaniesService companiesService, CompanyLogoCache logoCache, IStringLocalizer localizer,
ILogger<CompaniesViewModel> logger, INavigator navigator)
{
_companiesService = companiesService;
_logoCache = logoCache;
_localizer = localizer;
_logger = logger;
_navigator = navigator;
@@ -92,17 +96,37 @@ public partial class CompaniesViewModel : ObservableObject
// Build the full list in memory
foreach(CompanyDto company in companies)
{
// Extract id from UntypedNode
int companyId = UntypedNodeExtractor.ExtractInt(company.Id);
// Extract id from company
int companyId = company.Id ?? 0;
// Convert DateTimeOffset? to DateTime?
DateTime? foundedDate = company.Founded?.DateTime;
// Load logo if available
SvgImageSource? logoSource = null;
if(company.LastLogo.HasValue)
{
try
{
Stream? logoStream = await _logoCache.GetLogoAsync(company.LastLogo.Value);
logoSource = new SvgImageSource();
await logoSource.SetSourceAsync(logoStream.AsRandomAccessStream());
}
catch(Exception ex)
{
_logger.LogWarning("Failed to load logo for company {CompanyId}: {Exception}",
companyId,
ex.Message);
}
}
_allCompanies.Add(new CompanyListItem
{
Id = companyId,
Name = company.Name ?? string.Empty,
FoundationDate = foundedDate
Id = companyId,
Name = company.Name ?? string.Empty,
FoundationDate = foundedDate,
LogoImageSource = logoSource
});
}
@@ -186,9 +210,10 @@ public partial class CompaniesViewModel : ObservableObject
/// </summary>
public class CompanyListItem
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public DateTime? FoundationDate { get; set; }
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public DateTime? FoundationDate { get; set; }
public SvgImageSource? LogoImageSource { get; set; }
public string FoundationDateDisplay =>
FoundationDate.HasValue ? FoundationDate.Value.ToString("MMMM d, yyyy") : string.Empty;

View File

@@ -7,7 +7,6 @@ using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Input;
using Marechai.App.Helpers;
using Marechai.App.Presentation.Models;
using Marechai.App.Services;
using Marechai.App.Services.Caching;
@@ -32,6 +31,9 @@ public partial class CompanyDetailViewModel : ObservableObject
[ObservableProperty]
private int _companyId;
[ObservableProperty]
private ObservableCollection<CompanyLogoItem> _companyLogos = [];
[ObservableProperty]
private ObservableCollection<CompanyDetailMachine> _computers = [];
@@ -106,6 +108,11 @@ public partial class CompanyDetailViewModel : ObservableObject
/// </summary>
public bool HasLogoContent => LogoImageSource != null;
/// <summary>
/// Gets whether company has multiple logos
/// </summary>
public bool HasMultipleLogos => CompanyLogos.Count > 1;
public IAsyncRelayCommand LoadData { get; }
public ICommand GoBackCommand { get; }
public IAsyncRelayCommand<CompanyDetailMachine> NavigateToMachineCommand { get; }
@@ -130,6 +137,13 @@ public partial class CompanyDetailViewModel : ObservableObject
OnPropertyChanged(nameof(HasLogoContent));
}
partial void OnCompanyLogosChanged(ObservableCollection<CompanyLogoItem>? oldValue,
ObservableCollection<CompanyLogoItem> newValue)
{
// Notify that HasMultipleLogos has changed
OnPropertyChanged(nameof(HasMultipleLogos));
}
partial void OnComputersFilterTextChanged(string value)
{
FilterComputers(value);
@@ -324,6 +338,7 @@ public partial class CompanyDetailViewModel : ObservableObject
IsDataLoaded = false;
FlagImageSource = null;
LogoImageSource = null;
CompanyLogos.Clear();
if(CompanyId <= 0)
{
@@ -349,7 +364,7 @@ public partial class CompanyDetailViewModel : ObservableObject
{
try
{
var countryCode = (short)UntypedNodeExtractor.ExtractInt(Company.CountryId);
var countryCode = (short)(Company.CountryId ?? 0);
Stream? flagStream = await _flagCache.GetFlagAsync(countryCode);
var flagSource = new SvgImageSource();
@@ -370,7 +385,7 @@ public partial class CompanyDetailViewModel : ObservableObject
if(Company.SoldToId != null)
{
int soldToId = UntypedNodeExtractor.ExtractInt(Company.SoldToId);
int soldToId = Company.SoldToId ?? 0;
if(soldToId > 0) SoldToCompany = await _companyDetailService.GetSoldToCompanyAsync(soldToId);
}
@@ -379,7 +394,7 @@ public partial class CompanyDetailViewModel : ObservableObject
{
try
{
Stream? logoStream = await _logoCache.GetFlagAsync(Company.LastLogo.Value);
Stream? logoStream = await _logoCache.GetLogoAsync(Company.LastLogo.Value);
var logoSource = new SvgImageSource();
await logoSource.SetSourceAsync(logoStream.AsRandomAccessStream());
@@ -395,6 +410,56 @@ public partial class CompanyDetailViewModel : ObservableObject
}
}
// Load all logos for carousel
try
{
// Get all logos for this company
List<CompanyLogoDto> logosList = await _companyDetailService.GetCompanyLogosAsync(CompanyId);
// Convert to list with extracted years for sorting
var logosWithYears = logosList.Select(logo => new
{
Logo = logo,
logo.Year
})
.OrderBy(l => l.Year)
.ToList();
var loadedLogos = new ObservableCollection<CompanyLogoItem>();
foreach(var logoData in logosWithYears)
{
try
{
if(logoData.Logo.Guid == null) continue;
Stream? logoStream = await _logoCache.GetLogoAsync(logoData.Logo.Guid.Value);
var logoSource = new SvgImageSource();
await logoSource.SetSourceAsync(logoStream.AsRandomAccessStream());
loadedLogos.Add(new CompanyLogoItem
{
LogoGuid = logoData.Logo.Guid.Value,
LogoSource = logoSource,
Year = logoData.Year
});
}
catch(Exception ex)
{
_logger.LogError("Failed to load carousel logo: {Exception}", ex.Message);
}
}
// Assign the new collection (this will trigger OnCompanyLogosChanged)
CompanyLogos = loadedLogos;
_logger.LogInformation("Loaded {Count} logos for company {CompanyId}", CompanyLogos.Count, CompanyId);
}
catch(Exception ex)
{
_logger.LogError("Failed to load company logos for carousel: {Exception}", ex.Message);
}
// Load computers and consoles made by this company
List<MachineDto> machines = await _companyDetailService.GetComputersByCompanyAsync(CompanyId);
Computers.Clear();
@@ -404,7 +469,7 @@ public partial class CompanyDetailViewModel : ObservableObject
foreach(MachineDto machine in machines)
{
int machineId = UntypedNodeExtractor.ExtractInt(machine.Id);
int machineId = machine.Id ?? 0;
var machineItem = new CompanyDetailMachine
{
@@ -452,4 +517,14 @@ public class CompanyDetailMachine
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
}
/// <summary>
/// Data model for a company logo in the carousel
/// </summary>
public class CompanyLogoItem
{
public Guid LogoGuid { get; set; }
public SvgImageSource? LogoSource { get; set; }
public int? Year { get; set; }
}

View File

@@ -6,7 +6,6 @@ using System.Collections.ObjectModel;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Input;
using Marechai.App.Helpers;
using Marechai.App.Presentation.Models;
using Marechai.App.Services;
using Uno.Extensions.Navigation;
@@ -186,7 +185,7 @@ public partial class ComputersListViewModel : ObservableObject
foreach(MachineDto computer in computers.OrderBy(c => c.Name))
{
int year = computer.Introduced?.Year ?? 0;
int id = UntypedNodeExtractor.ExtractInt(computer.Id);
int id = computer.Id ?? 0;
_logger.LogInformation("Computer: {Name}, Introduced: {Introduced}, Year: {Year}, Company: {Company}, ID: {Id}",
computer.Name,

View File

@@ -6,7 +6,6 @@ using System.Collections.ObjectModel;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Input;
using Marechai.App.Helpers;
using Marechai.App.Presentation.Models;
using Marechai.App.Services;
using Uno.Extensions.Navigation;
@@ -184,7 +183,7 @@ public partial class ConsolesListViewModel : ObservableObject
foreach(MachineDto console in consoles.OrderBy(c => c.Name))
{
int year = console.Introduced?.Year ?? 0;
int id = UntypedNodeExtractor.ExtractInt(console.Id);
int id = console.Id ?? 0;
_logger.LogInformation("Console: {Name}, Introduced: {Introduced}, Year: {Year}, Company: {Company}, ID: {Id}",
console.Name,

View File

@@ -0,0 +1,387 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Input;
using Marechai.App.Presentation.Models;
using Marechai.App.Services;
using Uno.Extensions.Navigation;
namespace Marechai.App.Presentation.ViewModels;
public partial class GpuDetailViewModel : ObservableObject
{
private readonly CompaniesService _companiesService;
private readonly GpusService _gpusService;
private readonly IStringLocalizer _localizer;
private readonly ILogger<GpuDetailViewModel> _logger;
private readonly INavigator _navigator;
[ObservableProperty]
private ObservableCollection<MachineItem> _computers = [];
[ObservableProperty]
private string _computersFilterText = string.Empty;
[ObservableProperty]
private string _consoelsFilterText = string.Empty;
[ObservableProperty]
private ObservableCollection<MachineItem> _consoles = [];
[ObservableProperty]
private string _errorMessage = string.Empty;
[ObservableProperty]
private ObservableCollection<MachineItem> _filteredComputers = [];
[ObservableProperty]
private ObservableCollection<MachineItem> _filteredConsoles = [];
[ObservableProperty]
private GpuDto? _gpu;
[ObservableProperty]
private int _gpuId;
[ObservableProperty]
private bool _hasComputers;
[ObservableProperty]
private bool _hasConsoles;
[ObservableProperty]
private bool _hasError;
[ObservableProperty]
private bool _isDataLoaded;
[ObservableProperty]
private bool _isLoading;
[ObservableProperty]
private string _manufacturerName = string.Empty;
private object? _navigationSource;
[ObservableProperty]
private ObservableCollection<ResolutionItem> _resolutions = [];
public GpuDetailViewModel(GpusService gpusService, CompaniesService companiesService, IStringLocalizer localizer,
ILogger<GpuDetailViewModel> logger, INavigator navigator)
{
_gpusService = gpusService;
_companiesService = companiesService;
_localizer = localizer;
_logger = logger;
_navigator = navigator;
LoadData = new AsyncRelayCommand(LoadDataAsync);
GoBackCommand = new AsyncRelayCommand(GoBackAsync);
SelectMachineCommand = new AsyncRelayCommand<int>(SelectMachineAsync);
ComputersFilterCommand = new RelayCommand(() => FilterComputers());
ConsolesFilterCommand = new RelayCommand(() => FilterConsoles());
}
public IAsyncRelayCommand LoadData { get; }
public ICommand GoBackCommand { get; }
public IAsyncRelayCommand SelectMachineCommand { get; }
public ICommand ComputersFilterCommand { get; }
public ICommand ConsolesFilterCommand { get; }
public string Title { get; } = "GPU Details";
/// <summary>
/// Loads GPU details including resolutions, computers, and consoles
/// </summary>
private async Task LoadDataAsync()
{
try
{
IsLoading = true;
ErrorMessage = string.Empty;
HasError = false;
IsDataLoaded = false;
Resolutions.Clear();
Computers.Clear();
Consoles.Clear();
if(GpuId <= 0)
{
ErrorMessage = _localizer["Invalid GPU ID"].Value;
HasError = true;
return;
}
_logger.LogInformation("Loading GPU details for ID: {GpuId}", GpuId);
// Load GPU details
Gpu = await _gpusService.GetGpuByIdAsync(GpuId);
if(Gpu is null)
{
ErrorMessage = _localizer["Graphics processing unit not found"].Value;
HasError = true;
return;
}
// Set manufacturer name (from Company field or fetch by CompanyId if empty)
ManufacturerName = Gpu.Company ?? string.Empty;
if(string.IsNullOrEmpty(ManufacturerName) && Gpu.CompanyId.HasValue)
{
try
{
CompanyDto? company = await _companiesService.GetCompanyByIdAsync(Gpu.CompanyId.Value);
if(company != null) ManufacturerName = company.Name ?? string.Empty;
}
catch(Exception ex)
{
_logger.LogWarning(ex, "Failed to load company for GPU {GpuId}", GpuId);
}
}
// Format display name
string displayName = Gpu.Name ?? string.Empty;
if(displayName == "DB_FRAMEBUFFER")
displayName = "Framebuffer";
else if(displayName == "DB_SOFTWARE")
displayName = "Software";
else if(displayName == "DB_NONE") displayName = "None";
_logger.LogInformation("GPU loaded: {Name}, Company: {Company}", displayName, ManufacturerName);
// Load resolutions
try
{
List<ResolutionByGpuDto>? resolutions = await _gpusService.GetResolutionsByGpuAsync(GpuId);
if(resolutions != null && resolutions.Count > 0)
{
Resolutions.Clear();
foreach(ResolutionByGpuDto res in resolutions)
{
// Get the full resolution DTO using the resolution ID
if(res.ResolutionId.HasValue)
{
ResolutionDto? resolutionDto =
await _gpusService.GetResolutionByIdAsync(res.ResolutionId.Value);
if(resolutionDto != null)
{
Resolutions.Add(new ResolutionItem
{
Id = resolutionDto.Id ?? 0,
Name = $"{resolutionDto.Width}x{resolutionDto.Height}",
Width = resolutionDto.Width ?? 0,
Height = resolutionDto.Height ?? 0,
Colors = resolutionDto.Colors ?? 0,
Palette = resolutionDto.Palette ?? 0,
Chars = resolutionDto.Chars ?? false,
Grayscale = resolutionDto.Grayscale ?? false
});
}
}
}
_logger.LogInformation("Loaded {Count} resolutions for GPU {GpuId}", Resolutions.Count, GpuId);
}
}
catch(Exception ex)
{
_logger.LogWarning(ex, "Failed to load resolutions for GPU {GpuId}", GpuId);
}
// Load machines and separate into computers and consoles
try
{
List<MachineDto>? machines = await _gpusService.GetMachinesByGpuAsync(GpuId);
if(machines != null && machines.Count > 0)
{
Computers.Clear();
Consoles.Clear();
foreach(MachineDto machine in machines)
{
var machineItem = new MachineItem
{
Id = machine.Id ?? 0,
Name = machine.Name ?? string.Empty,
Manufacturer = machine.Company ?? string.Empty,
Year = machine.Introduced?.Year ?? 0
};
// Distinguish between computers and consoles based on Type
if(machine.Type == 2) // MachineType.Console
Consoles.Add(machineItem);
else // MachineType.Computer or Unknown
Computers.Add(machineItem);
}
HasComputers = Computers.Count > 0;
HasConsoles = Consoles.Count > 0;
// Initialize filtered collections
FilterComputers();
FilterConsoles();
_logger.LogInformation("Loaded {ComputerCount} computers and {ConsoleCount} consoles for GPU {GpuId}",
Computers.Count,
Consoles.Count,
GpuId);
}
else
{
HasComputers = false;
HasConsoles = false;
}
}
catch(Exception ex)
{
_logger.LogWarning(ex, "Failed to load machines for GPU {GpuId}", GpuId);
HasComputers = false;
HasConsoles = false;
}
IsDataLoaded = true;
}
catch(Exception ex)
{
_logger.LogError(ex, "Error loading GPU details: {Exception}", ex.Message);
ErrorMessage = _localizer["Failed to load graphics processing unit details. Please try again later."].Value;
HasError = true;
}
finally
{
IsLoading = false;
}
}
/// <summary>
/// Filters computers based on search text
/// </summary>
private void FilterComputers()
{
if(string.IsNullOrWhiteSpace(ComputersFilterText))
{
FilteredComputers.Clear();
foreach(MachineItem computer in Computers) FilteredComputers.Add(computer);
}
else
{
var filtered = Computers
.Where(c => c.Name.Contains(ComputersFilterText, StringComparison.OrdinalIgnoreCase))
.ToList();
FilteredComputers.Clear();
foreach(MachineItem computer in filtered) FilteredComputers.Add(computer);
}
}
/// <summary>
/// Filters consoles based on search text
/// </summary>
private void FilterConsoles()
{
if(string.IsNullOrWhiteSpace(ConsoelsFilterText))
{
FilteredConsoles.Clear();
foreach(MachineItem console in Consoles) FilteredConsoles.Add(console);
}
else
{
var filtered = Consoles.Where(c => c.Name.Contains(ConsoelsFilterText, StringComparison.OrdinalIgnoreCase))
.ToList();
FilteredConsoles.Clear();
foreach(MachineItem console in filtered) FilteredConsoles.Add(console);
}
}
/// <summary>
/// Navigates back to the GPU list
/// </summary>
private async Task GoBackAsync()
{
// If we came from a machine view, go back to machine view
if(_navigationSource is MachineViewViewModel machineVm)
{
await _navigator.NavigateViewModelAsync<MachineViewViewModel>(this);
return;
}
// Default: go back to GPU list
await _navigator.NavigateViewModelAsync<GpusListViewModel>(this);
}
/// <summary>
/// Navigates to machine detail view
/// </summary>
private async Task SelectMachineAsync(int machineId)
{
if(machineId <= 0) return;
var navParam = new MachineViewNavigationParameter
{
MachineId = machineId,
NavigationSource = this
};
await _navigator.NavigateViewModelAsync<MachineViewViewModel>(this, data: navParam);
}
/// <summary>
/// Sets the navigation source (where we came from).
/// </summary>
public void SetNavigationSource(object? source)
{
_navigationSource = source;
}
}
/// <summary>
/// Resolution item for displaying GPU supported resolutions
/// </summary>
public class ResolutionItem
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public int Width { get; set; }
public int Height { get; set; }
public long Colors { get; set; }
public long Palette { get; set; }
public bool Chars { get; set; }
public bool Grayscale { get; set; }
public string Resolution => $"{Width}x{Height}";
public string ResolutionType => Chars ? "Text" : "Pixel";
public string ResolutionDisplay => Chars ? $"{Width}x{Height} characters" : $"{Width}x{Height}";
public string ColorDisplay => Grayscale
? $"{Colors} grays"
: Palette > 0
? $"{Colors} colors from a palette of {Palette} colors"
: $"{Colors} colors";
}
/// <summary>
/// Machine item for displaying computers or consoles that use the GPU
/// </summary>
public class MachineItem
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Manufacturer { get; set; } = string.Empty;
public int Year { get; set; }
public string YearDisplay => Year > 0 ? Year.ToString() : "Unknown";
}

View File

@@ -0,0 +1,211 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Threading.Tasks;
using Marechai.App.Presentation.Models;
using Marechai.App.Services;
using Uno.Extensions.Navigation;
namespace Marechai.App.Presentation.ViewModels;
/// <summary>
/// ViewModel for displaying a list of GPUs
/// </summary>
public partial class GpusListViewModel : ObservableObject
{
private readonly GpusService _gpusService;
private readonly IStringLocalizer _localizer;
private readonly ILogger<GpusListViewModel> _logger;
private readonly INavigator _navigator;
[ObservableProperty]
private string _errorMessage = string.Empty;
[ObservableProperty]
private ObservableCollection<GpuListItem> _gpusList = [];
[ObservableProperty]
private bool _hasError;
[ObservableProperty]
private bool _isDataLoaded;
[ObservableProperty]
private bool _isLoading;
[ObservableProperty]
private string _pageTitle = string.Empty;
public GpusListViewModel(GpusService gpusService, IStringLocalizer localizer, ILogger<GpusListViewModel> logger,
INavigator navigator)
{
_gpusService = gpusService;
_localizer = localizer;
_logger = logger;
_navigator = navigator;
LoadData = new AsyncRelayCommand(LoadDataAsync);
NavigateToGpuCommand = new AsyncRelayCommand<GpuListItem>(NavigateToGpuAsync);
}
public IAsyncRelayCommand LoadData { get; }
public IAsyncRelayCommand<GpuListItem> NavigateToGpuCommand { get; }
/// <summary>
/// Loads all GPUs and sorts them with special handling for Framebuffer and Software
/// </summary>
private async Task LoadDataAsync()
{
try
{
IsLoading = true;
ErrorMessage = string.Empty;
HasError = false;
IsDataLoaded = false;
GpusList.Clear();
_logger.LogInformation("LoadDataAsync called for GPUs");
PageTitle = _localizer["GraphicalProcessingUnits"];
// Load GPUs from the API
await LoadGpusFromApiAsync();
_logger.LogInformation("LoadGpusFromApiAsync completed. GpusList.Count={Count}", GpusList.Count);
if(GpusList.Count == 0)
{
ErrorMessage = _localizer["No graphics processing units found"].Value;
HasError = true;
_logger.LogWarning("No GPUs found");
}
else
IsDataLoaded = true;
}
catch(Exception ex)
{
_logger.LogError(ex, "Error loading GPUs: {Exception}", ex.Message);
ErrorMessage = _localizer["Failed to load graphics processing units. Please try again later."].Value;
HasError = true;
}
finally
{
IsLoading = false;
}
}
/// <summary>
/// Loads GPUs from the API and sorts them with special handling for Framebuffer and Software
/// </summary>
private async Task LoadGpusFromApiAsync()
{
try
{
List<GpuDto> gpus = await _gpusService.GetAllGpusAsync();
if(gpus == null || gpus.Count == 0)
{
_logger.LogInformation("No GPUs returned from API");
return;
}
// Separate special GPUs from regular ones
var specialGpus = new List<GpuListItem>();
var regularGpus = new List<GpuListItem>();
foreach(GpuDto gpu in gpus)
{
string displayName = gpu.Name ?? string.Empty;
// Replace special database names
if(displayName == "DB_FRAMEBUFFER")
displayName = "Framebuffer";
else if(displayName == "DB_SOFTWARE")
displayName = "Software";
else if(displayName == "DB_NONE") displayName = "None";
var gpuItem = new GpuListItem
{
Id = gpu.Id ?? 0,
Name = displayName,
Company = gpu.Company ?? string.Empty,
IsSpecial = gpu.Name is "DB_FRAMEBUFFER" or "DB_SOFTWARE" or "DB_NONE"
};
if(gpuItem.IsSpecial)
specialGpus.Add(gpuItem);
else
regularGpus.Add(gpuItem);
_logger.LogInformation("GPU: {Name}, Company: {Company}, ID: {Id}, IsSpecial: {IsSpecial}",
displayName,
gpu.Company,
gpu.Id,
gpuItem.IsSpecial);
}
// Sort special GPUs: Framebuffer first, then Software, then None
specialGpus.Sort((a, b) =>
{
int orderA = a.Name == "Framebuffer"
? 0
: a.Name == "Software"
? 1
: 2;
int orderB = b.Name == "Framebuffer"
? 0
: b.Name == "Software"
? 1
: 2;
return orderA.CompareTo(orderB);
});
// Sort regular GPUs alphabetically
regularGpus.Sort((a, b) => string.Compare(a.Name, b.Name, StringComparison.OrdinalIgnoreCase));
// Add special GPUs first, then regular GPUs
foreach(GpuListItem gpu in specialGpus) GpusList.Add(gpu);
foreach(GpuListItem gpu in regularGpus) GpusList.Add(gpu);
}
catch(Exception ex)
{
_logger.LogError(ex, "Error loading GPUs from API");
}
}
/// <summary>
/// Navigates to the GPU detail view
/// </summary>
private async Task NavigateToGpuAsync(GpuListItem? gpu)
{
if(gpu is null) return;
_logger.LogInformation("Navigating to GPU detail: {GpuName} (ID: {GpuId})", gpu.Name, gpu.Id);
// Navigate to GPU detail view with navigation parameter
var navParam = new GpuDetailNavigationParameter
{
GpuId = gpu.Id,
NavigationSource = this
};
await _navigator.NavigateViewModelAsync<GpuDetailViewModel>(this, data: navParam);
}
}
/// <summary>
/// Data model for a GPU in the list
/// </summary>
public class GpuListItem
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Company { get; set; } = string.Empty;
public bool IsSpecial { get; set; }
}

View File

@@ -28,13 +28,17 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Threading.Tasks;
using Windows.Storage.Streams;
using Humanizer;
using Marechai.App.Helpers;
using Marechai.App.Presentation.Models;
using Marechai.App.Services;
using Marechai.App.Services.Caching;
using Marechai.Data;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Media.Imaging;
using Uno.Extensions.Navigation;
namespace Marechai.App.Presentation.ViewModels;
@@ -44,6 +48,7 @@ public partial class MachineViewViewModel : ObservableObject
private readonly ComputersService _computersService;
private readonly ILogger<MachineViewViewModel> _logger;
private readonly INavigator _navigator;
private readonly MachinePhotoCache _photoCache;
[ObservableProperty]
private string _companyName = string.Empty;
@@ -94,6 +99,9 @@ public partial class MachineViewViewModel : ObservableObject
[ObservableProperty]
private Visibility _showModel = Visibility.Collapsed;
[ObservableProperty]
private Visibility _showPhotos = Visibility.Collapsed;
[ObservableProperty]
private Visibility _showProcessors = Visibility.Collapsed;
@@ -103,12 +111,13 @@ public partial class MachineViewViewModel : ObservableObject
[ObservableProperty]
private Visibility _showStorage = Visibility.Collapsed;
public MachineViewViewModel(ILogger<MachineViewViewModel> logger, INavigator navigator,
ComputersService computersService)
public MachineViewViewModel(ILogger<MachineViewViewModel> logger, INavigator navigator,
ComputersService computersService, MachinePhotoCache photoCache)
{
_logger = logger;
_navigator = navigator;
_computersService = computersService;
_photoCache = photoCache;
}
public ObservableCollection<ProcessorDisplayItem> Processors { get; } = [];
@@ -116,6 +125,7 @@ public partial class MachineViewViewModel : ObservableObject
public ObservableCollection<GpuDisplayItem> Gpus { get; } = [];
public ObservableCollection<SoundSynthesizerDisplayItem> SoundSynthesizers { get; } = [];
public ObservableCollection<StorageDisplayItem> Storage { get; } = [];
public ObservableCollection<PhotoCarouselDisplayItem> Photos { get; } = [];
[RelayCommand]
public async Task GoBack()
@@ -157,10 +167,64 @@ public partial class MachineViewViewModel : ObservableObject
return;
}
// If we came from GpuDetailViewModel, navigate back to GPU details
if(_navigationSource is GpuDetailViewModel gpuDetailVm)
{
var navParam = new GpuDetailNavigationParameter
{
GpuId = gpuDetailVm.GpuId,
NavigationSource = this
};
await _navigator.NavigateViewModelAsync<GpuDetailViewModel>(this, data: navParam);
return;
}
// If we came from ProcessorDetailViewModel, navigate back to processor details
if(_navigationSource is ProcessorDetailViewModel processorDetailVm)
{
var navParam = new ProcessorDetailNavigationParameter
{
ProcessorId = processorDetailVm.ProcessorId,
NavigationSource = this
};
await _navigator.NavigateViewModelAsync<ProcessorDetailViewModel>(this, data: navParam);
return;
}
// If we came from SoundSynthDetailViewModel, navigate back to sound synth details
if(_navigationSource is SoundSynthDetailViewModel soundSynthDetailVm)
{
var navParam = new SoundSynthDetailNavigationParameter
{
SoundSynthId = soundSynthDetailVm.SoundSynthId,
NavigationSource = this
};
await _navigator.NavigateViewModelAsync<SoundSynthDetailViewModel>(this, data: navParam);
return;
}
// Otherwise, try to go back in the navigation stack
await _navigator.GoBack(this);
}
[RelayCommand]
public async Task ViewPhotoDetails(Guid photoId)
{
var navParam = new PhotoDetailNavigationParameter
{
PhotoId = photoId
};
_logger.LogInformation("Navigating to photo details for {PhotoId}", photoId);
await _navigator.NavigateViewModelAsync<PhotoDetailViewModel>(this, data: navParam);
}
/// <summary>
/// Sets the navigation source (where we came from).
/// </summary>
@@ -192,6 +256,7 @@ public partial class MachineViewViewModel : ObservableObject
Gpus.Clear();
SoundSynthesizers.Clear();
Storage.Clear();
Photos.Clear();
_logger.LogInformation("Loading machine {MachineId}", machineId);
@@ -226,9 +291,9 @@ public partial class MachineViewViewModel : ObservableObject
foreach(ProcessorDto processor in machine.Processors)
{
var details = new List<string>();
int speed = UntypedNodeExtractor.ExtractInt(processor.Speed);
int gprSize = UntypedNodeExtractor.ExtractInt(processor.GprSize);
int cores = UntypedNodeExtractor.ExtractInt(processor.Cores);
var speed = (int)(processor.Speed ?? 0);
int gprSize = processor.GprSize ?? 0;
int cores = processor.Cores ?? 0;
if(speed > 0) details.Add($"{speed} MHz");
if(gprSize > 0) details.Add($"{gprSize} bits");
@@ -249,7 +314,7 @@ public partial class MachineViewViewModel : ObservableObject
{
foreach(MemoryDto mem in machine.Memory)
{
long size = UntypedNodeExtractor.ExtractLong(mem.Size);
long size = mem.Size ?? 0;
string sizeStr = size > 0
? size > 1024 ? $"{size} bytes ({size.Bytes().Humanize()})" : $"{size} bytes"
@@ -287,7 +352,7 @@ public partial class MachineViewViewModel : ObservableObject
foreach(SoundSynthDto synth in machine.SoundSynthesizers)
{
var details = new List<string>();
int voices = UntypedNodeExtractor.ExtractInt(synth.Voices);
int voices = synth.Voices ?? 0;
if(voices > 0) details.Add($"{voices} voices");
@@ -305,7 +370,7 @@ public partial class MachineViewViewModel : ObservableObject
{
foreach(StorageDto storage in machine.Storage)
{
long capacity = UntypedNodeExtractor.ExtractLong(storage.Capacity);
long capacity = storage.Capacity ?? 0;
string displayText = capacity > 0
? capacity > 1024
@@ -324,6 +389,25 @@ public partial class MachineViewViewModel : ObservableObject
}
}
// Populate photos
List<Guid> photoIds = await _computersService.GetMachinePhotosAsync(machineId);
if(photoIds.Count > 0)
{
foreach(Guid photoId in photoIds)
{
var photoItem = new PhotoCarouselDisplayItem
{
PhotoId = photoId
};
// Load thumbnail image asynchronously
_ = LoadPhotoThumbnailAsync(photoItem);
Photos.Add(photoItem);
}
}
UpdateVisibilities();
IsDataLoaded = true;
IsLoading = false;
@@ -354,6 +438,28 @@ public partial class MachineViewViewModel : ObservableObject
ShowGpus = Gpus.Count > 0 ? Visibility.Visible : Visibility.Collapsed;
ShowSoundSynthesizers = SoundSynthesizers.Count > 0 ? Visibility.Visible : Visibility.Collapsed;
ShowStorage = Storage.Count > 0 ? Visibility.Visible : Visibility.Collapsed;
ShowPhotos = Photos.Count > 0 ? Visibility.Visible : Visibility.Collapsed;
}
private async Task LoadPhotoThumbnailAsync(PhotoCarouselDisplayItem photoItem)
{
try
{
Stream stream = await _photoCache.GetThumbnailAsync(photoItem.PhotoId);
var bitmap = new BitmapImage();
using(IRandomAccessStream randomStream = stream.AsRandomAccessStream())
{
await bitmap.SetSourceAsync(randomStream);
}
photoItem.ThumbnailImageSource = bitmap;
}
catch(Exception ex)
{
_logger.LogError(ex, "Error loading photo thumbnail {PhotoId}", photoItem.PhotoId);
}
}
}
@@ -404,4 +510,15 @@ public class StorageDisplayItem
{
public string DisplayText { get; set; } = string.Empty;
public string TypeNote { get; set; } = string.Empty;
}
/// <summary>
/// Display item for photo carousel
/// </summary>
public class PhotoCarouselDisplayItem
{
// Thumbnail constraints
public const int ThumbnailMaxSize = 256;
public Guid PhotoId { get; set; }
public ImageSource? ThumbnailImageSource { get; set; }
}

View File

@@ -52,7 +52,7 @@ public partial class MainViewModel : ObservableObject
NavigateToPeopleCommand = new AsyncRelayCommand(() => NavigateTo("people"));
NavigateToProcessorsCommand = new AsyncRelayCommand(() => NavigateTo("processors"));
NavigateToSoftwareCommand = new AsyncRelayCommand(() => NavigateTo("software"));
NavigateToSoundSynthesizersCommand = new AsyncRelayCommand(() => NavigateTo("soundsynthesizers"));
NavigateToSoundSynthesizersCommand = new AsyncRelayCommand(() => NavigateTo("sound-synths"));
NavigateToSettingsCommand = new AsyncRelayCommand(() => NavigateTo("settings"));
LoginLogoutCommand = new RelayCommand(HandleLoginLogout);
ToggleSidebarCommand = new RelayCommand(() => IsSidebarOpen = !IsSidebarOpen);

View File

@@ -2,7 +2,6 @@ using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Threading.Tasks;
using Marechai.App.Helpers;
using Marechai.App.Presentation.Models;
using Marechai.App.Services;
using Marechai.Data;
@@ -94,7 +93,7 @@ public partial class NewsViewModel : ObservableObject
// Extract the machine ID from AffectedId
if(news.AffectedId is null) return;
int machineId = UntypedNodeExtractor.ExtractInt(news.AffectedId);
int machineId = news.AffectedId ?? 0;
if(machineId <= 0) return;

View File

@@ -0,0 +1,425 @@
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2003-2026 Natalia Portillo
*******************************************************************************/
#nullable enable
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Windows.Storage.Streams;
using Humanizer;
using Marechai.App.Services;
using Marechai.App.Services.Caching;
using Microsoft.UI.Xaml.Media.Imaging;
using Uno.Extensions.Navigation;
using ColorSpace = Marechai.Data.ColorSpace;
using Contrast = Marechai.Data.Contrast;
using ExposureMode = Marechai.Data.ExposureMode;
using ExposureProgram = Marechai.Data.ExposureProgram;
using Flash = Marechai.Data.Flash;
using LightSource = Marechai.Data.LightSource;
using MeteringMode = Marechai.Data.MeteringMode;
using Orientation = Marechai.Data.Orientation;
using ResolutionUnit = Marechai.Data.ResolutionUnit;
using Saturation = Marechai.Data.Saturation;
using SceneCaptureType = Marechai.Data.SceneCaptureType;
using SensingMethod = Marechai.Data.SensingMethod;
using Sharpness = Marechai.Data.Sharpness;
using SubjectDistanceRange = Marechai.Data.SubjectDistanceRange;
using WhiteBalance = Marechai.Data.WhiteBalance;
namespace Marechai.App.Presentation.ViewModels;
/// <summary>
/// Navigation parameter for photo detail page
/// </summary>
public class PhotoDetailNavigationParameter
{
public Guid PhotoId { get; set; }
}
public partial class PhotoDetailViewModel : ObservableObject
{
private readonly ComputersService _computersService;
private readonly ILogger<PhotoDetailViewModel> _logger;
private readonly INavigator _navigator;
private readonly MachinePhotoCache _photoCache;
[ObservableProperty]
private string _errorMessage = string.Empty;
[ObservableProperty]
private bool _errorOccurred;
[ObservableProperty]
private bool _isLoading;
[ObservableProperty]
private bool _isPortrait = true;
// EXIF Camera Settings
[ObservableProperty]
private string _photoAperture = string.Empty;
[ObservableProperty]
private string _photoAuthor = string.Empty;
[ObservableProperty]
private string _photoCameraManufacturer = string.Empty;
[ObservableProperty]
private string _photoCameraModel = string.Empty;
// Photo Properties
[ObservableProperty]
private string _photoColorSpace = string.Empty;
[ObservableProperty]
private string _photoComments = string.Empty;
[ObservableProperty]
private string _photoContrast = string.Empty;
[ObservableProperty]
private string _photoCreationDate = string.Empty;
[ObservableProperty]
private string _photoDigitalZoomRatio = string.Empty;
[ObservableProperty]
private string _photoExifVersion = string.Empty;
[ObservableProperty]
private string _photoExposureMode = string.Empty;
[ObservableProperty]
private string _photoExposureProgram = string.Empty;
[ObservableProperty]
private string _photoExposureTime = string.Empty;
[ObservableProperty]
private string _photoFlash = string.Empty;
[ObservableProperty]
private string _photoFocalLength = string.Empty;
[ObservableProperty]
private string _photoFocalLengthEquivalent = string.Empty;
// Resolution and Other
[ObservableProperty]
private string _photoHorizontalResolution = string.Empty;
[ObservableProperty]
private BitmapImage? _photoImageSource;
[ObservableProperty]
private string _photoIsoRating = string.Empty;
[ObservableProperty]
private string _photoLensModel = string.Empty;
[ObservableProperty]
private string _photoLicenseName = string.Empty;
[ObservableProperty]
private string _photoLightSource = string.Empty;
[ObservableProperty]
private string _photoMachineCompany = string.Empty;
[ObservableProperty]
private string _photoMachineName = string.Empty;
[ObservableProperty]
private string _photoMeteringMode = string.Empty;
[ObservableProperty]
private string _photoOrientation = string.Empty;
[ObservableProperty]
private string _photoOriginalExtension = string.Empty;
[ObservableProperty]
private string _photoResolutionUnit = string.Empty;
[ObservableProperty]
private string _photoSaturation = string.Empty;
[ObservableProperty]
private string _photoSceneCaptureType = string.Empty;
[ObservableProperty]
private string _photoSensingMethod = string.Empty;
[ObservableProperty]
private string _photoSharpness = string.Empty;
[ObservableProperty]
private string _photoSoftwareUsed = string.Empty;
[ObservableProperty]
private string _photoSource = string.Empty;
[ObservableProperty]
private string _photoSubjectDistanceRange = string.Empty;
[ObservableProperty]
private string _photoUploadDate = string.Empty;
[ObservableProperty]
private string _photoVerticalResolution = string.Empty;
[ObservableProperty]
private string _photoWhiteBalance = string.Empty;
public PhotoDetailViewModel(ILogger<PhotoDetailViewModel> logger, INavigator navigator,
ComputersService computersService, MachinePhotoCache photoCache)
{
_logger = logger;
_navigator = navigator;
_computersService = computersService;
_photoCache = photoCache;
}
[RelayCommand]
public async Task GoBack()
{
await _navigator.GoBack(this);
}
[RelayCommand]
public async Task LoadPhoto(Guid photoId)
{
try
{
IsLoading = true;
ErrorOccurred = false;
ErrorMessage = string.Empty;
PhotoImageSource = null;
_logger.LogInformation("Loading photo details for {PhotoId}", photoId);
// Fetch photo details from API
MachinePhotoDto? photo = await _computersService.GetMachinePhotoDetailsAsync(photoId);
if(photo is null)
{
ErrorOccurred = true;
ErrorMessage = "Photo not found";
IsLoading = false;
return;
}
// Populate photo information
PhotoAuthor = photo.Author ?? string.Empty;
PhotoCameraManufacturer = photo.CameraManufacturer ?? string.Empty;
PhotoCameraModel = photo.CameraModel ?? string.Empty;
PhotoComments = photo.Comments ?? string.Empty;
PhotoLensModel = photo.Lens ?? string.Empty;
PhotoLicenseName = photo.LicenseName ?? string.Empty;
PhotoMachineCompany = photo.MachineCompanyName ?? string.Empty;
PhotoMachineName = photo.MachineName ?? string.Empty;
PhotoOriginalExtension = photo.OriginalExtension ?? string.Empty;
if(photo.CreationDate.HasValue)
PhotoCreationDate = photo.CreationDate.Value.ToString("MMMM d, yyyy 'at' HH:mm");
// EXIF Camera Settings
PhotoAperture = photo.Aperture != null ? $"f/{photo.Aperture}" : string.Empty;
PhotoExposureTime = photo.Exposure != null ? $"{photo.Exposure}s" : string.Empty;
// Extract ExposureMode - simple nullable integer now
PhotoExposureMode = photo.ExposureMethod.HasValue
? ((ExposureMode)photo.ExposureMethod.Value).Humanize()
: string.Empty;
// Extract ExposureProgram - simple nullable integer now
PhotoExposureProgram = photo.ExposureProgram.HasValue
? ((ExposureProgram)photo.ExposureProgram.Value).Humanize()
: string.Empty;
PhotoFocalLength = photo.FocalLength != null ? $"{photo.FocalLength}mm" : string.Empty;
PhotoFocalLengthEquivalent = photo.FocalEquivalent != null ? $"{photo.FocalEquivalent}mm" : string.Empty;
PhotoIsoRating = photo.Iso != null ? photo.Iso.ToString() : string.Empty;
// Extract Flash - simple nullable integer now
PhotoFlash = photo.Flash.HasValue ? ((Flash)photo.Flash.Value).Humanize() : string.Empty;
// Extract LightSource - simple nullable integer now
PhotoLightSource = photo.LightSource.HasValue
? ((LightSource)photo.LightSource.Value).Humanize()
: string.Empty;
// Extract MeteringMode - simple nullable integer now
PhotoMeteringMode = photo.MeteringMode.HasValue
? ((MeteringMode)photo.MeteringMode.Value).Humanize()
: string.Empty;
// Extract WhiteBalance - simple nullable integer now
PhotoWhiteBalance = photo.WhiteBalance.HasValue
? ((WhiteBalance)photo.WhiteBalance.Value).Humanize()
: string.Empty;
// Photo Properties
// Extract ColorSpace - simple nullable integer now
PhotoColorSpace = photo.Colorspace.HasValue
? ((ColorSpace)photo.Colorspace.Value).Humanize()
: string.Empty;
// Extract Contrast - simple nullable integer now
PhotoContrast = photo.Contrast.HasValue ? ((Contrast)photo.Contrast.Value).Humanize() : string.Empty;
// Extract Saturation - simple nullable integer now
PhotoSaturation = photo.Saturation.HasValue
? ((Saturation)photo.Saturation.Value).Humanize()
: string.Empty;
// Extract Sharpness - simple nullable integer now
PhotoSharpness = photo.Sharpness.HasValue ? ((Sharpness)photo.Sharpness.Value).Humanize() : string.Empty;
// Extract Orientation - simple nullable integer now
PhotoOrientation = photo.Orientation.HasValue
? ((Orientation)photo.Orientation.Value).Humanize()
: string.Empty;
// Extract SceneCaptureType - simple nullable integer now
PhotoSceneCaptureType = photo.SceneCaptureType.HasValue
? ((SceneCaptureType)photo.SceneCaptureType.Value).Humanize()
: string.Empty;
// Extract SensingMethod - simple nullable integer now
PhotoSensingMethod = photo.SensingMethod.HasValue
? ((SensingMethod)photo.SensingMethod.Value).Humanize()
: string.Empty;
// Extract SubjectDistanceRange - simple nullable integer now
PhotoSubjectDistanceRange = photo.SubjectDistanceRange.HasValue
? ((SubjectDistanceRange)photo.SubjectDistanceRange.Value).Humanize()
: string.Empty;
// Resolution and Other
PhotoHorizontalResolution =
photo.HorizontalResolution != null ? $"{photo.HorizontalResolution} DPI" : string.Empty;
PhotoVerticalResolution =
photo.VerticalResolution != null ? $"{photo.VerticalResolution} DPI" : string.Empty;
// Extract ResolutionUnit - simple nullable integer now
PhotoResolutionUnit = photo.ResolutionUnit.HasValue
? ((ResolutionUnit)photo.ResolutionUnit.Value).Humanize()
: string.Empty;
PhotoDigitalZoomRatio = photo.DigitalZoom != null ? $"{photo.DigitalZoom}x" : string.Empty;
PhotoExifVersion = photo.ExifVersion ?? string.Empty;
PhotoSoftwareUsed = photo.Software ?? string.Empty;
PhotoUploadDate = photo.UploadDate.HasValue
? photo.UploadDate.Value.ToString("MMMM d, yyyy 'at' HH:mm")
: string.Empty;
PhotoSource = photo.Source ?? string.Empty;
// Load the full photo image
await LoadPhotoImageAsync(photoId);
IsLoading = false;
}
catch(Exception ex)
{
_logger.LogError(ex, "Error loading photo details for {PhotoId}", photoId);
ErrorOccurred = true;
ErrorMessage = ex.Message;
IsLoading = false;
}
}
/// <summary>
/// Updates the portrait/landscape orientation flag
/// </summary>
public void UpdateOrientation(bool isPortrait)
{
IsPortrait = isPortrait;
}
private async Task LoadPhotoImageAsync(Guid photoId)
{
try
{
Stream stream = await _photoCache.GetPhotoAsync(photoId);
var bitmap = new BitmapImage();
using(IRandomAccessStream randomStream = stream.AsRandomAccessStream())
{
await bitmap.SetSourceAsync(randomStream);
}
PhotoImageSource = bitmap;
}
catch(Exception ex)
{
_logger.LogError(ex, "Error loading photo image {PhotoId}", photoId);
ErrorOccurred = true;
ErrorMessage = "Failed to load photo image";
}
}
/// <summary>
/// Extracts an integer value from AdditionalData dictionary
/// </summary>
private int ExtractInt(IDictionary<string, object> additionalData)
{
if(additionalData == null || additionalData.Count == 0) return 0;
object? value = additionalData.Values.FirstOrDefault();
if(value is int intValue) return intValue;
if(value is double dblValue) return (int)dblValue;
if(int.TryParse(value?.ToString() ?? "", out int parsed)) return parsed;
return 0;
}
/// <summary>
/// Humanizes an enum value extracted from AdditionalData
/// </summary>
private string ExtractAndHumanizeEnum(IDictionary<string, object>? additionalData, Type enumType)
{
if(additionalData == null || additionalData.Count == 0) return string.Empty;
int intValue = ExtractInt(additionalData);
if(intValue == 0 && enumType != typeof(ExposureMode)) return string.Empty;
var enumValue = Enum.ToObject(enumType, intValue);
return ((Enum)enumValue).Humanize();
}
}

View File

@@ -0,0 +1,294 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Input;
using Marechai.App.Presentation.Models;
using Marechai.App.Services;
using Uno.Extensions.Navigation;
namespace Marechai.App.Presentation.ViewModels;
public partial class ProcessorDetailViewModel : ObservableObject
{
private readonly CompaniesService _companiesService;
private readonly IStringLocalizer _localizer;
private readonly ILogger<ProcessorDetailViewModel> _logger;
private readonly INavigator _navigator;
private readonly ProcessorsService _processorsService;
[ObservableProperty]
private ObservableCollection<MachineItem> _computers = [];
[ObservableProperty]
private string _computersFilterText = string.Empty;
[ObservableProperty]
private string _consoelsFilterText = string.Empty;
[ObservableProperty]
private ObservableCollection<MachineItem> _consoles = [];
[ObservableProperty]
private string _errorMessage = string.Empty;
[ObservableProperty]
private ObservableCollection<MachineItem> _filteredComputers = [];
[ObservableProperty]
private ObservableCollection<MachineItem> _filteredConsoles = [];
[ObservableProperty]
private bool _hasComputers;
[ObservableProperty]
private bool _hasConsoles;
[ObservableProperty]
private bool _hasError;
[ObservableProperty]
private bool _isDataLoaded;
[ObservableProperty]
private bool _isLoading;
[ObservableProperty]
private string _manufacturerName = string.Empty;
private object? _navigationSource;
[ObservableProperty]
private ProcessorDto? _processor;
[ObservableProperty]
private int _processorId;
public ProcessorDetailViewModel(ProcessorsService processorsService, CompaniesService companiesService,
IStringLocalizer localizer, ILogger<ProcessorDetailViewModel> logger,
INavigator navigator)
{
_processorsService = processorsService;
_companiesService = companiesService;
_localizer = localizer;
_logger = logger;
_navigator = navigator;
LoadData = new AsyncRelayCommand(LoadDataAsync);
GoBackCommand = new AsyncRelayCommand(GoBackAsync);
SelectMachineCommand = new AsyncRelayCommand<int>(SelectMachineAsync);
ComputersFilterCommand = new RelayCommand(() => FilterComputers());
ConsolesFilterCommand = new RelayCommand(() => FilterConsoles());
}
public IAsyncRelayCommand LoadData { get; }
public ICommand GoBackCommand { get; }
public IAsyncRelayCommand SelectMachineCommand { get; }
public ICommand ComputersFilterCommand { get; }
public ICommand ConsolesFilterCommand { get; }
public string Title { get; } = "Processor Details";
/// <summary>
/// Loads Processor details
/// </summary>
private async Task LoadDataAsync()
{
try
{
IsLoading = true;
ErrorMessage = string.Empty;
HasError = false;
IsDataLoaded = false;
Computers.Clear();
Consoles.Clear();
if(ProcessorId <= 0)
{
ErrorMessage = _localizer["Invalid Processor ID"].Value;
HasError = true;
return;
}
_logger.LogInformation("Loading Processor details for ID: {ProcessorId}", ProcessorId);
// Load Processor details
Processor = await _processorsService.GetProcessorByIdAsync(ProcessorId);
if(Processor is null)
{
ErrorMessage = _localizer["Processor not found"].Value;
HasError = true;
return;
}
// Set manufacturer name (from Company field or fetch by CompanyId if empty)
ManufacturerName = Processor.Company ?? string.Empty;
if(string.IsNullOrEmpty(ManufacturerName) && Processor.CompanyId.HasValue)
{
try
{
CompanyDto? company = await _companiesService.GetCompanyByIdAsync(Processor.CompanyId.Value);
if(company != null) ManufacturerName = company.Name ?? string.Empty;
}
catch(Exception ex)
{
_logger.LogWarning(ex, "Failed to load company for Processor {ProcessorId}", ProcessorId);
}
}
_logger.LogInformation("Processor loaded: {Name}, Company: {Company}", Processor.Name, ManufacturerName);
// Load machines and separate into computers and consoles
try
{
List<MachineDto>? machines = await _processorsService.GetMachinesByProcessorAsync(ProcessorId);
if(machines != null && machines.Count > 0)
{
Computers.Clear();
Consoles.Clear();
foreach(MachineDto machine in machines)
{
var machineItem = new MachineItem
{
Id = machine.Id ?? 0,
Name = machine.Name ?? string.Empty,
Manufacturer = machine.Company ?? string.Empty,
Year = machine.Introduced?.Year ?? 0
};
// Distinguish between computers and consoles based on Type
if(machine.Type == 2) // MachineType.Console
Consoles.Add(machineItem);
else // MachineType.Computer or Unknown
Computers.Add(machineItem);
}
HasComputers = Computers.Count > 0;
HasConsoles = Consoles.Count > 0;
// Initialize filtered collections
FilterComputers();
FilterConsoles();
_logger.LogInformation("Loaded {ComputerCount} computers and {ConsoleCount} consoles for Processor {ProcessorId}",
Computers.Count,
Consoles.Count,
ProcessorId);
}
else
{
HasComputers = false;
HasConsoles = false;
}
}
catch(Exception ex)
{
_logger.LogWarning(ex, "Failed to load machines for Processor {ProcessorId}", ProcessorId);
HasComputers = false;
HasConsoles = false;
}
IsDataLoaded = true;
}
catch(Exception ex)
{
_logger.LogError(ex, "Error loading Processor details: {Exception}", ex.Message);
ErrorMessage = _localizer["Failed to load processor details. Please try again later."].Value;
HasError = true;
}
finally
{
IsLoading = false;
}
}
/// <summary>
/// Navigates back to the Processor list
/// </summary>
private async Task GoBackAsync()
{
// If we came from a machine view, go back to machine view
if(_navigationSource is MachineViewViewModel machineVm)
{
await _navigator.NavigateViewModelAsync<MachineViewViewModel>(this);
return;
}
// Default: go back to Processor list
await _navigator.NavigateViewModelAsync<ProcessorsListViewModel>(this);
}
/// <summary>
/// Filters computers based on search text
/// </summary>
private void FilterComputers()
{
if(string.IsNullOrWhiteSpace(ComputersFilterText))
{
FilteredComputers.Clear();
foreach(MachineItem computer in Computers) FilteredComputers.Add(computer);
}
else
{
var filtered = Computers
.Where(c => c.Name.Contains(ComputersFilterText, StringComparison.OrdinalIgnoreCase))
.ToList();
FilteredComputers.Clear();
foreach(MachineItem computer in filtered) FilteredComputers.Add(computer);
}
}
/// <summary>
/// Filters consoles based on search text
/// </summary>
private void FilterConsoles()
{
if(string.IsNullOrWhiteSpace(ConsoelsFilterText))
{
FilteredConsoles.Clear();
foreach(MachineItem console in Consoles) FilteredConsoles.Add(console);
}
else
{
var filtered = Consoles.Where(c => c.Name.Contains(ConsoelsFilterText, StringComparison.OrdinalIgnoreCase))
.ToList();
FilteredConsoles.Clear();
foreach(MachineItem console in filtered) FilteredConsoles.Add(console);
}
}
/// <summary>
/// Navigates to machine detail view
/// </summary>
private async Task SelectMachineAsync(int machineId)
{
if(machineId <= 0) return;
var navParam = new MachineViewNavigationParameter
{
MachineId = machineId,
NavigationSource = this
};
await _navigator.NavigateViewModelAsync<MachineViewViewModel>(this, data: navParam);
}
/// <summary>
/// Sets the navigation source (where we came from).
/// </summary>
public void SetNavigationSource(object? source)
{
_navigationSource = source;
}
}

View File

@@ -0,0 +1,177 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Threading.Tasks;
using Marechai.App.Presentation.Models;
using Marechai.App.Services;
using Uno.Extensions.Navigation;
namespace Marechai.App.Presentation.ViewModels;
/// <summary>
/// ViewModel for displaying a list of Processors
/// </summary>
public partial class ProcessorsListViewModel : ObservableObject
{
private readonly IStringLocalizer _localizer;
private readonly ILogger<ProcessorsListViewModel> _logger;
private readonly INavigator _navigator;
private readonly ProcessorsService _processorsService;
[ObservableProperty]
private string _errorMessage = string.Empty;
[ObservableProperty]
private bool _hasError;
[ObservableProperty]
private bool _isDataLoaded;
[ObservableProperty]
private bool _isLoading;
[ObservableProperty]
private string _pageTitle = string.Empty;
[ObservableProperty]
private ObservableCollection<ProcessorListItem> _processorsList = [];
public ProcessorsListViewModel(ProcessorsService processorsService, IStringLocalizer localizer,
ILogger<ProcessorsListViewModel> logger, INavigator navigator)
{
_processorsService = processorsService;
_localizer = localizer;
_logger = logger;
_navigator = navigator;
LoadData = new AsyncRelayCommand(LoadDataAsync);
NavigateToProcessorCommand = new AsyncRelayCommand<ProcessorListItem>(NavigateToProcessorAsync);
}
public IAsyncRelayCommand LoadData { get; }
public IAsyncRelayCommand<ProcessorListItem> NavigateToProcessorCommand { get; }
/// <summary>
/// Loads all Processors and sorts them alphabetically
/// </summary>
private async Task LoadDataAsync()
{
try
{
IsLoading = true;
ErrorMessage = string.Empty;
HasError = false;
IsDataLoaded = false;
ProcessorsList.Clear();
_logger.LogInformation("LoadDataAsync called for Processors");
PageTitle = _localizer["Processors"];
// Load Processors from the API
await LoadProcessorsFromApiAsync();
_logger.LogInformation("LoadProcessorsFromApiAsync completed. ProcessorsList.Count={Count}",
ProcessorsList.Count);
if(ProcessorsList.Count == 0)
{
ErrorMessage = _localizer["No processors found"].Value;
HasError = true;
_logger.LogWarning("No Processors found");
}
else
IsDataLoaded = true;
}
catch(Exception ex)
{
_logger.LogError(ex, "Error loading Processors: {Exception}", ex.Message);
ErrorMessage = _localizer["Failed to load processors. Please try again later."].Value;
HasError = true;
}
finally
{
IsLoading = false;
}
}
/// <summary>
/// Loads Processors from the API and sorts them alphabetically
/// </summary>
private async Task LoadProcessorsFromApiAsync()
{
try
{
List<ProcessorDto> processors = await _processorsService.GetAllProcessorsAsync();
if(processors == null || processors.Count == 0)
{
_logger.LogInformation("No Processors returned from API");
return;
}
var processorItems = new List<ProcessorListItem>();
foreach(ProcessorDto processor in processors)
{
var processorItem = new ProcessorListItem
{
Id = processor.Id ?? 0,
Name = processor.Name ?? string.Empty,
Company = processor.Company ?? string.Empty
};
processorItems.Add(processorItem);
_logger.LogInformation("Processor: {Name}, Company: {Company}, ID: {Id}",
processor.Name,
processor.Company,
processor.Id);
}
// Sort processors alphabetically
processorItems.Sort((a, b) => string.Compare(a.Name, b.Name, StringComparison.OrdinalIgnoreCase));
// Add all processors to the list
foreach(ProcessorListItem processor in processorItems) ProcessorsList.Add(processor);
}
catch(Exception ex)
{
_logger.LogError(ex, "Error loading Processors from API");
}
}
/// <summary>
/// Navigates to the Processor detail view
/// </summary>
private async Task NavigateToProcessorAsync(ProcessorListItem? processor)
{
if(processor is null) return;
_logger.LogInformation("Navigating to Processor detail: {ProcessorName} (ID: {ProcessorId})",
processor.Name,
processor.Id);
// Navigate to Processor detail view with navigation parameter
var navParam = new ProcessorDetailNavigationParameter
{
ProcessorId = processor.Id,
NavigationSource = this
};
await _navigator.NavigateViewModelAsync<ProcessorDetailViewModel>(this, data: navParam);
}
}
/// <summary>
/// Data model for a Processor in the list
/// </summary>
public class ProcessorListItem
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Company { get; set; } = string.Empty;
}

View File

@@ -0,0 +1,308 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Input;
using Marechai.App.Presentation.Models;
using Marechai.App.Services;
using Uno.Extensions.Navigation;
namespace Marechai.App.Presentation.ViewModels;
public partial class SoundSynthDetailViewModel : ObservableObject
{
private readonly CompaniesService _companiesService;
private readonly IStringLocalizer _localizer;
private readonly ILogger<SoundSynthDetailViewModel> _logger;
private readonly INavigator _navigator;
private readonly SoundSynthsService _soundSynthsService;
[ObservableProperty]
private ObservableCollection<MachineItem> _computers = [];
[ObservableProperty]
private string _computersFilterText = string.Empty;
[ObservableProperty]
private string _consoelsFilterText = string.Empty;
[ObservableProperty]
private ObservableCollection<MachineItem> _consoles = [];
[ObservableProperty]
private string _errorMessage = string.Empty;
[ObservableProperty]
private ObservableCollection<MachineItem> _filteredComputers = [];
[ObservableProperty]
private ObservableCollection<MachineItem> _filteredConsoles = [];
[ObservableProperty]
private bool _hasComputers;
[ObservableProperty]
private bool _hasConsoles;
[ObservableProperty]
private bool _hasError;
[ObservableProperty]
private bool _isDataLoaded;
[ObservableProperty]
private bool _isLoading;
[ObservableProperty]
private string _manufacturerName = string.Empty;
private object? _navigationSource;
[ObservableProperty]
private SoundSynthDto? _soundSynth;
[ObservableProperty]
private int _soundSynthId;
public SoundSynthDetailViewModel(SoundSynthsService soundSynthsService, CompaniesService companiesService,
IStringLocalizer localizer, ILogger<SoundSynthDetailViewModel> logger,
INavigator navigator)
{
_soundSynthsService = soundSynthsService;
_companiesService = companiesService;
_localizer = localizer;
_logger = logger;
_navigator = navigator;
LoadData = new AsyncRelayCommand(LoadDataAsync);
GoBackCommand = new AsyncRelayCommand(GoBackAsync);
SelectMachineCommand = new AsyncRelayCommand<int>(SelectMachineAsync);
ComputersFilterCommand = new RelayCommand(() => FilterComputers());
ConsolesFilterCommand = new RelayCommand(() => FilterConsoles());
}
public IAsyncRelayCommand LoadData { get; }
public ICommand GoBackCommand { get; }
public IAsyncRelayCommand SelectMachineCommand { get; }
public ICommand ComputersFilterCommand { get; }
public ICommand ConsolesFilterCommand { get; }
public string Title { get; } = "Sound Synthesizer Details";
/// <summary>
/// Loads Sound Synthesizer details including computers and consoles
/// </summary>
private async Task LoadDataAsync()
{
try
{
IsLoading = true;
ErrorMessage = string.Empty;
HasError = false;
IsDataLoaded = false;
Computers.Clear();
Consoles.Clear();
if(SoundSynthId <= 0)
{
ErrorMessage = _localizer["Invalid Sound Synthesizer ID"].Value;
HasError = true;
return;
}
_logger.LogInformation("Loading Sound Synthesizer details for ID: {SoundSynthId}", SoundSynthId);
// Load Sound Synthesizer details
SoundSynth = await _soundSynthsService.GetSoundSynthByIdAsync(SoundSynthId);
if(SoundSynth is null)
{
ErrorMessage = _localizer["Sound Synthesizer not found"].Value;
HasError = true;
return;
}
// Set manufacturer name (from Company field or fetch by CompanyId if empty)
ManufacturerName = SoundSynth.Company ?? string.Empty;
if(string.IsNullOrEmpty(ManufacturerName) && SoundSynth.CompanyId.HasValue)
{
try
{
CompanyDto? company = await _companiesService.GetCompanyByIdAsync(SoundSynth.CompanyId.Value);
if(company != null) ManufacturerName = company.Name ?? string.Empty;
}
catch(Exception ex)
{
_logger.LogWarning(ex, "Failed to load company for Sound Synthesizer {SoundSynthId}", SoundSynthId);
}
}
_logger.LogInformation("Sound Synthesizer loaded: {Name}, Company: {Company}",
SoundSynth.Name,
ManufacturerName);
// Load machines and separate into computers and consoles
try
{
List<MachineDto>? machines = await _soundSynthsService.GetMachinesBySoundSynthAsync(SoundSynthId);
if(machines != null && machines.Count > 0)
{
Computers.Clear();
Consoles.Clear();
foreach(MachineDto machine in machines)
{
var machineItem = new MachineItem
{
Id = machine.Id ?? 0,
Name = machine.Name ?? string.Empty,
Manufacturer = machine.Company ?? string.Empty,
Year = machine.Introduced?.Year ?? 0
};
// Distinguish between computers and consoles based on Type
if(machine.Type == 2) // MachineType.Console
Consoles.Add(machineItem);
else // MachineType.Computer or Unknown
Computers.Add(machineItem);
}
HasComputers = Computers.Count > 0;
HasConsoles = Consoles.Count > 0;
// Initialize filtered collections
FilterComputers();
FilterConsoles();
_logger.LogInformation("Loaded {ComputerCount} computers and {ConsoleCount} consoles for Sound Synthesizer {SoundSynthId}",
Computers.Count,
Consoles.Count,
SoundSynthId);
}
else
{
HasComputers = false;
HasConsoles = false;
}
}
catch(Exception ex)
{
_logger.LogWarning(ex, "Failed to load machines for Sound Synthesizer {SoundSynthId}", SoundSynthId);
HasComputers = false;
HasConsoles = false;
}
IsDataLoaded = true;
}
catch(Exception ex)
{
_logger.LogError(ex, "Error loading Sound Synthesizer details: {Exception}", ex.Message);
ErrorMessage = _localizer["Failed to load Sound Synthesizer details. Please try again later."].Value;
HasError = true;
}
finally
{
IsLoading = false;
}
}
/// <summary>
/// Filters computers based on search text
/// </summary>
private void FilterComputers()
{
if(string.IsNullOrWhiteSpace(ComputersFilterText))
{
FilteredComputers.Clear();
foreach(MachineItem computer in Computers) FilteredComputers.Add(computer);
}
else
{
var filtered = Computers
.Where(c => c.Name.Contains(ComputersFilterText, StringComparison.OrdinalIgnoreCase))
.ToList();
FilteredComputers.Clear();
foreach(MachineItem computer in filtered) FilteredComputers.Add(computer);
}
}
/// <summary>
/// Filters consoles based on search text
/// </summary>
private void FilterConsoles()
{
if(string.IsNullOrWhiteSpace(ConsoelsFilterText))
{
FilteredConsoles.Clear();
foreach(MachineItem console in Consoles) FilteredConsoles.Add(console);
}
else
{
var filtered = Consoles.Where(c => c.Name.Contains(ConsoelsFilterText, StringComparison.OrdinalIgnoreCase))
.ToList();
FilteredConsoles.Clear();
foreach(MachineItem console in filtered) FilteredConsoles.Add(console);
}
}
/// <summary>
/// Navigates back to the Sound Synthesizer list
/// </summary>
private async Task GoBackAsync()
{
// If we came from a machine view, go back to machine view
if(_navigationSource is MachineViewViewModel machineVm)
{
await _navigator.NavigateViewModelAsync<MachineViewViewModel>(this);
return;
}
// Default: go back to Sound Synthesizer list
await _navigator.NavigateViewModelAsync<SoundSynthsListViewModel>(this);
}
/// <summary>
/// Navigates to machine detail view
/// </summary>
private async Task SelectMachineAsync(int machineId)
{
if(machineId <= 0) return;
var navParam = new MachineViewNavigationParameter
{
MachineId = machineId,
NavigationSource = this
};
await _navigator.NavigateViewModelAsync<MachineViewViewModel>(this, data: navParam);
}
/// <summary>
/// Sets the navigation source (where we came from).
/// </summary>
public void SetNavigationSource(object? source)
{
_navigationSource = source;
}
/// <summary>
/// Machine item for displaying computers or consoles that use the Sound Synthesizer
/// </summary>
public class MachineItem
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Manufacturer { get; set; } = string.Empty;
public int Year { get; set; }
public string YearDisplay => Year > 0 ? Year.ToString() : "Unknown";
}
}

View File

@@ -0,0 +1,103 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading.Tasks;
using Marechai.App.Presentation.Models;
using Marechai.App.Services;
using Uno.Extensions.Navigation;
namespace Marechai.App.Presentation.ViewModels;
public partial class SoundSynthsListViewModel : ObservableObject
{
private readonly ILogger<SoundSynthsListViewModel> _logger;
private readonly INavigator _navigator;
private readonly SoundSynthsService _soundSynthsService;
[ObservableProperty]
private string _errorMessage = string.Empty;
[ObservableProperty]
private bool _hasError;
[ObservableProperty]
private bool _isDataLoaded;
[ObservableProperty]
private bool _isLoading = true;
[ObservableProperty]
private ObservableCollection<SoundSynthListItem> _soundSynths = [];
public SoundSynthsListViewModel(SoundSynthsService soundSynthsService, INavigator navigator,
ILogger<SoundSynthsListViewModel> logger)
{
_soundSynthsService = soundSynthsService;
_navigator = navigator;
_logger = logger;
LoadData = new AsyncRelayCommand(LoadDataAsync);
NavigateToSoundSynthCommand = new AsyncRelayCommand<SoundSynthListItem>(NavigateToSoundSynthAsync);
}
public IAsyncRelayCommand LoadData { get; }
public IAsyncRelayCommand<SoundSynthListItem> NavigateToSoundSynthCommand { get; }
private async Task LoadDataAsync()
{
try
{
IsLoading = true;
IsDataLoaded = false;
HasError = false;
ErrorMessage = string.Empty;
List<SoundSynthDto> soundSynths = await _soundSynthsService.GetAllSoundSynthsAsync();
SoundSynths = new ObservableCollection<SoundSynthListItem>(soundSynths.Select(ss => new SoundSynthListItem
{
Id = ss.Id ?? 0,
Name = ss.Name ?? "Unknown",
Company = ss.Company ?? "Unknown"
})
.OrderBy(ss => ss.Company)
.ThenBy(ss => ss.Name));
_logger.LogInformation("Successfully loaded {Count} Sound Synthesizers", SoundSynths.Count);
IsDataLoaded = true;
}
catch(Exception ex)
{
_logger.LogError(ex, "Error loading Sound Synthesizers");
ErrorMessage = "Failed to load Sound Synthesizers. Please try again later.";
HasError = true;
}
finally
{
IsLoading = false;
}
}
private async Task NavigateToSoundSynthAsync(SoundSynthListItem? item)
{
if(item == null) return;
_logger.LogInformation("Navigating to Sound Synthesizer {SoundSynthId}", item.Id);
await _navigator.NavigateViewModelAsync<SoundSynthDetailViewModel>(this,
data: new SoundSynthDetailNavigationParameter
{
SoundSynthId = item.Id,
NavigationSource = this
});
}
public class SoundSynthListItem
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public string? Company { get; set; }
}
}

View File

@@ -97,15 +97,34 @@
<Button HorizontalAlignment="Stretch"
Command="{Binding DataContext.NavigateToCompanyCommand, ElementName=PageRoot}"
CommandParameter="{Binding}">
<StackPanel Spacing="4"
Padding="8">
<TextBlock Text="{Binding Name}"
FontSize="16"
FontWeight="SemiBold" />
<TextBlock Text="{Binding FoundationDateDisplay}"
FontSize="12"
Opacity="0.6" />
</StackPanel>
<Grid ColumnSpacing="12">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<!-- Company Logo -->
<Image Grid.Column="0"
Width="48"
Height="48"
Stretch="Uniform"
VerticalAlignment="Center"
HorizontalAlignment="Left"
Source="{Binding LogoImageSource}"
Visibility="{Binding LogoImageSource, Converter={StaticResource ObjectToVisibilityConverter}}" />
<!-- Company Details -->
<StackPanel Grid.Column="1"
Spacing="4"
VerticalAlignment="Center">
<TextBlock Text="{Binding Name}"
FontSize="16"
FontWeight="SemiBold" />
<TextBlock Text="{Binding FoundationDateDisplay}"
FontSize="12"
Opacity="0.6" />
</StackPanel>
</Grid>
</Button>
</DataTemplate>
</ItemsRepeater.ItemTemplate>

View File

@@ -4,6 +4,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:utu="using:Uno.Toolkit.UI"
xmlns:controls="using:CommunityToolkit.WinUI.UI.Controls"
NavigationCacheMode="Required"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
@@ -18,7 +19,8 @@
<!-- Header -->
<utu:NavigationBar Grid.Row="0"
Content="{Binding Path=Title}">
Content="{Binding Path=Title}"
MainCommandMode="Action">
<utu:NavigationBar.MainCommand>
<AppBarButton Icon="Back"
Label="Back"
@@ -33,8 +35,7 @@
Spacing="16">
<!-- Logo Display (Top Center) -->
<Image MaxWidth="96"
MaxHeight="96"
<Image MaxHeight="96"
Stretch="Uniform"
VerticalAlignment="Center"
HorizontalAlignment="Center"
@@ -201,6 +202,49 @@
</HyperlinkButton>
</StackPanel>
<!-- Logo Carousel Section -->
<StackPanel Visibility="{Binding HasMultipleLogos, Converter={StaticResource BoolToVisibilityConverter}}"
Spacing="8">
<TextBlock Text="Logo History"
FontSize="14"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<!-- Logo Carousel -->
<controls:Carousel ItemsSource="{Binding CompanyLogos}"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="8"
ItemRotationY="45"
TransitionDuration="400"
Height="220">
<controls:Carousel.EasingFunction>
<CubicEase EasingMode="EaseOut" />
</controls:Carousel.EasingFunction>
<controls:Carousel.ItemTemplate>
<DataTemplate>
<StackPanel VerticalAlignment="Center"
HorizontalAlignment="Center"
Spacing="8"
Padding="24">
<!-- Logo Image -->
<Image Source="{Binding LogoSource}"
Width="120"
Height="120"
Stretch="Uniform"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
<!-- Year Label -->
<TextBlock Text="{Binding Year, FallbackValue='Year Unknown'}"
FontSize="12"
TextAlignment="Center"
Foreground="{ThemeResource SystemBaseMediumColor}" />
</StackPanel>
</DataTemplate>
</controls:Carousel.ItemTemplate>
</controls:Carousel>
</StackPanel>
<!-- Computers Section -->
<StackPanel Visibility="{Binding Computers.Count, Converter={StaticResource ZeroToVisibilityConverter}}"
Spacing="8">

View File

@@ -86,7 +86,14 @@
Foreground="{ThemeResource SystemBaseMediumColor}" />
<ItemsRepeater ItemsSource="{Binding LettersList}"
Layout="{StaticResource LettersGridLayout}">
<ItemsRepeater.ItemTemplate></ItemsRepeater.ItemTemplate>
<ItemsRepeater.ItemTemplate>
<DataTemplate>
<Button Content="{Binding}"
Command="{Binding DataContext.NavigateByLetterCommand, ElementName=PageRoot}"
CommandParameter="{Binding}"
Style="{StaticResource KeyboardKeyButtonStyle}" />
</DataTemplate>
</ItemsRepeater.ItemTemplate>
</ItemsRepeater>
</StackPanel>
@@ -98,7 +105,14 @@
Foreground="{ThemeResource SystemBaseMediumColor}" />
<ItemsRepeater ItemsSource="{Binding YearsList}"
Layout="{StaticResource YearsGridLayout}">
<ItemsRepeater.ItemTemplate></ItemsRepeater.ItemTemplate>
<ItemsRepeater.ItemTemplate>
<DataTemplate>
<Button Content="{Binding}"
Command="{Binding DataContext.NavigateByYearCommand, ElementName=PageRoot}"
CommandParameter="{Binding}"
Style="{StaticResource KeyboardKeyButtonStyle}" />
</DataTemplate>
</ItemsRepeater.ItemTemplate>
</ItemsRepeater>
</StackPanel>

View File

@@ -0,0 +1,374 @@
<?xml version="1.0" encoding="utf-8"?>
<Page x:Class="Marechai.App.Presentation.Views.GpuDetailPage"
x:Name="PageRoot"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:utu="using:Uno.Toolkit.UI"
xmlns:controls="using:CommunityToolkit.WinUI.UI.Controls"
NavigationCacheMode="Required"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Page.Resources>
</Page.Resources>
<Grid utu:SafeArea.Insets="VisibleBounds">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<!-- Header -->
<utu:NavigationBar Grid.Row="0"
Content="{Binding Path=Title}"
MainCommandMode="Action">
<utu:NavigationBar.MainCommand>
<AppBarButton Icon="Back"
Label="Back"
Command="{Binding GoBackCommand}"
AutomationProperties.Name="Go back" />
</utu:NavigationBar.MainCommand>
</utu:NavigationBar>
<!-- Content -->
<ScrollViewer Grid.Row="1">
<StackPanel Padding="16"
Spacing="16">
<!-- Loading State -->
<StackPanel Visibility="{Binding IsLoading}"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Padding="32"
Spacing="16">
<ProgressRing IsActive="True"
IsIndeterminate="True"
Height="48"
Width="48" />
<TextBlock Text="Loading..."
TextAlignment="Center"
FontSize="14" />
</StackPanel>
<!-- Error State -->
<StackPanel Visibility="{Binding HasError}"
Padding="16"
Background="{ThemeResource SystemErrorBackgroundColor}"
CornerRadius="8"
Spacing="8">
<TextBlock Text="Error"
FontWeight="Bold"
Foreground="{ThemeResource SystemErrorTextForegroundColor}" />
<TextBlock Text="{Binding ErrorMessage}"
Foreground="{ThemeResource SystemErrorTextForegroundColor}"
TextWrapping="Wrap" />
</StackPanel>
<!-- GPU Details -->
<StackPanel Visibility="{Binding IsDataLoaded}"
Spacing="16">
<!-- GPU Name -->
<TextBlock Text="{Binding Gpu.Name}"
FontSize="28"
FontWeight="Bold"
TextWrapping="Wrap" />
<!-- Company/Manufacturer -->
<StackPanel Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="8"
Padding="12"
Spacing="8">
<TextBlock Text="Manufacturer"
FontSize="14"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding ManufacturerName}"
FontSize="14"
TextWrapping="Wrap" />
</StackPanel>
<!-- Model Code -->
<StackPanel Visibility="{Binding Gpu.ModelCode, Converter={StaticResource StringToVisibilityConverter}}"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="8"
Padding="12"
Spacing="8">
<TextBlock Text="Model Code"
FontSize="14"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding Gpu.ModelCode}"
FontSize="14"
TextWrapping="Wrap" />
</StackPanel>
<!-- Introduced Date -->
<StackPanel Visibility="{Binding Gpu.Introduced, Converter={StaticResource ObjectToVisibilityConverter}}"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="8"
Padding="12"
Spacing="8">
<TextBlock Text="Introduced"
FontSize="14"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding Gpu.Introduced}"
FontSize="14" />
</StackPanel>
<!-- Package -->
<StackPanel Visibility="{Binding Gpu.Package, Converter={StaticResource StringToVisibilityConverter}}"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="8"
Padding="12"
Spacing="8">
<TextBlock Text="Package"
FontSize="14"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding Gpu.Package}"
FontSize="14"
TextWrapping="Wrap" />
</StackPanel>
<!-- Process -->
<StackPanel Visibility="{Binding Gpu.Process, Converter={StaticResource StringToVisibilityConverter}}"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="8"
Padding="12"
Spacing="8">
<TextBlock Text="Process"
FontSize="14"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding Gpu.Process}"
FontSize="14"
TextWrapping="Wrap" />
</StackPanel>
<!-- Process (nm) -->
<StackPanel Visibility="{Binding Gpu.ProcessNm, Converter={StaticResource StringToVisibilityConverter}}"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="8"
Padding="12"
Spacing="8">
<TextBlock Text="Process (nm)"
FontSize="14"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding Gpu.ProcessNm}"
FontSize="14"
TextWrapping="Wrap" />
</StackPanel>
<!-- Die Size -->
<StackPanel Visibility="{Binding Gpu.DieSize, Converter={StaticResource ObjectToVisibilityConverter}}"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="8"
Padding="12"
Spacing="8">
<TextBlock Text="Die Size (mm²)"
FontSize="14"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding Gpu.DieSize}"
FontSize="14"
TextWrapping="Wrap" />
</StackPanel>
<!-- Transistors -->
<StackPanel Visibility="{Binding Gpu.Transistors, Converter={StaticResource ObjectToVisibilityConverter}}"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="8"
Padding="12"
Spacing="8">
<TextBlock Text="Transistors"
FontSize="14"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding Gpu.Transistors}"
FontSize="14"
TextWrapping="Wrap" />
</StackPanel>
<!-- Resolutions Section -->
<StackPanel Visibility="{Binding Resolutions.Count, Converter={StaticResource ZeroToVisibilityConverter}}"
Spacing="8">
<StackPanel Orientation="Horizontal"
Spacing="8">
<TextBlock Text="Supported Resolutions"
FontSize="14"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding Resolutions.Count}"
FontSize="14"
FontWeight="Bold"
Foreground="{ThemeResource SystemAccentColor}" />
</StackPanel>
<!-- Scrollable Resolutions List -->
<ScrollViewer Height="200"
BorderThickness="1"
BorderBrush="{ThemeResource ControlElevationBorderBrush}"
CornerRadius="8">
<ItemsRepeater ItemsSource="{Binding Resolutions}"
Margin="0">
<ItemsRepeater.Layout>
<StackLayout Spacing="4" />
</ItemsRepeater.Layout>
<ItemsRepeater.ItemTemplate>
<DataTemplate>
<Border Padding="12,8"
HorizontalAlignment="Stretch"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="4"
Margin="0,4">
<StackPanel Spacing="4">
<!-- First line: Resolution dimensions or format -->
<TextBlock Text="{Binding ResolutionDisplay}"
FontSize="14"
FontWeight="SemiBold" />
<!-- Second line: Color/palette information -->
<TextBlock Text="{Binding ColorDisplay}"
FontSize="12"
Foreground="{ThemeResource SystemBaseMediumColor}" />
</StackPanel>
</Border>
</DataTemplate>
</ItemsRepeater.ItemTemplate>
</ItemsRepeater>
</ScrollViewer>
</StackPanel>
<!-- Computers Section -->
<StackPanel Visibility="{Binding HasComputers}"
Spacing="8">
<StackPanel Orientation="Horizontal"
Spacing="8">
<TextBlock Text="Computers"
FontSize="14"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding Computers.Count}"
FontSize="14"
FontWeight="Bold"
Foreground="{ThemeResource SystemAccentColor}" />
</StackPanel>
<!-- Filter Box -->
<AutoSuggestBox PlaceholderText="Filter computers..."
Text="{Binding ComputersFilterText, Mode=TwoWay}"
TextChanged="ComputersSearchBox_TextChanged"
BorderThickness="1"
BorderBrush="{ThemeResource ControlElevationBorderBrush}" />
<!-- Scrollable Computers List -->
<ScrollViewer Height="200"
BorderThickness="1"
BorderBrush="{ThemeResource ControlElevationBorderBrush}"
CornerRadius="8">
<ItemsRepeater ItemsSource="{Binding FilteredComputers}"
Margin="0">
<ItemsRepeater.Layout>
<StackLayout Spacing="4" />
</ItemsRepeater.Layout>
<ItemsRepeater.ItemTemplate>
<DataTemplate>
<Button Click="Computer_Click"
Tag="{Binding Id}"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Left"
Padding="12"
Margin="0,4">
<StackPanel Spacing="4"
HorizontalAlignment="Left">
<TextBlock Text="{Binding Name}"
FontSize="14"
FontWeight="SemiBold" />
<StackPanel Orientation="Horizontal"
Spacing="8">
<TextBlock Text="{Binding Manufacturer}"
FontSize="12"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding YearDisplay}"
FontSize="12"
Foreground="{ThemeResource SystemBaseMediumColor}" />
</StackPanel>
</StackPanel>
</Button>
</DataTemplate>
</ItemsRepeater.ItemTemplate>
</ItemsRepeater>
</ScrollViewer>
</StackPanel>
<!-- Consoles Section -->
<StackPanel Visibility="{Binding HasConsoles}"
Spacing="8">
<StackPanel Orientation="Horizontal"
Spacing="8">
<TextBlock Text="Consoles"
FontSize="14"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding Consoles.Count}"
FontSize="14"
FontWeight="Bold"
Foreground="{ThemeResource SystemAccentColor}" />
</StackPanel>
<!-- Filter Box -->
<AutoSuggestBox PlaceholderText="Filter consoles..."
Text="{Binding ConsoelsFilterText, Mode=TwoWay}"
TextChanged="ConsolesSearchBox_TextChanged"
BorderThickness="1"
BorderBrush="{ThemeResource ControlElevationBorderBrush}" />
<!-- Scrollable Consoles List -->
<ScrollViewer Height="200"
BorderThickness="1"
BorderBrush="{ThemeResource ControlElevationBorderBrush}"
CornerRadius="8">
<ItemsRepeater ItemsSource="{Binding FilteredConsoles}"
Margin="0">
<ItemsRepeater.Layout>
<StackLayout Spacing="4" />
</ItemsRepeater.Layout>
<ItemsRepeater.ItemTemplate>
<DataTemplate>
<Button Click="Console_Click"
Tag="{Binding Id}"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Left"
Padding="12"
Margin="0,4">
<StackPanel Spacing="4"
HorizontalAlignment="Left">
<TextBlock Text="{Binding Name}"
FontSize="14"
FontWeight="SemiBold" />
<StackPanel Orientation="Horizontal"
Spacing="8">
<TextBlock Text="{Binding Manufacturer}"
FontSize="12"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding YearDisplay}"
FontSize="12"
Foreground="{ThemeResource SystemBaseMediumColor}" />
</StackPanel>
</StackPanel>
</Button>
</DataTemplate>
</ItemsRepeater.ItemTemplate>
</ItemsRepeater>
</ScrollViewer>
</StackPanel>
</StackPanel>
</StackPanel>
</ScrollViewer>
</Grid>
</Page>

View File

@@ -0,0 +1,98 @@
#nullable enable
using Marechai.App.Presentation.Models;
using Marechai.App.Presentation.ViewModels;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Navigation;
namespace Marechai.App.Presentation.Views;
/// <summary>
/// GPU detail page showing all information, resolutions, computers, and consoles
/// </summary>
public sealed partial class GpuDetailPage : Page
{
private object? _navigationSource;
private int? _pendingGpuId;
public GpuDetailPage()
{
InitializeComponent();
DataContextChanged += GpuDetailPage_DataContextChanged;
}
protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
int? gpuId = null;
// Handle both int and GpuDetailNavigationParameter
if(e.Parameter is int intId)
gpuId = intId;
else if(e.Parameter is GpuDetailNavigationParameter navParam)
{
gpuId = navParam.GpuId;
_navigationSource = navParam.NavigationSource;
}
if(gpuId.HasValue)
{
_pendingGpuId = gpuId;
if(DataContext is GpuDetailViewModel viewModel)
{
viewModel.GpuId = gpuId.Value;
if(_navigationSource != null) viewModel.SetNavigationSource(_navigationSource);
_ = viewModel.LoadData.ExecuteAsync(null);
}
}
}
private void GpuDetailPage_DataContextChanged(FrameworkElement sender, DataContextChangedEventArgs args)
{
if(DataContext is GpuDetailViewModel viewModel && _pendingGpuId.HasValue)
{
viewModel.GpuId = _pendingGpuId.Value;
if(_navigationSource != null) viewModel.SetNavigationSource(_navigationSource);
_ = viewModel.LoadData.ExecuteAsync(null);
}
}
private void ComputersSearchBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
{
if(DataContext is GpuDetailViewModel vm) vm.ComputersFilterCommand.Execute(null);
}
private void ComputersSearchBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args)
{
if(args.Reason == AutoSuggestionBoxTextChangeReason.UserInput)
if(DataContext is GpuDetailViewModel vm)
vm.ComputersFilterCommand.Execute(null);
}
private void ConsolesSearchBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
{
if(DataContext is GpuDetailViewModel vm) vm.ConsolesFilterCommand.Execute(null);
}
private void ConsolesSearchBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args)
{
if(args.Reason == AutoSuggestionBoxTextChangeReason.UserInput)
if(DataContext is GpuDetailViewModel vm)
vm.ConsolesFilterCommand.Execute(null);
}
private void Computer_Click(object sender, RoutedEventArgs e)
{
if(sender is Button button && button.Tag is int machineId && DataContext is GpuDetailViewModel vm)
_ = vm.SelectMachineCommand.ExecuteAsync(machineId);
}
private void Console_Click(object sender, RoutedEventArgs e)
{
if(sender is Button button && button.Tag is int machineId && DataContext is GpuDetailViewModel vm)
_ = vm.SelectMachineCommand.ExecuteAsync(machineId);
}
}

View File

@@ -0,0 +1,207 @@
<?xml version="1.0"
encoding="utf-8"?>
<Page x:Class="Marechai.App.Presentation.Views.GpuListPage"
x:Name="PageRoot"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:utu="using:Uno.Toolkit.UI"
NavigationCacheMode="Required"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid utu:SafeArea.Insets="VisibleBounds">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="*" />
</Grid.RowDefinitions>
<!-- Header -->
<utu:NavigationBar Grid.Row="0"
Content="Graphics Processing Units">
</utu:NavigationBar>
<!-- Main Content -->
<Grid Grid.Row="1">
<!-- Loading State -->
<StackPanel Visibility="{Binding IsLoading}"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Padding="32"
Spacing="16">
<ProgressRing IsActive="True"
IsIndeterminate="True"
Height="64"
Width="64"
Foreground="{ThemeResource SystemAccentColor}" />
<TextBlock Text="Loading graphics processing units..."
FontSize="14"
TextAlignment="Center"
Foreground="{ThemeResource SystemBaseMediumColor}" />
</StackPanel>
<!-- Error State -->
<StackPanel Visibility="{Binding HasError}"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Padding="24"
Spacing="16"
MaxWidth="400">
<InfoBar IsOpen="True"
Severity="Error"
Title="Unable to Load Graphics Processing Units"
Message="{Binding ErrorMessage}"
IsClosable="False" />
<Button Content="Retry"
Command="{Binding LoadData}"
HorizontalAlignment="Center"
Style="{ThemeResource AccentButtonStyle}" />
</StackPanel>
<!-- GPUs List -->
<Grid Visibility="{Binding IsDataLoaded}">
<ScrollViewer VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Disabled">
<Grid Padding="8">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="*" />
</Grid.RowDefinitions>
<!-- Count Header -->
<StackPanel Grid.Row="0"
Padding="16,12"
Orientation="Horizontal"
Spacing="4">
<TextBlock FontSize="12"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}"
Text="RESULTS:" />
<TextBlock FontSize="12"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}"
Text="{Binding GpusList.Count}" />
<TextBlock FontSize="12"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}"
Text="graphics processing units" />
</StackPanel>
<!-- GPUs List -->
<ItemsControl Grid.Row="1"
ItemsSource="{Binding GpusList}"
Padding="0"
Margin="0,8,0,0"
HorizontalAlignment="Stretch">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical"
Spacing="0"
HorizontalAlignment="Stretch" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Button Padding="0"
Margin="0,0,0,8"
MinHeight="80"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
HorizontalAlignment="Stretch"
Command="{Binding DataContext.NavigateToGpuCommand, ElementName=PageRoot}"
CommandParameter="{Binding}"
Background="Transparent"
BorderThickness="0">
<Button.Template>
<ControlTemplate TargetType="Button">
<Grid MinHeight="80"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<!-- Shadow effect -->
<Border x:Name="ShadowBorder"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
BorderThickness="1"
CornerRadius="8"
Padding="16,12"
Translation="0, 0, 4"
VerticalAlignment="Stretch">
<Border.Shadow>
<ThemeShadow />
</Border.Shadow>
<Grid ColumnSpacing="16">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!-- GPU Info -->
<StackPanel Grid.Column="0"
Spacing="8"
VerticalAlignment="Center"
HorizontalAlignment="Stretch">
<TextBlock Text="{Binding Name}"
FontSize="16"
FontWeight="SemiBold"
Foreground="{ThemeResource TextControlForeground}"
TextTrimming="CharacterEllipsis" />
<StackPanel Orientation="Horizontal"
Spacing="6"
VerticalAlignment="Center">
<FontIcon Glyph="&#xE731;"
FontSize="14"
Foreground="{ThemeResource SystemAccentColor}" />
<TextBlock Text="{Binding Company}"
FontSize="13"
Foreground="{ThemeResource SystemBaseMediumColor}"
TextTrimming="CharacterEllipsis" />
</StackPanel>
</StackPanel>
<!-- Navigation Arrow -->
<StackPanel Grid.Column="1"
VerticalAlignment="Center">
<FontIcon Glyph="&#xE72A;"
FontSize="18"
Foreground="{ThemeResource SystemAccentColor}" />
</StackPanel>
</Grid>
</Border>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Target="ShadowBorder.Background"
Value="{ThemeResource CardBackgroundFillColorSecondaryBrush}" />
<Setter Target="ShadowBorder.Translation"
Value="0, -2, 8" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Pressed">
<VisualState.Setters>
<Setter Target="ShadowBorder.Background"
Value="{ThemeResource CardBackgroundFillColorTertiaryBrush}" />
<Setter Target="ShadowBorder.Translation"
Value="0, 0, 2" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Grid>
</ControlTemplate>
</Button.Template>
</Button>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
</ScrollViewer>
</Grid>
</Grid>
</Grid>
</Page>

View File

@@ -0,0 +1,37 @@
using Marechai.App.Presentation.ViewModels;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
namespace Marechai.App.Presentation.Views;
/// <summary>
/// Professional list view for displaying all graphics processing units.
/// Features responsive layout, modern styling, and special handling for Framebuffer and Software entries.
/// </summary>
public sealed partial class GpuListPage : Page
{
public GpuListPage()
{
InitializeComponent();
Loaded += GpuListPage_Loaded;
DataContextChanged += GpuListPage_DataContextChanged;
}
private void GpuListPage_DataContextChanged(FrameworkElement sender, DataContextChangedEventArgs args)
{
if(DataContext is GpusListViewModel vm)
{
// Load data when DataContext is set
vm.LoadData.Execute(null);
}
}
private void GpuListPage_Loaded(object sender, RoutedEventArgs e)
{
if(DataContext is GpusListViewModel vm)
{
// Load data when page is loaded (fallback)
vm.LoadData.Execute(null);
}
}
}

View File

@@ -5,6 +5,7 @@
x:Name="PageRoot"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:wctui="using:CommunityToolkit.WinUI.UI.Controls"
NavigationCacheMode="Disabled"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
@@ -372,6 +373,42 @@
</ItemsControl>
</StackPanel>
<!-- Photos Carousel (Last element before spacing) -->
<StackPanel Visibility="{Binding ShowPhotos}"
Spacing="12">
<TextBlock Text="Photos"
FontSize="14"
FontWeight="SemiBold"
Foreground="{ThemeResource TextControlForeground}" />
<wctui:Carousel ItemsSource="{Binding Photos}"
Height="280"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
BorderThickness="1"
CornerRadius="8"
HorizontalAlignment="Stretch">
<wctui:Carousel.ItemTemplate>
<DataTemplate>
<Button Command="{Binding DataContext.ViewPhotoDetailsCommand, ElementName=PageRoot}"
CommandParameter="{Binding PhotoId}"
Padding="0"
Background="Transparent">
<Grid Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<Image Source="{Binding ThumbnailImageSource}"
Stretch="Uniform"
HorizontalAlignment="Center"
VerticalAlignment="Center"
MaxWidth="256"
MaxHeight="256" />
</Grid>
</Button>
</DataTemplate>
</wctui:Carousel.ItemTemplate>
</wctui:Carousel>
</StackPanel>
<!-- Bottom Spacing -->
<Border Height="24" />

View File

@@ -0,0 +1,556 @@
<?xml version="1.0" encoding="utf-8"?>
<Page x:Class="Marechai.App.Presentation.Views.PhotoDetailPage"
x:Name="PageRoot"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:utu="using:Uno.Toolkit.UI"
NavigationCacheMode="Disabled"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid RowSpacing="0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<!-- Header with Back Button -->
<Grid Grid.Row="0"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
BorderThickness="0,0,0,1"
Padding="12,12,16,12">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Button Grid.Column="0"
Command="{Binding GoBackCommand}"
Style="{ThemeResource AlternateButtonStyle}"
ToolTipService.ToolTip="Go back"
Padding="8"
MinWidth="44"
MinHeight="44"
VerticalAlignment="Center">
<FontIcon Glyph="&#xE72B;" FontSize="16" />
</Button>
<StackPanel Grid.Column="1"
Margin="12,0,0,0"
VerticalAlignment="Center">
<TextBlock Text="Photo Details"
FontSize="20"
FontWeight="SemiBold"
TextTrimming="CharacterEllipsis" />
</StackPanel>
</Grid>
<!-- Main Content -->
<Grid Grid.Row="1">
<!-- Loading State -->
<StackPanel Visibility="{Binding IsLoading}"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Padding="32"
Spacing="16">
<ProgressRing IsActive="True"
IsIndeterminate="True"
Height="64"
Width="64" />
<TextBlock Text="Loading photo..."
FontSize="14"
TextAlignment="Center" />
</StackPanel>
<!-- Error State -->
<StackPanel Visibility="{Binding ErrorOccurred}"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Padding="24"
Spacing="16"
MaxWidth="400">
<InfoBar IsOpen="True"
Severity="Error"
Title="Unable to Load Photo"
Message="{Binding ErrorMessage}"
IsClosable="False" />
</StackPanel>
<!-- Responsive Layout -->
<utu:ResponsiveView Visibility="{Binding PhotoImageSource, Converter={StaticResource ObjectToVisibilityConverter}}">
<!-- Narrow Template -->
<utu:ResponsiveView.NarrowTemplate>
<DataTemplate>
<ScrollViewer VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Disabled">
<StackPanel Padding="16" Spacing="24">
<!-- Photo -->
<Border Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
BorderThickness="1"
CornerRadius="8"
Padding="8"
MaxHeight="400"
MinHeight="250">
<ScrollViewer HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto"
ZoomMode="Enabled"
MinZoomFactor="1.0"
MaxZoomFactor="5.0">
<Image Source="{Binding PhotoImageSource}"
Stretch="Uniform"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
</ScrollViewer>
</Border>
<!-- Metadata Sections -->
<StackPanel Spacing="16">
<!-- Machine -->
<StackPanel Spacing="12">
<TextBlock Text="Machine" FontSize="14" FontWeight="SemiBold" />
<StackPanel Spacing="4" Visibility="{Binding PhotoMachineName, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Name" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoMachineName}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoMachineCompany, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Company" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoMachineCompany}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
</StackPanel>
<!-- Camera -->
<StackPanel Spacing="12">
<TextBlock Text="Camera" FontSize="14" FontWeight="SemiBold" />
<StackPanel Spacing="4" Visibility="{Binding PhotoCameraManufacturer, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Manufacturer" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoCameraManufacturer}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoCameraModel, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Model" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoCameraModel}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoLensModel, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Lens" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoLensModel}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoSoftwareUsed, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Software" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoSoftwareUsed}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
</StackPanel>
<!-- Exposure Settings -->
<StackPanel Spacing="12">
<TextBlock Text="Exposure Settings" FontSize="14" FontWeight="SemiBold" />
<StackPanel Spacing="4" Visibility="{Binding PhotoAperture, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Aperture" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoAperture}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoExposureTime, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Exposure Time" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoExposureTime}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoExposureMode, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Exposure Mode" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoExposureMode}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoExposureProgram, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Exposure Program" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoExposureProgram}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoIsoRating, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="ISO Rating" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoIsoRating}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
</StackPanel>
<!-- Flash & Light -->
<StackPanel Spacing="12">
<TextBlock Text="Flash &amp; Light" FontSize="14" FontWeight="SemiBold" />
<StackPanel Spacing="4" Visibility="{Binding PhotoFlash, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Flash" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoFlash}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoLightSource, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Light Source" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoLightSource}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoMeteringMode, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Metering Mode" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoMeteringMode}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoWhiteBalance, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="White Balance" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoWhiteBalance}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
</StackPanel>
<!-- Focal Length -->
<StackPanel Spacing="12">
<TextBlock Text="Focal Length" FontSize="14" FontWeight="SemiBold" />
<StackPanel Spacing="4" Visibility="{Binding PhotoFocalLength, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Focal Length" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoFocalLength}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoFocalLengthEquivalent, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="35mm Equivalent" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoFocalLengthEquivalent}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoDigitalZoomRatio, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Digital Zoom" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoDigitalZoomRatio}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
</StackPanel>
<!-- Image Properties -->
<StackPanel Spacing="12">
<TextBlock Text="Image Properties" FontSize="14" FontWeight="SemiBold" />
<StackPanel Spacing="4" Visibility="{Binding PhotoColorSpace, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Color Space" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoColorSpace}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoContrast, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Contrast" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoContrast}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoSaturation, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Saturation" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoSaturation}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoSharpness, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Sharpness" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoSharpness}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoOrientation, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Orientation" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoOrientation}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoSceneCaptureType, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Scene Capture Type" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoSceneCaptureType}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
</StackPanel>
<!-- Resolution -->
<StackPanel Spacing="12">
<TextBlock Text="Resolution" FontSize="14" FontWeight="SemiBold" />
<StackPanel Spacing="4" Visibility="{Binding PhotoHorizontalResolution, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Horizontal Resolution" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoHorizontalResolution}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoVerticalResolution, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Vertical Resolution" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoVerticalResolution}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoResolutionUnit, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Resolution Unit" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoResolutionUnit}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
</StackPanel>
<!-- File & Metadata -->
<StackPanel Spacing="12">
<TextBlock Text="File &amp; Metadata" FontSize="14" FontWeight="SemiBold" />
<StackPanel Spacing="4" Visibility="{Binding PhotoOriginalExtension, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Original Format" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoOriginalExtension}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoCreationDate, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Date Taken" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoCreationDate}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoUploadDate, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Upload Date" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoUploadDate}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoExifVersion, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="EXIF Version" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoExifVersion}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoAuthor, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Author" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoAuthor}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoLicenseName, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="License" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoLicenseName}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoComments, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Comments" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoComments}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoSource, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Source" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoSource}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
</StackPanel>
<!-- Additional Sensors -->
<StackPanel Spacing="12">
<TextBlock Text="Advanced" FontSize="14" FontWeight="SemiBold" />
<StackPanel Spacing="4" Visibility="{Binding PhotoSensingMethod, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Sensing Method" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoSensingMethod}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoSubjectDistanceRange, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Subject Distance Range" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoSubjectDistanceRange}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
</StackPanel>
<Border Height="24" />
</StackPanel>
</StackPanel>
</ScrollViewer>
</DataTemplate>
</utu:ResponsiveView.NarrowTemplate>
<!-- Wide Template -->
<utu:ResponsiveView.WideTemplate>
<DataTemplate>
<Grid Padding="16" ColumnSpacing="24">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
<!-- Photo on left -->
<Border Grid.Column="0"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
BorderThickness="1"
CornerRadius="8"
Padding="8"
VerticalAlignment="Top"
MaxHeight="500">
<ScrollViewer HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto"
ZoomMode="Enabled"
MinZoomFactor="1.0"
MaxZoomFactor="5.0">
<Image Source="{Binding PhotoImageSource}"
Stretch="Uniform"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
</ScrollViewer>
</Border>
<!-- Info on right -->
<ScrollViewer Grid.Column="1"
VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Disabled">
<StackPanel Spacing="16" Padding="8">
<!-- Same content as narrow template -->
<!-- Machine -->
<StackPanel Spacing="12">
<TextBlock Text="Machine" FontSize="14" FontWeight="SemiBold" />
<StackPanel Spacing="4" Visibility="{Binding PhotoMachineName, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Name" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoMachineName}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoMachineCompany, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Company" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoMachineCompany}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
</StackPanel>
<!-- Camera -->
<StackPanel Spacing="12">
<TextBlock Text="Camera" FontSize="14" FontWeight="SemiBold" />
<StackPanel Spacing="4" Visibility="{Binding PhotoCameraManufacturer, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Manufacturer" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoCameraManufacturer}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoCameraModel, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Model" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoCameraModel}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoLensModel, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Lens" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoLensModel}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoSoftwareUsed, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Software" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoSoftwareUsed}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
</StackPanel>
<!-- Exposure Settings -->
<StackPanel Spacing="12">
<TextBlock Text="Exposure Settings" FontSize="14" FontWeight="SemiBold" />
<StackPanel Spacing="4" Visibility="{Binding PhotoAperture, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Aperture" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoAperture}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoExposureTime, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Exposure Time" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoExposureTime}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoExposureMode, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Exposure Mode" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoExposureMode}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoExposureProgram, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Exposure Program" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoExposureProgram}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoIsoRating, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="ISO Rating" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoIsoRating}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
</StackPanel>
<!-- Flash & Light -->
<StackPanel Spacing="12">
<TextBlock Text="Flash &amp; Light" FontSize="14" FontWeight="SemiBold" />
<StackPanel Spacing="4" Visibility="{Binding PhotoFlash, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Flash" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoFlash}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoLightSource, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Light Source" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoLightSource}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoMeteringMode, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Metering Mode" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoMeteringMode}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoWhiteBalance, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="White Balance" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoWhiteBalance}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
</StackPanel>
<!-- Focal Length -->
<StackPanel Spacing="12">
<TextBlock Text="Focal Length" FontSize="14" FontWeight="SemiBold" />
<StackPanel Spacing="4" Visibility="{Binding PhotoFocalLength, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Focal Length" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoFocalLength}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoFocalLengthEquivalent, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="35mm Equivalent" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoFocalLengthEquivalent}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoDigitalZoomRatio, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Digital Zoom" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoDigitalZoomRatio}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
</StackPanel>
<!-- Image Properties -->
<StackPanel Spacing="12">
<TextBlock Text="Image Properties" FontSize="14" FontWeight="SemiBold" />
<StackPanel Spacing="4" Visibility="{Binding PhotoColorSpace, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Color Space" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoColorSpace}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoContrast, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Contrast" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoContrast}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoSaturation, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Saturation" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoSaturation}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoSharpness, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Sharpness" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoSharpness}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoOrientation, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Orientation" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoOrientation}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoSceneCaptureType, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Scene Capture Type" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoSceneCaptureType}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
</StackPanel>
<!-- Resolution -->
<StackPanel Spacing="12">
<TextBlock Text="Resolution" FontSize="14" FontWeight="SemiBold" />
<StackPanel Spacing="4" Visibility="{Binding PhotoHorizontalResolution, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Horizontal Resolution" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoHorizontalResolution}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoVerticalResolution, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Vertical Resolution" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoVerticalResolution}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoResolutionUnit, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Resolution Unit" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoResolutionUnit}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
</StackPanel>
<!-- File & Metadata -->
<StackPanel Spacing="12">
<TextBlock Text="File &amp; Metadata" FontSize="14" FontWeight="SemiBold" />
<StackPanel Spacing="4" Visibility="{Binding PhotoOriginalExtension, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Original Format" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoOriginalExtension}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoCreationDate, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Date Taken" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoCreationDate}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoUploadDate, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Upload Date" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoUploadDate}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoExifVersion, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="EXIF Version" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoExifVersion}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoAuthor, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Author" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoAuthor}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoLicenseName, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="License" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoLicenseName}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoComments, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Comments" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoComments}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoSource, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Source" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoSource}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
</StackPanel>
<!-- Advanced -->
<StackPanel Spacing="12">
<TextBlock Text="Advanced" FontSize="14" FontWeight="SemiBold" />
<StackPanel Spacing="4" Visibility="{Binding PhotoSensingMethod, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Sensing Method" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoSensingMethod}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
<StackPanel Spacing="4" Visibility="{Binding PhotoSubjectDistanceRange, Converter={StaticResource StringToVisibilityConverter}}">
<TextBlock Text="Subject Distance Range" FontSize="12" FontWeight="SemiBold" Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding PhotoSubjectDistanceRange}" FontSize="13" TextWrapping="Wrap" />
</StackPanel>
</StackPanel>
<Border Height="24" />
</StackPanel>
</ScrollViewer>
</Grid>
</DataTemplate>
</utu:ResponsiveView.WideTemplate>
</utu:ResponsiveView>
</Grid>
</Grid>
</Page>

View File

@@ -0,0 +1,47 @@
using System;
using Marechai.App.Presentation.ViewModels;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Navigation;
namespace Marechai.App.Presentation.Views;
public sealed partial class PhotoDetailPage : Page
{
private Guid? _pendingPhotoId;
public PhotoDetailPage()
{
InitializeComponent();
DataContextChanged += PhotoDetailPage_DataContextChanged;
}
protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
Guid? photoId = null;
if(e.Parameter is PhotoDetailNavigationParameter param) photoId = param.PhotoId;
if(photoId.HasValue)
{
_pendingPhotoId = photoId;
if(DataContext is PhotoDetailViewModel viewModel)
_ = viewModel.LoadPhotoCommand.ExecuteAsync(photoId.Value);
}
}
private void PhotoDetailPage_DataContextChanged(FrameworkElement sender, DataContextChangedEventArgs args)
{
if(DataContext is PhotoDetailViewModel viewModel && _pendingPhotoId.HasValue)
_ = viewModel.LoadPhotoCommand.ExecuteAsync(_pendingPhotoId.Value);
}
protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
{
base.OnNavigatingFrom(e);
_pendingPhotoId = null;
}
}

View File

@@ -0,0 +1,366 @@
<?xml version="1.0" encoding="utf-8"?>
<Page x:Class="Marechai.App.Presentation.Views.ProcessorDetailPage"
x:Name="PageRoot"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:utu="using:Uno.Toolkit.UI"
NavigationCacheMode="Required"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid utu:SafeArea.Insets="VisibleBounds">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<!-- Header -->
<utu:NavigationBar Grid.Row="0"
Content="{Binding Path=Title}"
MainCommandMode="Action">
<utu:NavigationBar.MainCommand>
<AppBarButton Icon="Back"
Label="Back"
Command="{Binding GoBackCommand}"
AutomationProperties.Name="Go back" />
</utu:NavigationBar.MainCommand>
</utu:NavigationBar>
<!-- Content -->
<ScrollViewer Grid.Row="1">
<StackPanel Padding="16"
Spacing="16">
<!-- Loading State -->
<StackPanel Visibility="{Binding IsLoading}"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Padding="32"
Spacing="16">
<ProgressRing IsActive="True"
IsIndeterminate="True"
Height="48"
Width="48" />
<TextBlock Text="Loading..."
TextAlignment="Center"
FontSize="14" />
</StackPanel>
<!-- Error State -->
<StackPanel Visibility="{Binding HasError}"
Padding="16"
Background="{ThemeResource SystemErrorBackgroundColor}"
CornerRadius="8"
Spacing="8">
<TextBlock Text="Error"
FontWeight="Bold"
Foreground="{ThemeResource SystemErrorTextForegroundColor}" />
<TextBlock Text="{Binding ErrorMessage}"
Foreground="{ThemeResource SystemErrorTextForegroundColor}"
TextWrapping="Wrap" />
</StackPanel>
<!-- Processor Details -->
<StackPanel Visibility="{Binding IsDataLoaded}"
Spacing="16">
<!-- Processor Name -->
<TextBlock Text="{Binding Processor.Name}"
FontSize="28"
FontWeight="Bold"
TextWrapping="Wrap" />
<!-- Company/Manufacturer -->
<StackPanel Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="8"
Padding="12"
Spacing="8">
<TextBlock Text="Manufacturer"
FontSize="14"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding ManufacturerName}"
FontSize="14"
TextWrapping="Wrap" />
</StackPanel>
<!-- Model Code -->
<StackPanel Visibility="{Binding Processor.ModelCode, Converter={StaticResource StringToVisibilityConverter}}"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="8"
Padding="12"
Spacing="8">
<TextBlock Text="Model Code"
FontSize="14"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding Processor.ModelCode}"
FontSize="14"
TextWrapping="Wrap" />
</StackPanel>
<!-- Introduced Date -->
<StackPanel Visibility="{Binding Processor.Introduced, Converter={StaticResource ObjectToVisibilityConverter}}"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="8"
Padding="12"
Spacing="8">
<TextBlock Text="Introduced"
FontSize="14"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding Processor.Introduced}"
FontSize="14" />
</StackPanel>
<!-- Speed -->
<StackPanel Visibility="{Binding Processor.Speed, Converter={StaticResource ObjectToVisibilityConverter}}"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="8"
Padding="12"
Spacing="8">
<TextBlock Text="Speed (MHz)"
FontSize="14"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding Processor.Speed}"
FontSize="14"
TextWrapping="Wrap" />
</StackPanel>
<!-- Package -->
<StackPanel Visibility="{Binding Processor.Package, Converter={StaticResource StringToVisibilityConverter}}"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="8"
Padding="12"
Spacing="8">
<TextBlock Text="Package"
FontSize="14"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding Processor.Package}"
FontSize="14"
TextWrapping="Wrap" />
</StackPanel>
<!-- Cores -->
<StackPanel Visibility="{Binding Processor.Cores, Converter={StaticResource ObjectToVisibilityConverter}}"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="8"
Padding="12"
Spacing="8">
<TextBlock Text="Cores"
FontSize="14"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding Processor.Cores}"
FontSize="14"
TextWrapping="Wrap" />
</StackPanel>
<!-- Threads Per Core -->
<StackPanel Visibility="{Binding Processor.ThreadsPerCore, Converter={StaticResource ObjectToVisibilityConverter}}"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="8"
Padding="12"
Spacing="8">
<TextBlock Text="Threads Per Core"
FontSize="14"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding Processor.ThreadsPerCore}"
FontSize="14"
TextWrapping="Wrap" />
</StackPanel>
<!-- Process -->
<StackPanel Visibility="{Binding Processor.Process, Converter={StaticResource StringToVisibilityConverter}}"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="8"
Padding="12"
Spacing="8">
<TextBlock Text="Process"
FontSize="14"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding Processor.Process}"
FontSize="14"
TextWrapping="Wrap" />
</StackPanel>
<!-- Process (nm) -->
<StackPanel Visibility="{Binding Processor.ProcessNm, Converter={StaticResource StringToVisibilityConverter}}"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="8"
Padding="12"
Spacing="8">
<TextBlock Text="Process (nm)"
FontSize="14"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding Processor.ProcessNm}"
FontSize="14"
TextWrapping="Wrap" />
</StackPanel>
<!-- Die Size -->
<StackPanel Visibility="{Binding Processor.DieSize, Converter={StaticResource ObjectToVisibilityConverter}}"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="8"
Padding="12"
Spacing="8">
<TextBlock Text="Die Size (mm²)"
FontSize="14"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding Processor.DieSize}"
FontSize="14"
TextWrapping="Wrap" />
</StackPanel>
<!-- Transistors -->
<StackPanel Visibility="{Binding Processor.Transistors, Converter={StaticResource ObjectToVisibilityConverter}}"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="8"
Padding="12"
Spacing="8">
<TextBlock Text="Transistors"
FontSize="14"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding Processor.Transistors}"
FontSize="14"
TextWrapping="Wrap" />
</StackPanel>
<!-- Computers Section -->
<StackPanel Visibility="{Binding HasComputers}"
Spacing="8">
<StackPanel Orientation="Horizontal"
Spacing="8">
<TextBlock Text="Computers"
FontSize="14"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding Computers.Count}"
FontSize="14"
FontWeight="Bold"
Foreground="{ThemeResource SystemAccentColor}" />
</StackPanel>
<!-- Filter Box -->
<AutoSuggestBox PlaceholderText="Filter computers..."
Text="{Binding ComputersFilterText, Mode=TwoWay}"
TextChanged="ComputersSearchBox_TextChanged"
BorderThickness="1"
BorderBrush="{ThemeResource ControlElevationBorderBrush}" />
<!-- Scrollable Computers List -->
<ScrollViewer Height="200"
BorderThickness="1"
BorderBrush="{ThemeResource ControlElevationBorderBrush}"
CornerRadius="8">
<ItemsRepeater ItemsSource="{Binding FilteredComputers}"
Margin="0">
<ItemsRepeater.Layout>
<StackLayout Spacing="4" />
</ItemsRepeater.Layout>
<ItemsRepeater.ItemTemplate>
<DataTemplate>
<Button Click="Computer_Click"
Tag="{Binding Id}"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Left"
Padding="12"
Margin="0,4">
<StackPanel Spacing="4"
HorizontalAlignment="Left">
<TextBlock Text="{Binding Name}"
FontSize="14"
FontWeight="SemiBold" />
<StackPanel Orientation="Horizontal"
Spacing="8">
<TextBlock Text="{Binding Manufacturer}"
FontSize="12"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding YearDisplay}"
FontSize="12"
Foreground="{ThemeResource SystemBaseMediumColor}" />
</StackPanel>
</StackPanel>
</Button>
</DataTemplate>
</ItemsRepeater.ItemTemplate>
</ItemsRepeater>
</ScrollViewer>
</StackPanel>
<!-- Consoles Section -->
<StackPanel Visibility="{Binding HasConsoles}"
Spacing="8">
<StackPanel Orientation="Horizontal"
Spacing="8">
<TextBlock Text="Consoles"
FontSize="14"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding Consoles.Count}"
FontSize="14"
FontWeight="Bold"
Foreground="{ThemeResource SystemAccentColor}" />
</StackPanel>
<!-- Filter Box -->
<AutoSuggestBox PlaceholderText="Filter consoles..."
Text="{Binding ConsoelsFilterText, Mode=TwoWay}"
TextChanged="ConsolesSearchBox_TextChanged"
BorderThickness="1"
BorderBrush="{ThemeResource ControlElevationBorderBrush}" />
<!-- Scrollable Consoles List -->
<ScrollViewer Height="200"
BorderThickness="1"
BorderBrush="{ThemeResource ControlElevationBorderBrush}"
CornerRadius="8">
<ItemsRepeater ItemsSource="{Binding FilteredConsoles}"
Margin="0">
<ItemsRepeater.Layout>
<StackLayout Spacing="4" />
</ItemsRepeater.Layout>
<ItemsRepeater.ItemTemplate>
<DataTemplate>
<Button Click="Console_Click"
Tag="{Binding Id}"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Left"
Padding="12"
Margin="0,4">
<StackPanel Spacing="4"
HorizontalAlignment="Left">
<TextBlock Text="{Binding Name}"
FontSize="14"
FontWeight="SemiBold" />
<StackPanel Orientation="Horizontal"
Spacing="8">
<TextBlock Text="{Binding Manufacturer}"
FontSize="12"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding YearDisplay}"
FontSize="12"
Foreground="{ThemeResource SystemBaseMediumColor}" />
</StackPanel>
</StackPanel>
</Button>
</DataTemplate>
</ItemsRepeater.ItemTemplate>
</ItemsRepeater>
</ScrollViewer>
</StackPanel>
</StackPanel>
</StackPanel>
</ScrollViewer>
</Grid>
</Page>

View File

@@ -0,0 +1,98 @@
#nullable enable
using Marechai.App.Presentation.Models;
using Marechai.App.Presentation.ViewModels;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Navigation;
namespace Marechai.App.Presentation.Views;
/// <summary>
/// Processor detail page showing all information about a specific processor
/// </summary>
public sealed partial class ProcessorDetailPage : Page
{
private object? _navigationSource;
private int? _pendingProcessorId;
public ProcessorDetailPage()
{
InitializeComponent();
DataContextChanged += ProcessorDetailPage_DataContextChanged;
}
protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
int? processorId = null;
// Handle both int and ProcessorDetailNavigationParameter
if(e.Parameter is int intId)
processorId = intId;
else if(e.Parameter is ProcessorDetailNavigationParameter navParam)
{
processorId = navParam.ProcessorId;
_navigationSource = navParam.NavigationSource;
}
if(processorId.HasValue)
{
_pendingProcessorId = processorId;
if(DataContext is ProcessorDetailViewModel viewModel)
{
viewModel.ProcessorId = processorId.Value;
if(_navigationSource != null) viewModel.SetNavigationSource(_navigationSource);
_ = viewModel.LoadData.ExecuteAsync(null);
}
}
}
private void ProcessorDetailPage_DataContextChanged(FrameworkElement sender, DataContextChangedEventArgs args)
{
if(_pendingProcessorId.HasValue && DataContext is ProcessorDetailViewModel viewModel)
{
viewModel.ProcessorId = _pendingProcessorId.Value;
if(_navigationSource != null) viewModel.SetNavigationSource(_navigationSource);
_ = viewModel.LoadData.ExecuteAsync(null);
}
}
private void ComputersSearchBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
{
if(DataContext is ProcessorDetailViewModel vm) vm.ComputersFilterCommand.Execute(null);
}
private void ComputersSearchBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args)
{
if(args.Reason == AutoSuggestionBoxTextChangeReason.UserInput)
if(DataContext is ProcessorDetailViewModel vm)
vm.ComputersFilterCommand.Execute(null);
}
private void ConsolesSearchBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
{
if(DataContext is ProcessorDetailViewModel vm) vm.ConsolesFilterCommand.Execute(null);
}
private void ConsolesSearchBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args)
{
if(args.Reason == AutoSuggestionBoxTextChangeReason.UserInput)
if(DataContext is ProcessorDetailViewModel vm)
vm.ConsolesFilterCommand.Execute(null);
}
private void Computer_Click(object sender, RoutedEventArgs e)
{
if(sender is Button button && button.Tag is int machineId && DataContext is ProcessorDetailViewModel vm)
_ = vm.SelectMachineCommand.ExecuteAsync(machineId);
}
private void Console_Click(object sender, RoutedEventArgs e)
{
if(sender is Button button && button.Tag is int machineId && DataContext is ProcessorDetailViewModel vm)
_ = vm.SelectMachineCommand.ExecuteAsync(machineId);
}
}

View File

@@ -0,0 +1,207 @@
<?xml version="1.0"
encoding="utf-8"?>
<Page x:Class="Marechai.App.Presentation.Views.ProcessorListPage"
x:Name="PageRoot"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:utu="using:Uno.Toolkit.UI"
NavigationCacheMode="Required"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid utu:SafeArea.Insets="VisibleBounds">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="*" />
</Grid.RowDefinitions>
<!-- Header -->
<utu:NavigationBar Grid.Row="0"
Content="Processors">
</utu:NavigationBar>
<!-- Main Content -->
<Grid Grid.Row="1">
<!-- Loading State -->
<StackPanel Visibility="{Binding IsLoading}"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Padding="32"
Spacing="16">
<ProgressRing IsActive="True"
IsIndeterminate="True"
Height="64"
Width="64"
Foreground="{ThemeResource SystemAccentColor}" />
<TextBlock Text="Loading processors..."
FontSize="14"
TextAlignment="Center"
Foreground="{ThemeResource SystemBaseMediumColor}" />
</StackPanel>
<!-- Error State -->
<StackPanel Visibility="{Binding HasError}"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Padding="24"
Spacing="16"
MaxWidth="400">
<InfoBar IsOpen="True"
Severity="Error"
Title="Unable to Load Processors"
Message="{Binding ErrorMessage}"
IsClosable="False" />
<Button Content="Retry"
Command="{Binding LoadData}"
HorizontalAlignment="Center"
Style="{ThemeResource AccentButtonStyle}" />
</StackPanel>
<!-- Processors List -->
<Grid Visibility="{Binding IsDataLoaded}">
<ScrollViewer VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Disabled">
<Grid Padding="8">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="*" />
</Grid.RowDefinitions>
<!-- Count Header -->
<StackPanel Grid.Row="0"
Padding="16,12"
Orientation="Horizontal"
Spacing="4">
<TextBlock FontSize="12"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}"
Text="RESULTS:" />
<TextBlock FontSize="12"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}"
Text="{Binding ProcessorsList.Count}" />
<TextBlock FontSize="12"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}"
Text="processors" />
</StackPanel>
<!-- Processors List -->
<ItemsControl Grid.Row="1"
ItemsSource="{Binding ProcessorsList}"
Padding="0"
Margin="0,8,0,0"
HorizontalAlignment="Stretch">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical"
Spacing="0"
HorizontalAlignment="Stretch" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Button Padding="0"
Margin="0,0,0,8"
MinHeight="80"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
HorizontalAlignment="Stretch"
Command="{Binding DataContext.NavigateToProcessorCommand, ElementName=PageRoot}"
CommandParameter="{Binding}"
Background="Transparent"
BorderThickness="0">
<Button.Template>
<ControlTemplate TargetType="Button">
<Grid MinHeight="80"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<!-- Shadow effect -->
<Border x:Name="ShadowBorder"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
BorderThickness="1"
CornerRadius="8"
Padding="16,12"
Translation="0, 0, 4"
VerticalAlignment="Stretch">
<Border.Shadow>
<ThemeShadow />
</Border.Shadow>
<Grid ColumnSpacing="16">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!-- Processor Info -->
<StackPanel Grid.Column="0"
Spacing="8"
VerticalAlignment="Center"
HorizontalAlignment="Stretch">
<TextBlock Text="{Binding Name}"
FontSize="16"
FontWeight="SemiBold"
Foreground="{ThemeResource TextControlForeground}"
TextTrimming="CharacterEllipsis" />
<StackPanel Orientation="Horizontal"
Spacing="6"
VerticalAlignment="Center">
<FontIcon Glyph="&#xE731;"
FontSize="14"
Foreground="{ThemeResource SystemAccentColor}" />
<TextBlock Text="{Binding Company}"
FontSize="13"
Foreground="{ThemeResource SystemBaseMediumColor}"
TextTrimming="CharacterEllipsis" />
</StackPanel>
</StackPanel>
<!-- Navigation Arrow -->
<StackPanel Grid.Column="1"
VerticalAlignment="Center">
<FontIcon Glyph="&#xE72A;"
FontSize="18"
Foreground="{ThemeResource SystemAccentColor}" />
</StackPanel>
</Grid>
</Border>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Target="ShadowBorder.Background"
Value="{ThemeResource CardBackgroundFillColorSecondaryBrush}" />
<Setter Target="ShadowBorder.Translation"
Value="0, -2, 8" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Pressed">
<VisualState.Setters>
<Setter Target="ShadowBorder.Background"
Value="{ThemeResource CardBackgroundFillColorTertiaryBrush}" />
<Setter Target="ShadowBorder.Translation"
Value="0, 0, 2" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Grid>
</ControlTemplate>
</Button.Template>
</Button>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
</ScrollViewer>
</Grid>
</Grid>
</Grid>
</Page>

View File

@@ -0,0 +1,37 @@
using Marechai.App.Presentation.ViewModels;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
namespace Marechai.App.Presentation.Views;
/// <summary>
/// Professional list view for displaying all processors.
/// Features responsive layout and modern styling.
/// </summary>
public sealed partial class ProcessorListPage : Page
{
public ProcessorListPage()
{
InitializeComponent();
Loaded += ProcessorListPage_Loaded;
DataContextChanged += ProcessorListPage_DataContextChanged;
}
private void ProcessorListPage_DataContextChanged(FrameworkElement sender, DataContextChangedEventArgs args)
{
if(DataContext is ProcessorsListViewModel vm)
{
// Load data when DataContext is set
vm.LoadData.Execute(null);
}
}
private void ProcessorListPage_Loaded(object sender, RoutedEventArgs e)
{
if(DataContext is ProcessorsListViewModel vm)
{
// Load data when page is loaded (fallback)
vm.LoadData.Execute(null);
}
}
}

View File

@@ -0,0 +1,310 @@
<?xml version="1.0" encoding="utf-8"?>
<Page x:Class="Marechai.App.Presentation.Views.SoundSynthDetailPage"
x:Name="PageRoot"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:utu="using:Uno.Toolkit.UI"
xmlns:controls="using:CommunityToolkit.WinUI.UI.Controls"
NavigationCacheMode="Required"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Page.Resources>
</Page.Resources>
<Grid utu:SafeArea.Insets="VisibleBounds">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<!-- Header -->
<utu:NavigationBar Grid.Row="0"
Content="{Binding Path=Title}"
MainCommandMode="Action">
<utu:NavigationBar.MainCommand>
<AppBarButton Icon="Back"
Label="Back"
Command="{Binding GoBackCommand}"
AutomationProperties.Name="Go back" />
</utu:NavigationBar.MainCommand>
</utu:NavigationBar>
<!-- Content -->
<ScrollViewer Grid.Row="1">
<StackPanel Padding="16"
Spacing="16">
<!-- Loading State -->
<StackPanel Visibility="{Binding IsLoading}"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Padding="32"
Spacing="16">
<ProgressRing IsActive="True"
IsIndeterminate="True"
Height="48"
Width="48" />
<TextBlock Text="Loading..."
TextAlignment="Center"
FontSize="14" />
</StackPanel>
<!-- Error State -->
<StackPanel Visibility="{Binding HasError}"
Padding="16"
Background="{ThemeResource SystemErrorBackgroundColor}"
CornerRadius="8"
Spacing="8">
<TextBlock Text="Error"
FontWeight="Bold"
Foreground="{ThemeResource SystemErrorTextForegroundColor}" />
<TextBlock Text="{Binding ErrorMessage}"
Foreground="{ThemeResource SystemErrorTextForegroundColor}"
TextWrapping="Wrap" />
</StackPanel>
<!-- Sound Synthesizer Details -->
<StackPanel Visibility="{Binding IsDataLoaded}"
Spacing="16">
<!-- Sound Synthesizer Name -->
<TextBlock Text="{Binding SoundSynth.Name}"
FontSize="28"
FontWeight="Bold"
TextWrapping="Wrap" />
<!-- Company/Manufacturer -->
<StackPanel Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="8"
Padding="12"
Spacing="8">
<TextBlock Text="Manufacturer"
FontSize="14"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding ManufacturerName}"
FontSize="14"
TextWrapping="Wrap" />
</StackPanel>
<!-- Model Code -->
<StackPanel Visibility="{Binding SoundSynth.ModelCode, Converter={StaticResource StringToVisibilityConverter}}"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="8"
Padding="12"
Spacing="8">
<TextBlock Text="Model Code"
FontSize="14"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding SoundSynth.ModelCode}"
FontSize="14"
TextWrapping="Wrap" />
</StackPanel>
<!-- Introduced Date -->
<StackPanel Visibility="{Binding SoundSynth.Introduced, Converter={StaticResource ObjectToVisibilityConverter}}"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="8"
Padding="12"
Spacing="8">
<TextBlock Text="Introduced"
FontSize="14"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding SoundSynth.Introduced}"
FontSize="14" />
</StackPanel>
<!-- Voices -->
<StackPanel Visibility="{Binding SoundSynth.Voices, Converter={StaticResource ObjectToVisibilityConverter}}"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="8"
Padding="12"
Spacing="8">
<TextBlock Text="Voices"
FontSize="14"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding SoundSynth.Voices}"
FontSize="14"
TextWrapping="Wrap" />
</StackPanel>
<!-- Frequency -->
<StackPanel Visibility="{Binding SoundSynth.Frequency, Converter={StaticResource ObjectToVisibilityConverter}}"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="8"
Padding="12"
Spacing="8">
<TextBlock Text="Frequency (Hz)"
FontSize="14"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding SoundSynth.Frequency}"
FontSize="14"
TextWrapping="Wrap" />
</StackPanel>
<!-- Depth -->
<StackPanel Visibility="{Binding SoundSynth.Depth, Converter={StaticResource ObjectToVisibilityConverter}}"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="8"
Padding="12"
Spacing="8">
<TextBlock Text="Depth (bit)"
FontSize="14"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding SoundSynth.Depth}"
FontSize="14"
TextWrapping="Wrap" />
</StackPanel>
<!-- Type -->
<StackPanel Visibility="{Binding SoundSynth.Type, Converter={StaticResource StringToVisibilityConverter}}"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="8"
Padding="12"
Spacing="8">
<TextBlock Text="Type"
FontSize="14"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding SoundSynth.Type}"
FontSize="14"
TextWrapping="Wrap" />
</StackPanel>
<!-- Computers Section -->
<StackPanel Visibility="{Binding HasComputers}"
Spacing="8">
<StackPanel Orientation="Horizontal"
Spacing="8">
<TextBlock Text="Computers"
FontSize="14"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding Computers.Count}"
FontSize="14"
FontWeight="Bold"
Foreground="{ThemeResource SystemAccentColor}" />
</StackPanel>
<!-- Filter Box -->
<AutoSuggestBox PlaceholderText="Filter computers..."
Text="{Binding ComputersFilterText, Mode=TwoWay}"
TextChanged="ComputersSearchBox_TextChanged"
BorderThickness="1"
BorderBrush="{ThemeResource ControlElevationBorderBrush}" />
<!-- Scrollable Computers List -->
<ScrollViewer Height="200"
BorderThickness="1"
BorderBrush="{ThemeResource ControlElevationBorderBrush}"
CornerRadius="8">
<ItemsRepeater ItemsSource="{Binding FilteredComputers}"
Margin="0">
<ItemsRepeater.Layout>
<StackLayout Spacing="4" />
</ItemsRepeater.Layout>
<ItemsRepeater.ItemTemplate>
<DataTemplate>
<Button Click="Computer_Click"
Tag="{Binding Id}"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Left"
Padding="12"
Margin="0,4">
<StackPanel Spacing="4"
HorizontalAlignment="Left">
<TextBlock Text="{Binding Name}"
FontSize="14"
FontWeight="SemiBold" />
<StackPanel Orientation="Horizontal"
Spacing="8">
<TextBlock Text="{Binding Manufacturer}"
FontSize="12"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding YearDisplay}"
FontSize="12"
Foreground="{ThemeResource SystemBaseMediumColor}" />
</StackPanel>
</StackPanel>
</Button>
</DataTemplate>
</ItemsRepeater.ItemTemplate>
</ItemsRepeater>
</ScrollViewer>
</StackPanel>
<!-- Consoles Section -->
<StackPanel Visibility="{Binding HasConsoles}"
Spacing="8">
<StackPanel Orientation="Horizontal"
Spacing="8">
<TextBlock Text="Consoles"
FontSize="14"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding Consoles.Count}"
FontSize="14"
FontWeight="Bold"
Foreground="{ThemeResource SystemAccentColor}" />
</StackPanel>
<!-- Filter Box -->
<AutoSuggestBox PlaceholderText="Filter consoles..."
Text="{Binding ConsoelsFilterText, Mode=TwoWay}"
TextChanged="ConsolesSearchBox_TextChanged"
BorderThickness="1"
BorderBrush="{ThemeResource ControlElevationBorderBrush}" />
<!-- Scrollable Consoles List -->
<ScrollViewer Height="200"
BorderThickness="1"
BorderBrush="{ThemeResource ControlElevationBorderBrush}"
CornerRadius="8">
<ItemsRepeater ItemsSource="{Binding FilteredConsoles}"
Margin="0">
<ItemsRepeater.Layout>
<StackLayout Spacing="4" />
</ItemsRepeater.Layout>
<ItemsRepeater.ItemTemplate>
<DataTemplate>
<Button Click="Console_Click"
Tag="{Binding Id}"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Left"
Padding="12"
Margin="0,4">
<StackPanel Spacing="4"
HorizontalAlignment="Left">
<TextBlock Text="{Binding Name}"
FontSize="14"
FontWeight="SemiBold" />
<StackPanel Orientation="Horizontal"
Spacing="8">
<TextBlock Text="{Binding Manufacturer}"
FontSize="12"
Foreground="{ThemeResource SystemBaseMediumColor}" />
<TextBlock Text="{Binding YearDisplay}"
FontSize="12"
Foreground="{ThemeResource SystemBaseMediumColor}" />
</StackPanel>
</StackPanel>
</Button>
</DataTemplate>
</ItemsRepeater.ItemTemplate>
</ItemsRepeater>
</ScrollViewer>
</StackPanel>
</StackPanel>
</StackPanel>
</ScrollViewer>
</Grid>
</Page>

View File

@@ -0,0 +1,100 @@
#nullable enable
using Marechai.App.Presentation.Models;
using Marechai.App.Presentation.ViewModels;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Navigation;
namespace Marechai.App.Presentation.Views;
/// <summary>
/// Sound Synthesizer detail page showing all information, computers, and consoles
/// </summary>
public sealed partial class SoundSynthDetailPage : Page
{
private object? _navigationSource;
private int? _pendingSoundSynthId;
public SoundSynthDetailPage()
{
InitializeComponent();
DataContextChanged += SoundSynthDetailPage_DataContextChanged;
}
protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
int? soundSynthId = null;
// Handle both int and SoundSynthDetailNavigationParameter
if(e.Parameter is int intId)
soundSynthId = intId;
else if(e.Parameter is SoundSynthDetailNavigationParameter navParam)
{
soundSynthId = navParam.SoundSynthId;
_navigationSource = navParam.NavigationSource;
}
if(soundSynthId.HasValue)
{
_pendingSoundSynthId = soundSynthId;
if(DataContext is SoundSynthDetailViewModel viewModel)
{
viewModel.SoundSynthId = soundSynthId.Value;
if(_navigationSource != null) viewModel.SetNavigationSource(_navigationSource);
_ = viewModel.LoadData.ExecuteAsync(null);
}
}
}
private void SoundSynthDetailPage_DataContextChanged(FrameworkElement sender, DataContextChangedEventArgs args)
{
if(DataContext is SoundSynthDetailViewModel viewModel && _pendingSoundSynthId.HasValue)
{
viewModel.SoundSynthId = _pendingSoundSynthId.Value;
if(_navigationSource != null) viewModel.SetNavigationSource(_navigationSource);
_ = viewModel.LoadData.ExecuteAsync(null);
}
}
private void ComputersSearchBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
{
if(DataContext is SoundSynthDetailViewModel vm) vm.ComputersFilterCommand.Execute(null);
}
private void ComputersSearchBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args)
{
if(args.Reason == AutoSuggestionBoxTextChangeReason.UserInput)
{
if(DataContext is SoundSynthDetailViewModel vm) vm.ComputersFilterCommand.Execute(null);
}
}
private void ConsolesSearchBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
{
if(DataContext is SoundSynthDetailViewModel vm) vm.ConsolesFilterCommand.Execute(null);
}
private void ConsolesSearchBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args)
{
if(args.Reason == AutoSuggestionBoxTextChangeReason.UserInput)
{
if(DataContext is SoundSynthDetailViewModel vm) vm.ConsolesFilterCommand.Execute(null);
}
}
private void Computer_Click(object sender, RoutedEventArgs e)
{
if(sender is Button button && button.Tag is int machineId && DataContext is SoundSynthDetailViewModel vm)
_ = vm.SelectMachineCommand.ExecuteAsync(machineId);
}
private void Console_Click(object sender, RoutedEventArgs e)
{
if(sender is Button button && button.Tag is int machineId && DataContext is SoundSynthDetailViewModel vm)
_ = vm.SelectMachineCommand.ExecuteAsync(machineId);
}
}

View File

@@ -0,0 +1,207 @@
<?xml version="1.0"
encoding="utf-8"?>
<Page x:Class="Marechai.App.Presentation.Views.SoundSynthListPage"
x:Name="PageRoot"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:utu="using:Uno.Toolkit.UI"
NavigationCacheMode="Required"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid utu:SafeArea.Insets="VisibleBounds">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="*" />
</Grid.RowDefinitions>
<!-- Header -->
<utu:NavigationBar Grid.Row="0"
Content="Sound Synthesizers">
</utu:NavigationBar>
<!-- Main Content -->
<Grid Grid.Row="1">
<!-- Loading State -->
<StackPanel Visibility="{Binding IsLoading}"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Padding="32"
Spacing="16">
<ProgressRing IsActive="True"
IsIndeterminate="True"
Height="64"
Width="64"
Foreground="{ThemeResource SystemAccentColor}" />
<TextBlock Text="Loading sound synthesizers..."
FontSize="14"
TextAlignment="Center"
Foreground="{ThemeResource SystemBaseMediumColor}" />
</StackPanel>
<!-- Error State -->
<StackPanel Visibility="{Binding HasError}"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Padding="24"
Spacing="16"
MaxWidth="400">
<InfoBar IsOpen="True"
Severity="Error"
Title="Unable to Load Sound Synthesizers"
Message="{Binding ErrorMessage}"
IsClosable="False" />
<Button Content="Retry"
Command="{Binding LoadData}"
HorizontalAlignment="Center"
Style="{ThemeResource AccentButtonStyle}" />
</StackPanel>
<!-- Sound Synthesizers List -->
<Grid Visibility="{Binding IsDataLoaded}">
<ScrollViewer VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Disabled">
<Grid Padding="8">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="*" />
</Grid.RowDefinitions>
<!-- Count Header -->
<StackPanel Grid.Row="0"
Padding="16,12"
Orientation="Horizontal"
Spacing="4">
<TextBlock FontSize="12"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}"
Text="RESULTS:" />
<TextBlock FontSize="12"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}"
Text="{Binding SoundSynths.Count}" />
<TextBlock FontSize="12"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemBaseMediumColor}"
Text="sound synthesizers" />
</StackPanel>
<!-- Sound Synthesizers List -->
<ItemsControl Grid.Row="1"
ItemsSource="{Binding SoundSynths}"
Padding="0"
Margin="0,8,0,0"
HorizontalAlignment="Stretch">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical"
Spacing="0"
HorizontalAlignment="Stretch" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Button Padding="0"
Margin="0,0,0,8"
MinHeight="80"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
HorizontalAlignment="Stretch"
Command="{Binding DataContext.NavigateToSoundSynthCommand, ElementName=PageRoot}"
CommandParameter="{Binding}"
Background="Transparent"
BorderThickness="0">
<Button.Template>
<ControlTemplate TargetType="Button">
<Grid MinHeight="80"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<!-- Shadow effect -->
<Border x:Name="ShadowBorder"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
BorderThickness="1"
CornerRadius="8"
Padding="16,12"
Translation="0, 0, 4"
VerticalAlignment="Stretch">
<Border.Shadow>
<ThemeShadow />
</Border.Shadow>
<Grid ColumnSpacing="16">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!-- Sound Synth Info -->
<StackPanel Grid.Column="0"
Spacing="8"
VerticalAlignment="Center"
HorizontalAlignment="Stretch">
<TextBlock Text="{Binding Name}"
FontSize="16"
FontWeight="SemiBold"
Foreground="{ThemeResource TextControlForeground}"
TextTrimming="CharacterEllipsis" />
<StackPanel Orientation="Horizontal"
Spacing="6"
VerticalAlignment="Center">
<FontIcon Glyph="&#xE731;"
FontSize="14"
Foreground="{ThemeResource SystemAccentColor}" />
<TextBlock Text="{Binding Company}"
FontSize="13"
Foreground="{ThemeResource SystemBaseMediumColor}"
TextTrimming="CharacterEllipsis" />
</StackPanel>
</StackPanel>
<!-- Navigation Arrow -->
<StackPanel Grid.Column="1"
VerticalAlignment="Center">
<FontIcon Glyph="&#xE72A;"
FontSize="18"
Foreground="{ThemeResource SystemAccentColor}" />
</StackPanel>
</Grid>
</Border>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Target="ShadowBorder.Background"
Value="{ThemeResource CardBackgroundFillColorSecondaryBrush}" />
<Setter Target="ShadowBorder.Translation"
Value="0, -2, 8" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Pressed">
<VisualState.Setters>
<Setter Target="ShadowBorder.Background"
Value="{ThemeResource CardBackgroundFillColorTertiaryBrush}" />
<Setter Target="ShadowBorder.Translation"
Value="0, 0, 2" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Grid>
</ControlTemplate>
</Button.Template>
</Button>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
</ScrollViewer>
</Grid>
</Grid>
</Grid>
</Page>

View File

@@ -0,0 +1,33 @@
using Marechai.App.Presentation.ViewModels;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
namespace Marechai.App.Presentation.Views;
public sealed partial class SoundSynthListPage : Page
{
public SoundSynthListPage()
{
InitializeComponent();
Loaded += SoundSynthListPage_Loaded;
DataContextChanged += SoundSynthListPage_DataContextChanged;
}
private void SoundSynthListPage_DataContextChanged(FrameworkElement sender, DataContextChangedEventArgs args)
{
if(DataContext is SoundSynthsListViewModel vm)
{
// Load data when DataContext is set
vm.LoadData.Execute(null);
}
}
private void SoundSynthListPage_Loaded(object sender, RoutedEventArgs e)
{
if(DataContext is SoundSynthsListViewModel vm)
{
// Load data when page is loaded (fallback)
vm.LoadData.Execute(null);
}
}
}

View File

@@ -10,7 +10,7 @@ namespace Marechai.App.Services.Caching;
public sealed class CompanyLogoCache
{
readonly IConfiguration _configuration;
StorageFolder _flagsFolder;
StorageFolder _logosFolder;
public CompanyLogoCache(IConfiguration configuration)
{
@@ -21,32 +21,32 @@ public sealed class CompanyLogoCache
async Task EnsureFolderExistAsync()
{
StorageFolder localFolder = ApplicationData.Current.LocalCacheFolder;
_flagsFolder = await localFolder.CreateFolderAsync("logos", CreationCollisionOption.OpenIfExists);
_logosFolder = await localFolder.CreateFolderAsync("logos", CreationCollisionOption.OpenIfExists);
}
public async Task<Stream> GetFlagAsync(Guid companyLogoId)
public async Task<Stream> GetLogoAsync(Guid companyLogoId)
{
var filename = $"{companyLogoId}.svg";
Stream retStream;
if(await _flagsFolder.TryGetItemAsync(filename) is StorageFile file)
if(await _logosFolder.TryGetItemAsync(filename) is StorageFile file)
{
retStream = await file.OpenStreamForReadAsync();
return retStream;
}
await CacheFlagAsync(companyLogoId);
await CacheLogoAsync(companyLogoId);
file = await _flagsFolder.GetFileAsync(filename);
file = await _logosFolder.GetFileAsync(filename);
retStream = await file.OpenStreamForReadAsync();
return retStream;
}
async Task CacheFlagAsync(Guid companyLogoId)
async Task CacheLogoAsync(Guid companyLogoId)
{
var filename = $"{companyLogoId}.svg";
string baseUrl = _configuration.GetSection("ApiClient:Url").Value;
@@ -56,7 +56,7 @@ public sealed class CompanyLogoCache
response.EnsureSuccessStatusCode();
using Stream stream = await response.Content.ReadAsStreamAsync();
StorageFile file = await _flagsFolder.CreateFileAsync(filename, CreationCollisionOption.ReplaceExisting);
StorageFile file = await _logosFolder.CreateFileAsync(filename, CreationCollisionOption.ReplaceExisting);
using Stream fileStream = await file.OpenStreamForWriteAsync();
await stream.CopyToAsync(fileStream);

View File

@@ -0,0 +1,107 @@
using System;
using System.IO;
using System.Net.Http;
using System.Threading.Tasks;
using Windows.Storage;
using Microsoft.Extensions.Configuration;
namespace Marechai.App.Services.Caching;
public sealed class MachinePhotoCache
{
readonly IConfiguration _configuration;
StorageFolder _photosFolder;
StorageFolder _thumbnailsFolder;
public MachinePhotoCache(IConfiguration configuration)
{
_configuration = configuration;
_ = EnsureFolderExistAsync();
}
async Task EnsureFolderExistAsync()
{
StorageFolder localFolder = ApplicationData.Current.LocalCacheFolder;
_thumbnailsFolder =
await localFolder.CreateFolderAsync("machine_thumbnails", CreationCollisionOption.OpenIfExists);
_photosFolder = await localFolder.CreateFolderAsync("machine_photos", CreationCollisionOption.OpenIfExists);
}
public async Task<Stream> GetThumbnailAsync(Guid photoId)
{
var filename = $"{photoId}.webp";
Stream retStream;
if(await _thumbnailsFolder.TryGetItemAsync(filename) is StorageFile file)
{
retStream = await file.OpenStreamForReadAsync();
return retStream;
}
await CacheThumbnailAsync(photoId);
file = await _thumbnailsFolder.GetFileAsync(filename);
retStream = await file.OpenStreamForReadAsync();
return retStream;
}
public async Task<Stream> GetPhotoAsync(Guid photoId)
{
var filename = $"{photoId}.webp";
Stream retStream;
if(await _photosFolder.TryGetItemAsync(filename) is StorageFile file)
{
retStream = await file.OpenStreamForReadAsync();
return retStream;
}
await CachePhotoAsync(photoId);
file = await _photosFolder.GetFileAsync(filename);
retStream = await file.OpenStreamForReadAsync();
return retStream;
}
async Task CacheThumbnailAsync(Guid photoId)
{
var filename = $"{photoId}.webp";
string baseUrl = _configuration.GetSection("ApiClient:Url").Value;
string flagUrl = baseUrl + $"/assets/photos/machines/thumbs/webp/4k/{filename}";
using var httpClient = new HttpClient();
using HttpResponseMessage response = await httpClient.GetAsync(flagUrl);
response.EnsureSuccessStatusCode();
using Stream stream = await response.Content.ReadAsStreamAsync();
StorageFile file = await _thumbnailsFolder.CreateFileAsync(filename, CreationCollisionOption.ReplaceExisting);
using Stream fileStream = await file.OpenStreamForWriteAsync();
await stream.CopyToAsync(fileStream);
}
async Task CachePhotoAsync(Guid photoId)
{
var filename = $"{photoId}.webp";
string baseUrl = _configuration.GetSection("ApiClient:Url").Value;
string flagUrl = baseUrl + $"/assets/photos/machines/webp/4k/{filename}";
using var httpClient = new HttpClient();
using HttpResponseMessage response = await httpClient.GetAsync(flagUrl);
response.EnsureSuccessStatusCode();
using Stream stream = await response.Content.ReadAsStreamAsync();
StorageFile file = await _photosFolder.CreateFileAsync(filename, CreationCollisionOption.ReplaceExisting);
using Stream fileStream = await file.OpenStreamForWriteAsync();
await stream.CopyToAsync(fileStream);
}
}

View File

@@ -279,7 +279,7 @@ namespace Marechai.App
ApiClientBuilder.RegisterDefaultDeserializer<FormParseNodeFactory>();
if (string.IsNullOrEmpty(RequestAdapter.BaseUrl))
{
RequestAdapter.BaseUrl = "https://localhost:7163";
RequestAdapter.BaseUrl = "http://localhost:5023";
}
PathParameters.TryAdd("baseurl", RequestAdapter.BaseUrl);
}

View File

@@ -92,7 +92,7 @@ namespace Marechai.App.Books
var collectionResult = await RequestAdapter.SendCollectionAsync<global::Marechai.App.Models.BookDto>(requestInfo, global::Marechai.App.Models.BookDto.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return collectionResult?.AsList();
}
/// <returns>A <see cref="UntypedNode"/></returns>
/// <returns>A <see cref="long"/></returns>
/// <param name="body">The request body</param>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
@@ -100,11 +100,11 @@ namespace Marechai.App.Books
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 401 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<UntypedNode?> PostAsync(global::Marechai.App.Models.BookDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<long?> PostAsync(global::Marechai.App.Models.BookDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<UntypedNode> PostAsync(global::Marechai.App.Models.BookDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<long?> PostAsync(global::Marechai.App.Models.BookDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
@@ -114,7 +114,7 @@ namespace Marechai.App.Books
{ "400", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
{ "401", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<UntypedNode>(requestInfo, UntypedNode.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return await RequestAdapter.SendPrimitiveAsync<long?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>

View File

@@ -59,7 +59,7 @@ namespace Marechai.App.Books.Companies
public CompaniesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/books/companies", rawUrl)
{
}
/// <returns>A <see cref="UntypedNode"/></returns>
/// <returns>A <see cref="long"/></returns>
/// <param name="body">The request body</param>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
@@ -67,11 +67,11 @@ namespace Marechai.App.Books.Companies
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 401 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<UntypedNode?> PostAsync(global::Marechai.App.Models.CompanyByBookDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<long?> PostAsync(global::Marechai.App.Models.CompanyByBookDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<UntypedNode> PostAsync(global::Marechai.App.Models.CompanyByBookDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<long?> PostAsync(global::Marechai.App.Models.CompanyByBookDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
@@ -81,7 +81,7 @@ namespace Marechai.App.Books.Companies
{ "400", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
{ "401", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<UntypedNode>(requestInfo, UntypedNode.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return await RequestAdapter.SendPrimitiveAsync<long?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="body">The request body</param>

View File

@@ -92,7 +92,7 @@ namespace Marechai.App.Companies
var collectionResult = await RequestAdapter.SendCollectionAsync<global::Marechai.App.Models.CompanyDto>(requestInfo, global::Marechai.App.Models.CompanyDto.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return collectionResult?.AsList();
}
/// <returns>A <see cref="UntypedNode"/></returns>
/// <returns>A <see cref="int"/></returns>
/// <param name="body">The request body</param>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
@@ -100,11 +100,11 @@ namespace Marechai.App.Companies
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 401 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<UntypedNode?> PostAsync(global::Marechai.App.Models.CompanyDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<int?> PostAsync(global::Marechai.App.Models.CompanyDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<UntypedNode> PostAsync(global::Marechai.App.Models.CompanyDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<int?> PostAsync(global::Marechai.App.Models.CompanyDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
@@ -114,7 +114,7 @@ namespace Marechai.App.Companies
{ "400", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
{ "401", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<UntypedNode>(requestInfo, UntypedNode.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return await RequestAdapter.SendPrimitiveAsync<int?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>

View File

@@ -59,7 +59,7 @@ namespace Marechai.App.Companies.Item.Description
};
return await RequestAdapter.SendAsync<global::Marechai.App.Models.CompanyDescriptionDto>(requestInfo, global::Marechai.App.Models.CompanyDescriptionDto.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <returns>A <see cref="UntypedNode"/></returns>
/// <returns>A <see cref="int"/></returns>
/// <param name="body">The request body</param>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
@@ -67,11 +67,11 @@ namespace Marechai.App.Companies.Item.Description
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 401 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<UntypedNode?> PostAsync(global::Marechai.App.Models.CompanyDescriptionDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<int?> PostAsync(global::Marechai.App.Models.CompanyDescriptionDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<UntypedNode> PostAsync(global::Marechai.App.Models.CompanyDescriptionDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<int?> PostAsync(global::Marechai.App.Models.CompanyDescriptionDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
@@ -81,7 +81,7 @@ namespace Marechai.App.Companies.Item.Description
{ "400", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
{ "401", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<UntypedNode>(requestInfo, UntypedNode.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return await RequestAdapter.SendPrimitiveAsync<int?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>

View File

@@ -96,7 +96,7 @@ namespace Marechai.App.Companies.Logos.ChangeYear.Item
{
}
/// <summary>
/// Composed type wrapper for classes <see cref="global::Marechai.App.Companies.Logos.ChangeYear.Item.ChangeYearPutRequestBodyMember1"/>, <see cref="global::Marechai.App.Companies.Logos.ChangeYear.Item.ChangeYearPutRequestBodyMember2"/>
/// Composed type wrapper for classes <see cref="global::Marechai.App.Companies.Logos.ChangeYear.Item.ChangeYearPutRequestBodyMember1"/>, <see cref="int"/>
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
public partial class ChangeYearPutRequestBody : IComposedTypeWrapper, IParsable
@@ -109,14 +109,8 @@ namespace Marechai.App.Companies.Logos.ChangeYear.Item
#else
public global::Marechai.App.Companies.Logos.ChangeYear.Item.ChangeYearPutRequestBodyMember1 ChangeYearPutRequestBodyMember1 { get; set; }
#endif
/// <summary>Composed type representation for type <see cref="global::Marechai.App.Companies.Logos.ChangeYear.Item.ChangeYearPutRequestBodyMember2"/></summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public global::Marechai.App.Companies.Logos.ChangeYear.Item.ChangeYearPutRequestBodyMember2? ChangeYearPutRequestBodyMember2 { get; set; }
#nullable restore
#else
public global::Marechai.App.Companies.Logos.ChangeYear.Item.ChangeYearPutRequestBodyMember2 ChangeYearPutRequestBodyMember2 { get; set; }
#endif
/// <summary>Composed type representation for type <see cref="int"/></summary>
public int? Integer { get; set; }
/// <summary>
/// Creates a new instance of the appropriate class based on discriminator value
/// </summary>
@@ -131,9 +125,9 @@ namespace Marechai.App.Companies.Logos.ChangeYear.Item
{
result.ChangeYearPutRequestBodyMember1 = new global::Marechai.App.Companies.Logos.ChangeYear.Item.ChangeYearPutRequestBodyMember1();
}
else if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase))
else if(parseNode.GetIntValue() is int integerValue)
{
result.ChangeYearPutRequestBodyMember2 = new global::Marechai.App.Companies.Logos.ChangeYear.Item.ChangeYearPutRequestBodyMember2();
result.Integer = integerValue;
}
return result;
}
@@ -147,10 +141,6 @@ namespace Marechai.App.Companies.Logos.ChangeYear.Item
{
return ChangeYearPutRequestBodyMember1.GetFieldDeserializers();
}
else if(ChangeYearPutRequestBodyMember2 != null)
{
return ChangeYearPutRequestBodyMember2.GetFieldDeserializers();
}
return new Dictionary<string, Action<IParseNode>>();
}
/// <summary>
@@ -164,9 +154,9 @@ namespace Marechai.App.Companies.Logos.ChangeYear.Item
{
writer.WriteObjectValue<global::Marechai.App.Companies.Logos.ChangeYear.Item.ChangeYearPutRequestBodyMember1>(null, ChangeYearPutRequestBodyMember1);
}
else if(ChangeYearPutRequestBodyMember2 != null)
else if(Integer != null)
{
writer.WriteObjectValue<global::Marechai.App.Companies.Logos.ChangeYear.Item.ChangeYearPutRequestBodyMember2>(null, ChangeYearPutRequestBodyMember2);
writer.WriteIntValue(null, Integer);
}
}
}

View File

@@ -65,7 +65,7 @@ namespace Marechai.App.Companies.Logos
public LogosRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/companies/logos", rawUrl)
{
}
/// <returns>A <see cref="UntypedNode"/></returns>
/// <returns>A <see cref="int"/></returns>
/// <param name="body">The request body</param>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
@@ -73,11 +73,11 @@ namespace Marechai.App.Companies.Logos
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 401 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<UntypedNode?> PostAsync(global::Marechai.App.Models.CompanyLogoDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<int?> PostAsync(global::Marechai.App.Models.CompanyLogoDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<UntypedNode> PostAsync(global::Marechai.App.Models.CompanyLogoDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<int?> PostAsync(global::Marechai.App.Models.CompanyLogoDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
@@ -87,7 +87,7 @@ namespace Marechai.App.Companies.Logos
{ "400", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
{ "401", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<UntypedNode>(requestInfo, UntypedNode.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return await RequestAdapter.SendPrimitiveAsync<int?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="body">The request body</param>

View File

@@ -33,17 +33,17 @@ namespace Marechai.App.Computers.Count
public CountRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/computers/count", rawUrl)
{
}
/// <returns>A <see cref="UntypedNode"/></returns>
/// <returns>A <see cref="int"/></returns>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 400 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<UntypedNode?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<int?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<UntypedNode> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<int?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
var requestInfo = ToGetRequestInformation(requestConfiguration);
@@ -51,7 +51,7 @@ namespace Marechai.App.Computers.Count
{
{ "400", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<UntypedNode>(requestInfo, UntypedNode.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return await RequestAdapter.SendPrimitiveAsync<int?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>

View File

@@ -33,17 +33,17 @@ namespace Marechai.App.Computers.MaximumYear
public MaximumYearRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/computers/maximum-year", rawUrl)
{
}
/// <returns>A <see cref="UntypedNode"/></returns>
/// <returns>A <see cref="int"/></returns>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 400 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<UntypedNode?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<int?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<UntypedNode> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<int?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
var requestInfo = ToGetRequestInformation(requestConfiguration);
@@ -51,7 +51,7 @@ namespace Marechai.App.Computers.MaximumYear
{
{ "400", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<UntypedNode>(requestInfo, UntypedNode.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return await RequestAdapter.SendPrimitiveAsync<int?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>

View File

@@ -33,17 +33,17 @@ namespace Marechai.App.Computers.MinimumYear
public MinimumYearRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/computers/minimum-year", rawUrl)
{
}
/// <returns>A <see cref="UntypedNode"/></returns>
/// <returns>A <see cref="int"/></returns>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 400 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<UntypedNode?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<int?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<UntypedNode> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<int?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
var requestInfo = ToGetRequestInformation(requestConfiguration);
@@ -51,7 +51,7 @@ namespace Marechai.App.Computers.MinimumYear
{
{ "400", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<UntypedNode>(requestInfo, UntypedNode.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return await RequestAdapter.SendPrimitiveAsync<int?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>

View File

@@ -33,17 +33,17 @@ namespace Marechai.App.Consoles.Count
public CountRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/consoles/count", rawUrl)
{
}
/// <returns>A <see cref="UntypedNode"/></returns>
/// <returns>A <see cref="int"/></returns>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 400 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<UntypedNode?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<int?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<UntypedNode> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<int?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
var requestInfo = ToGetRequestInformation(requestConfiguration);
@@ -51,7 +51,7 @@ namespace Marechai.App.Consoles.Count
{
{ "400", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<UntypedNode>(requestInfo, UntypedNode.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return await RequestAdapter.SendPrimitiveAsync<int?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>

View File

@@ -33,17 +33,17 @@ namespace Marechai.App.Consoles.MaximumYear
public MaximumYearRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/consoles/maximum-year", rawUrl)
{
}
/// <returns>A <see cref="UntypedNode"/></returns>
/// <returns>A <see cref="int"/></returns>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 400 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<UntypedNode?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<int?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<UntypedNode> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<int?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
var requestInfo = ToGetRequestInformation(requestConfiguration);
@@ -51,7 +51,7 @@ namespace Marechai.App.Consoles.MaximumYear
{
{ "400", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<UntypedNode>(requestInfo, UntypedNode.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return await RequestAdapter.SendPrimitiveAsync<int?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>

View File

@@ -33,17 +33,17 @@ namespace Marechai.App.Consoles.MinimumYear
public MinimumYearRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/consoles/minimum-year", rawUrl)
{
}
/// <returns>A <see cref="UntypedNode"/></returns>
/// <returns>A <see cref="int"/></returns>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 400 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<UntypedNode?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<int?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<UntypedNode> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<int?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
var requestInfo = ToGetRequestInformation(requestConfiguration);
@@ -51,7 +51,7 @@ namespace Marechai.App.Consoles.MinimumYear
{
{ "400", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<UntypedNode>(requestInfo, UntypedNode.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return await RequestAdapter.SendPrimitiveAsync<int?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>

View File

@@ -80,7 +80,7 @@ namespace Marechai.App.Currencies.Inflation
var collectionResult = await RequestAdapter.SendCollectionAsync<global::Marechai.App.Models.CurrencyInflationDto>(requestInfo, global::Marechai.App.Models.CurrencyInflationDto.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return collectionResult?.AsList();
}
/// <returns>A <see cref="UntypedNode"/></returns>
/// <returns>A <see cref="int"/></returns>
/// <param name="body">The request body</param>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
@@ -88,11 +88,11 @@ namespace Marechai.App.Currencies.Inflation
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 401 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<UntypedNode?> PostAsync(global::Marechai.App.Models.CurrencyInflationDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<int?> PostAsync(global::Marechai.App.Models.CurrencyInflationDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<UntypedNode> PostAsync(global::Marechai.App.Models.CurrencyInflationDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<int?> PostAsync(global::Marechai.App.Models.CurrencyInflationDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
@@ -102,7 +102,7 @@ namespace Marechai.App.Currencies.Inflation
{ "400", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
{ "401", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<UntypedNode>(requestInfo, UntypedNode.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return await RequestAdapter.SendPrimitiveAsync<int?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>

View File

@@ -80,7 +80,7 @@ namespace Marechai.App.Currencies.Pegging
var collectionResult = await RequestAdapter.SendCollectionAsync<global::Marechai.App.Models.CurrencyPeggingDto>(requestInfo, global::Marechai.App.Models.CurrencyPeggingDto.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return collectionResult?.AsList();
}
/// <returns>A <see cref="UntypedNode"/></returns>
/// <returns>A <see cref="int"/></returns>
/// <param name="body">The request body</param>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
@@ -88,11 +88,11 @@ namespace Marechai.App.Currencies.Pegging
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 401 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<UntypedNode?> PostAsync(global::Marechai.App.Models.CurrencyPeggingDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<int?> PostAsync(global::Marechai.App.Models.CurrencyPeggingDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<UntypedNode> PostAsync(global::Marechai.App.Models.CurrencyPeggingDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<int?> PostAsync(global::Marechai.App.Models.CurrencyPeggingDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
@@ -102,7 +102,7 @@ namespace Marechai.App.Currencies.Pegging
{ "400", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
{ "401", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<UntypedNode>(requestInfo, UntypedNode.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return await RequestAdapter.SendPrimitiveAsync<int?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>

View File

@@ -80,7 +80,7 @@ namespace Marechai.App.Documents.Companies
var collectionResult = await RequestAdapter.SendCollectionAsync<global::Marechai.App.Models.DocumentCompanyDto>(requestInfo, global::Marechai.App.Models.DocumentCompanyDto.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return collectionResult?.AsList();
}
/// <returns>A <see cref="UntypedNode"/></returns>
/// <returns>A <see cref="long"/></returns>
/// <param name="body">The request body</param>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
@@ -88,11 +88,11 @@ namespace Marechai.App.Documents.Companies
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 401 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<UntypedNode?> PostAsync(global::Marechai.App.Models.DocumentCompanyDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<long?> PostAsync(global::Marechai.App.Models.DocumentCompanyDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<UntypedNode> PostAsync(global::Marechai.App.Models.DocumentCompanyDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<long?> PostAsync(global::Marechai.App.Models.DocumentCompanyDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
@@ -102,7 +102,7 @@ namespace Marechai.App.Documents.Companies
{ "400", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
{ "401", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<UntypedNode>(requestInfo, UntypedNode.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return await RequestAdapter.SendPrimitiveAsync<long?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>

View File

@@ -104,7 +104,7 @@ namespace Marechai.App.Documents
var collectionResult = await RequestAdapter.SendCollectionAsync<global::Marechai.App.Models.DocumentDto>(requestInfo, global::Marechai.App.Models.DocumentDto.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return collectionResult?.AsList();
}
/// <returns>A <see cref="UntypedNode"/></returns>
/// <returns>A <see cref="long"/></returns>
/// <param name="body">The request body</param>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
@@ -112,11 +112,11 @@ namespace Marechai.App.Documents
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 401 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<UntypedNode?> PostAsync(global::Marechai.App.Models.DocumentDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<long?> PostAsync(global::Marechai.App.Models.DocumentDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<UntypedNode> PostAsync(global::Marechai.App.Models.DocumentDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<long?> PostAsync(global::Marechai.App.Models.DocumentDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
@@ -126,7 +126,7 @@ namespace Marechai.App.Documents
{ "400", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
{ "401", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<UntypedNode>(requestInfo, UntypedNode.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return await RequestAdapter.SendPrimitiveAsync<long?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>

View File

@@ -80,7 +80,7 @@ namespace Marechai.App.Documents.People
var collectionResult = await RequestAdapter.SendCollectionAsync<global::Marechai.App.Models.DocumentPersonDto>(requestInfo, global::Marechai.App.Models.DocumentPersonDto.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return collectionResult?.AsList();
}
/// <returns>A <see cref="UntypedNode"/></returns>
/// <returns>A <see cref="long"/></returns>
/// <param name="body">The request body</param>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
@@ -88,11 +88,11 @@ namespace Marechai.App.Documents.People
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 401 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<UntypedNode?> PostAsync(global::Marechai.App.Models.DocumentPersonDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<long?> PostAsync(global::Marechai.App.Models.DocumentPersonDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<UntypedNode> PostAsync(global::Marechai.App.Models.DocumentPersonDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<long?> PostAsync(global::Marechai.App.Models.DocumentPersonDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
@@ -102,7 +102,7 @@ namespace Marechai.App.Documents.People
{ "400", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
{ "401", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<UntypedNode>(requestInfo, UntypedNode.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return await RequestAdapter.SendPrimitiveAsync<long?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>

View File

@@ -21,7 +21,7 @@ namespace Marechai.App.Dumps
/// <summary>Gets an item from the Marechai.App.dumps.item collection</summary>
/// <param name="position">Unique identifier of the item</param>
/// <returns>A <see cref="global::Marechai.App.Dumps.Item.DumpsItemRequestBuilder"/></returns>
public global::Marechai.App.Dumps.Item.DumpsItemRequestBuilder this[string position]
public global::Marechai.App.Dumps.Item.DumpsItemRequestBuilder this[int position]
{
get
{
@@ -30,6 +30,19 @@ namespace Marechai.App.Dumps
return new global::Marechai.App.Dumps.Item.DumpsItemRequestBuilder(urlTplParams, RequestAdapter);
}
}
/// <summary>Gets an item from the Marechai.App.dumps.item collection</summary>
/// <param name="position">Unique identifier of the item</param>
/// <returns>A <see cref="global::Marechai.App.Dumps.Item.DumpsItemRequestBuilder"/></returns>
[Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")]
public global::Marechai.App.Dumps.Item.DumpsItemRequestBuilder this[string position]
{
get
{
var urlTplParams = new Dictionary<string, object>(PathParameters);
if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("id", position);
return new global::Marechai.App.Dumps.Item.DumpsItemRequestBuilder(urlTplParams, RequestAdapter);
}
}
/// <summary>
/// Instantiates a new <see cref="global::Marechai.App.Dumps.DumpsRequestBuilder"/> and sets the default values.
/// </summary>
@@ -67,7 +80,7 @@ namespace Marechai.App.Dumps
var collectionResult = await RequestAdapter.SendCollectionAsync<global::Marechai.App.Models.DumpDto>(requestInfo, global::Marechai.App.Models.DumpDto.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return collectionResult?.AsList();
}
/// <returns>A <see cref="UntypedNode"/></returns>
/// <returns>A <see cref="int"/></returns>
/// <param name="body">The request body</param>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
@@ -75,11 +88,11 @@ namespace Marechai.App.Dumps
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 401 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<UntypedNode?> PostAsync(global::Marechai.App.Models.DumpDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<int?> PostAsync(global::Marechai.App.Models.DumpDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<UntypedNode> PostAsync(global::Marechai.App.Models.DumpDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<int?> PostAsync(global::Marechai.App.Models.DumpDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
@@ -89,7 +102,7 @@ namespace Marechai.App.Dumps
{ "400", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
{ "401", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<UntypedNode>(requestInfo, UntypedNode.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return await RequestAdapter.SendPrimitiveAsync<int?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>

View File

@@ -20,27 +20,27 @@ namespace Marechai.App.Gpus
{
/// <summary>Gets an item from the Marechai.App.gpus.item collection</summary>
/// <param name="position">Unique identifier of the item</param>
/// <returns>A <see cref="global::Marechai.App.Gpus.Item.GpusItemRequestBuilder"/></returns>
public global::Marechai.App.Gpus.Item.GpusItemRequestBuilder this[int position]
/// <returns>A <see cref="global::Marechai.App.Gpus.Item.GpuItemRequestBuilder"/></returns>
public global::Marechai.App.Gpus.Item.GpuItemRequestBuilder this[int position]
{
get
{
var urlTplParams = new Dictionary<string, object>(PathParameters);
urlTplParams.Add("id", position);
return new global::Marechai.App.Gpus.Item.GpusItemRequestBuilder(urlTplParams, RequestAdapter);
urlTplParams.Add("gpu%2Did", position);
return new global::Marechai.App.Gpus.Item.GpuItemRequestBuilder(urlTplParams, RequestAdapter);
}
}
/// <summary>Gets an item from the Marechai.App.gpus.item collection</summary>
/// <param name="position">Unique identifier of the item</param>
/// <returns>A <see cref="global::Marechai.App.Gpus.Item.GpusItemRequestBuilder"/></returns>
/// <returns>A <see cref="global::Marechai.App.Gpus.Item.GpuItemRequestBuilder"/></returns>
[Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")]
public global::Marechai.App.Gpus.Item.GpusItemRequestBuilder this[string position]
public global::Marechai.App.Gpus.Item.GpuItemRequestBuilder this[string position]
{
get
{
var urlTplParams = new Dictionary<string, object>(PathParameters);
if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("id", position);
return new global::Marechai.App.Gpus.Item.GpusItemRequestBuilder(urlTplParams, RequestAdapter);
if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("gpu%2Did", position);
return new global::Marechai.App.Gpus.Item.GpuItemRequestBuilder(urlTplParams, RequestAdapter);
}
}
/// <summary>
@@ -80,7 +80,7 @@ namespace Marechai.App.Gpus
var collectionResult = await RequestAdapter.SendCollectionAsync<global::Marechai.App.Models.GpuDto>(requestInfo, global::Marechai.App.Models.GpuDto.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return collectionResult?.AsList();
}
/// <returns>A <see cref="UntypedNode"/></returns>
/// <returns>A <see cref="long"/></returns>
/// <param name="body">The request body</param>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
@@ -88,11 +88,11 @@ namespace Marechai.App.Gpus
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 401 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<UntypedNode?> PostAsync(global::Marechai.App.Models.GpuDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<long?> PostAsync(global::Marechai.App.Models.GpuDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<UntypedNode> PostAsync(global::Marechai.App.Models.GpuDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<long?> PostAsync(global::Marechai.App.Models.GpuDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
@@ -102,7 +102,7 @@ namespace Marechai.App.Gpus
{ "400", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
{ "401", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<UntypedNode>(requestInfo, UntypedNode.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return await RequestAdapter.SendPrimitiveAsync<long?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>

View File

@@ -86,7 +86,7 @@ namespace Marechai.App.InstructionSetExtensions
var collectionResult = await RequestAdapter.SendCollectionAsync<global::Marechai.App.Models.InstructionSetExtensionDto>(requestInfo, global::Marechai.App.Models.InstructionSetExtensionDto.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return collectionResult?.AsList();
}
/// <returns>A <see cref="UntypedNode"/></returns>
/// <returns>A <see cref="int"/></returns>
/// <param name="body">The request body</param>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
@@ -94,11 +94,11 @@ namespace Marechai.App.InstructionSetExtensions
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 401 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<UntypedNode?> PostAsync(global::Marechai.App.Models.InstructionSetExtensionDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<int?> PostAsync(global::Marechai.App.Models.InstructionSetExtensionDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<UntypedNode> PostAsync(global::Marechai.App.Models.InstructionSetExtensionDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<int?> PostAsync(global::Marechai.App.Models.InstructionSetExtensionDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
@@ -108,7 +108,7 @@ namespace Marechai.App.InstructionSetExtensions
{ "400", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
{ "401", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<UntypedNode>(requestInfo, UntypedNode.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return await RequestAdapter.SendPrimitiveAsync<int?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>

View File

@@ -59,7 +59,7 @@ namespace Marechai.App.InstructionSetExtensionsByProcessor
public InstructionSetExtensionsByProcessorRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/instruction-set-extensions-by-processor", rawUrl)
{
}
/// <returns>A <see cref="UntypedNode"/></returns>
/// <returns>A <see cref="long"/></returns>
/// <param name="body">The request body</param>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
@@ -67,11 +67,11 @@ namespace Marechai.App.InstructionSetExtensionsByProcessor
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 401 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<UntypedNode?> PostAsync(global::Marechai.App.Models.InstructionSetExtensionByProcessorDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<long?> PostAsync(global::Marechai.App.Models.InstructionSetExtensionByProcessorDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<UntypedNode> PostAsync(global::Marechai.App.Models.InstructionSetExtensionByProcessorDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<long?> PostAsync(global::Marechai.App.Models.InstructionSetExtensionByProcessorDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
@@ -81,7 +81,7 @@ namespace Marechai.App.InstructionSetExtensionsByProcessor
{ "400", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
{ "401", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<UntypedNode>(requestInfo, UntypedNode.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return await RequestAdapter.SendPrimitiveAsync<long?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="body">The request body</param>

View File

@@ -86,7 +86,7 @@ namespace Marechai.App.InstructionSets
var collectionResult = await RequestAdapter.SendCollectionAsync<global::Marechai.App.Models.InstructionSetDto>(requestInfo, global::Marechai.App.Models.InstructionSetDto.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return collectionResult?.AsList();
}
/// <returns>A <see cref="UntypedNode"/></returns>
/// <returns>A <see cref="int"/></returns>
/// <param name="body">The request body</param>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
@@ -94,11 +94,11 @@ namespace Marechai.App.InstructionSets
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 401 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<UntypedNode?> PostAsync(global::Marechai.App.Models.InstructionSetDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<int?> PostAsync(global::Marechai.App.Models.InstructionSetDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<UntypedNode> PostAsync(global::Marechai.App.Models.InstructionSetDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<int?> PostAsync(global::Marechai.App.Models.InstructionSetDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
@@ -108,7 +108,7 @@ namespace Marechai.App.InstructionSets
{ "400", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
{ "401", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<UntypedNode>(requestInfo, UntypedNode.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return await RequestAdapter.SendPrimitiveAsync<int?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>

View File

@@ -80,7 +80,7 @@ namespace Marechai.App.Licenses
var collectionResult = await RequestAdapter.SendCollectionAsync<global::Marechai.App.Models.LicenseDto>(requestInfo, global::Marechai.App.Models.LicenseDto.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return collectionResult?.AsList();
}
/// <returns>A <see cref="UntypedNode"/></returns>
/// <returns>A <see cref="int"/></returns>
/// <param name="body">The request body</param>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
@@ -88,11 +88,11 @@ namespace Marechai.App.Licenses
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 401 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<UntypedNode?> PostAsync(global::Marechai.App.Models.LicenseDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<int?> PostAsync(global::Marechai.App.Models.LicenseDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<UntypedNode> PostAsync(global::Marechai.App.Models.LicenseDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<int?> PostAsync(global::Marechai.App.Models.LicenseDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
@@ -102,7 +102,7 @@ namespace Marechai.App.Licenses
{ "400", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
{ "401", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<UntypedNode>(requestInfo, UntypedNode.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return await RequestAdapter.SendPrimitiveAsync<int?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>

View File

@@ -59,7 +59,7 @@ namespace Marechai.App.MachineFamilies.Books
public BooksRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/machine-families/books", rawUrl)
{
}
/// <returns>A <see cref="UntypedNode"/></returns>
/// <returns>A <see cref="int"/></returns>
/// <param name="body">The request body</param>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
@@ -67,11 +67,11 @@ namespace Marechai.App.MachineFamilies.Books
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 401 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<UntypedNode?> PostAsync(global::Marechai.App.Models.BookByMachineFamilyDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<int?> PostAsync(global::Marechai.App.Models.BookByMachineFamilyDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<UntypedNode> PostAsync(global::Marechai.App.Models.BookByMachineFamilyDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<int?> PostAsync(global::Marechai.App.Models.BookByMachineFamilyDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
@@ -81,7 +81,7 @@ namespace Marechai.App.MachineFamilies.Books
{ "400", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
{ "401", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<UntypedNode>(requestInfo, UntypedNode.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return await RequestAdapter.SendPrimitiveAsync<int?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="body">The request body</param>

View File

@@ -59,7 +59,7 @@ namespace Marechai.App.MachineFamilies.Documents
public DocumentsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/machine-families/documents", rawUrl)
{
}
/// <returns>A <see cref="UntypedNode"/></returns>
/// <returns>A <see cref="long"/></returns>
/// <param name="body">The request body</param>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
@@ -67,11 +67,11 @@ namespace Marechai.App.MachineFamilies.Documents
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 401 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<UntypedNode?> PostAsync(global::Marechai.App.Models.DocumentByMachineFamilyDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<long?> PostAsync(global::Marechai.App.Models.DocumentByMachineFamilyDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<UntypedNode> PostAsync(global::Marechai.App.Models.DocumentByMachineFamilyDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<long?> PostAsync(global::Marechai.App.Models.DocumentByMachineFamilyDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
@@ -81,7 +81,7 @@ namespace Marechai.App.MachineFamilies.Documents
{ "400", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
{ "401", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<UntypedNode>(requestInfo, UntypedNode.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return await RequestAdapter.SendPrimitiveAsync<long?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="body">The request body</param>

View File

@@ -92,7 +92,7 @@ namespace Marechai.App.MachineFamilies
var collectionResult = await RequestAdapter.SendCollectionAsync<global::Marechai.App.Models.MachineFamilyDto>(requestInfo, global::Marechai.App.Models.MachineFamilyDto.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return collectionResult?.AsList();
}
/// <returns>A <see cref="UntypedNode"/></returns>
/// <returns>A <see cref="long"/></returns>
/// <param name="body">The request body</param>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
@@ -100,11 +100,11 @@ namespace Marechai.App.MachineFamilies
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 401 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<UntypedNode?> PostAsync(global::Marechai.App.Models.MachineFamilyDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<long?> PostAsync(global::Marechai.App.Models.MachineFamilyDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<UntypedNode> PostAsync(global::Marechai.App.Models.MachineFamilyDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<long?> PostAsync(global::Marechai.App.Models.MachineFamilyDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
@@ -114,7 +114,7 @@ namespace Marechai.App.MachineFamilies
{ "400", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
{ "401", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<UntypedNode>(requestInfo, UntypedNode.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return await RequestAdapter.SendPrimitiveAsync<long?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>

View File

@@ -59,7 +59,7 @@ namespace Marechai.App.Machines.Books
public BooksRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/machines/books", rawUrl)
{
}
/// <returns>A <see cref="UntypedNode"/></returns>
/// <returns>A <see cref="int"/></returns>
/// <param name="body">The request body</param>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
@@ -67,11 +67,11 @@ namespace Marechai.App.Machines.Books
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 401 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<UntypedNode?> PostAsync(global::Marechai.App.Models.BookByMachineDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<int?> PostAsync(global::Marechai.App.Models.BookByMachineDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<UntypedNode> PostAsync(global::Marechai.App.Models.BookByMachineDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<int?> PostAsync(global::Marechai.App.Models.BookByMachineDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
@@ -81,7 +81,7 @@ namespace Marechai.App.Machines.Books
{ "400", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
{ "401", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<UntypedNode>(requestInfo, UntypedNode.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return await RequestAdapter.SendPrimitiveAsync<int?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="body">The request body</param>

View File

@@ -59,7 +59,7 @@ namespace Marechai.App.Machines.Documents
public DocumentsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/machines/documents", rawUrl)
{
}
/// <returns>A <see cref="UntypedNode"/></returns>
/// <returns>A <see cref="long"/></returns>
/// <param name="body">The request body</param>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
@@ -67,11 +67,11 @@ namespace Marechai.App.Machines.Documents
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 401 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<UntypedNode?> PostAsync(global::Marechai.App.Models.DocumentByMachineDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<long?> PostAsync(global::Marechai.App.Models.DocumentByMachineDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<UntypedNode> PostAsync(global::Marechai.App.Models.DocumentByMachineDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<long?> PostAsync(global::Marechai.App.Models.DocumentByMachineDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
@@ -81,7 +81,7 @@ namespace Marechai.App.Machines.Documents
{ "400", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
{ "401", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<UntypedNode>(requestInfo, UntypedNode.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return await RequestAdapter.SendPrimitiveAsync<long?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="body">The request body</param>

View File

@@ -65,7 +65,7 @@ namespace Marechai.App.Machines.Gpus
public GpusRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/machines/gpus", rawUrl)
{
}
/// <returns>A <see cref="UntypedNode"/></returns>
/// <returns>A <see cref="long"/></returns>
/// <param name="body">The request body</param>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
@@ -73,11 +73,11 @@ namespace Marechai.App.Machines.Gpus
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 401 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<UntypedNode?> PostAsync(global::Marechai.App.Models.GpuByMachineDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<long?> PostAsync(global::Marechai.App.Models.GpuByMachineDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<UntypedNode> PostAsync(global::Marechai.App.Models.GpuByMachineDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<long?> PostAsync(global::Marechai.App.Models.GpuByMachineDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
@@ -87,7 +87,7 @@ namespace Marechai.App.Machines.Gpus
{ "400", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
{ "401", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<UntypedNode>(requestInfo, UntypedNode.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return await RequestAdapter.SendPrimitiveAsync<long?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="body">The request body</param>

View File

@@ -104,7 +104,7 @@ namespace Marechai.App.Machines
var collectionResult = await RequestAdapter.SendCollectionAsync<global::Marechai.App.Models.MachineDto>(requestInfo, global::Marechai.App.Models.MachineDto.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return collectionResult?.AsList();
}
/// <returns>A <see cref="UntypedNode"/></returns>
/// <returns>A <see cref="long"/></returns>
/// <param name="body">The request body</param>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
@@ -112,11 +112,11 @@ namespace Marechai.App.Machines
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 401 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<UntypedNode?> PostAsync(global::Marechai.App.Models.MachineDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<long?> PostAsync(global::Marechai.App.Models.MachineDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<UntypedNode> PostAsync(global::Marechai.App.Models.MachineDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<long?> PostAsync(global::Marechai.App.Models.MachineDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
@@ -126,7 +126,7 @@ namespace Marechai.App.Machines
{ "400", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
{ "401", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<UntypedNode>(requestInfo, UntypedNode.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return await RequestAdapter.SendPrimitiveAsync<long?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>

View File

@@ -59,7 +59,7 @@ namespace Marechai.App.Magazines.Companies
public CompaniesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/magazines/companies", rawUrl)
{
}
/// <returns>A <see cref="UntypedNode"/></returns>
/// <returns>A <see cref="long"/></returns>
/// <param name="body">The request body</param>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
@@ -67,11 +67,11 @@ namespace Marechai.App.Magazines.Companies
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 401 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<UntypedNode?> PostAsync(global::Marechai.App.Models.CompanyByMagazineDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<long?> PostAsync(global::Marechai.App.Models.CompanyByMagazineDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<UntypedNode> PostAsync(global::Marechai.App.Models.CompanyByMagazineDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<long?> PostAsync(global::Marechai.App.Models.CompanyByMagazineDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
@@ -81,7 +81,7 @@ namespace Marechai.App.Magazines.Companies
{ "400", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
{ "401", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<UntypedNode>(requestInfo, UntypedNode.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return await RequestAdapter.SendPrimitiveAsync<long?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="body">The request body</param>

View File

@@ -80,7 +80,7 @@ namespace Marechai.App.Magazines.Issues
var collectionResult = await RequestAdapter.SendCollectionAsync<global::Marechai.App.Models.MagazineIssueDto>(requestInfo, global::Marechai.App.Models.MagazineIssueDto.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return collectionResult?.AsList();
}
/// <returns>A <see cref="UntypedNode"/></returns>
/// <returns>A <see cref="long"/></returns>
/// <param name="body">The request body</param>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
@@ -88,11 +88,11 @@ namespace Marechai.App.Magazines.Issues
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 401 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<UntypedNode?> PostAsync(global::Marechai.App.Models.MagazineIssueDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<long?> PostAsync(global::Marechai.App.Models.MagazineIssueDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<UntypedNode> PostAsync(global::Marechai.App.Models.MagazineIssueDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<long?> PostAsync(global::Marechai.App.Models.MagazineIssueDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
@@ -102,7 +102,7 @@ namespace Marechai.App.Magazines.Issues
{ "400", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
{ "401", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<UntypedNode>(requestInfo, UntypedNode.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return await RequestAdapter.SendPrimitiveAsync<long?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>

View File

@@ -104,7 +104,7 @@ namespace Marechai.App.Magazines
var collectionResult = await RequestAdapter.SendCollectionAsync<global::Marechai.App.Models.MagazineDto>(requestInfo, global::Marechai.App.Models.MagazineDto.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return collectionResult?.AsList();
}
/// <returns>A <see cref="UntypedNode"/></returns>
/// <returns>A <see cref="long"/></returns>
/// <param name="body">The request body</param>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
@@ -112,11 +112,11 @@ namespace Marechai.App.Magazines
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 401 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<UntypedNode?> PostAsync(global::Marechai.App.Models.MagazineDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<long?> PostAsync(global::Marechai.App.Models.MagazineDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<UntypedNode> PostAsync(global::Marechai.App.Models.MagazineDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<long?> PostAsync(global::Marechai.App.Models.MagazineDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
@@ -126,7 +126,7 @@ namespace Marechai.App.Magazines
{ "400", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
{ "401", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<UntypedNode>(requestInfo, UntypedNode.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return await RequestAdapter.SendPrimitiveAsync<long?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>

View File

@@ -59,7 +59,7 @@ namespace Marechai.App.MagazinesByMachine
public MagazinesByMachineRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/magazines-by-machine", rawUrl)
{
}
/// <returns>A <see cref="UntypedNode"/></returns>
/// <returns>A <see cref="long"/></returns>
/// <param name="body">The request body</param>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
@@ -67,11 +67,11 @@ namespace Marechai.App.MagazinesByMachine
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 401 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<UntypedNode?> PostAsync(global::Marechai.App.Models.MagazineByMachineDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<long?> PostAsync(global::Marechai.App.Models.MagazineByMachineDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<UntypedNode> PostAsync(global::Marechai.App.Models.MagazineByMachineDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<long?> PostAsync(global::Marechai.App.Models.MagazineByMachineDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
@@ -81,7 +81,7 @@ namespace Marechai.App.MagazinesByMachine
{ "400", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
{ "401", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<UntypedNode>(requestInfo, UntypedNode.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return await RequestAdapter.SendPrimitiveAsync<long?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="body">The request body</param>

View File

@@ -59,7 +59,7 @@ namespace Marechai.App.MagazinesByMachineFamily
public MagazinesByMachineFamilyRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/magazines-by-machine-family", rawUrl)
{
}
/// <returns>A <see cref="UntypedNode"/></returns>
/// <returns>A <see cref="long"/></returns>
/// <param name="body">The request body</param>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
@@ -67,11 +67,11 @@ namespace Marechai.App.MagazinesByMachineFamily
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 401 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<UntypedNode?> PostAsync(global::Marechai.App.Models.MagazineByMachineFamilyDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<long?> PostAsync(global::Marechai.App.Models.MagazineByMachineFamilyDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<UntypedNode> PostAsync(global::Marechai.App.Models.MagazineByMachineFamilyDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<long?> PostAsync(global::Marechai.App.Models.MagazineByMachineFamilyDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
@@ -81,7 +81,7 @@ namespace Marechai.App.MagazinesByMachineFamily
{ "400", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
{ "401", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<UntypedNode>(requestInfo, UntypedNode.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return await RequestAdapter.SendPrimitiveAsync<long?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="body">The request body</param>

View File

@@ -27,7 +27,7 @@ namespace Marechai.App.Medias
/// <summary>Gets an item from the Marechai.App.medias.item collection</summary>
/// <param name="position">Unique identifier of the item</param>
/// <returns>A <see cref="global::Marechai.App.Medias.Item.MediasItemRequestBuilder"/></returns>
public global::Marechai.App.Medias.Item.MediasItemRequestBuilder this[string position]
public global::Marechai.App.Medias.Item.MediasItemRequestBuilder this[int position]
{
get
{
@@ -36,6 +36,19 @@ namespace Marechai.App.Medias
return new global::Marechai.App.Medias.Item.MediasItemRequestBuilder(urlTplParams, RequestAdapter);
}
}
/// <summary>Gets an item from the Marechai.App.medias.item collection</summary>
/// <param name="position">Unique identifier of the item</param>
/// <returns>A <see cref="global::Marechai.App.Medias.Item.MediasItemRequestBuilder"/></returns>
[Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")]
public global::Marechai.App.Medias.Item.MediasItemRequestBuilder this[string position]
{
get
{
var urlTplParams = new Dictionary<string, object>(PathParameters);
if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("id", position);
return new global::Marechai.App.Medias.Item.MediasItemRequestBuilder(urlTplParams, RequestAdapter);
}
}
/// <summary>
/// Instantiates a new <see cref="global::Marechai.App.Medias.MediasRequestBuilder"/> and sets the default values.
/// </summary>
@@ -73,7 +86,7 @@ namespace Marechai.App.Medias
var collectionResult = await RequestAdapter.SendCollectionAsync<global::Marechai.App.Models.MediaDto>(requestInfo, global::Marechai.App.Models.MediaDto.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return collectionResult?.AsList();
}
/// <returns>A <see cref="UntypedNode"/></returns>
/// <returns>A <see cref="int"/></returns>
/// <param name="body">The request body</param>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
@@ -81,11 +94,11 @@ namespace Marechai.App.Medias
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 401 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<UntypedNode?> PostAsync(global::Marechai.App.Models.MediaDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<int?> PostAsync(global::Marechai.App.Models.MediaDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<UntypedNode> PostAsync(global::Marechai.App.Models.MediaDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<int?> PostAsync(global::Marechai.App.Models.MediaDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
@@ -95,7 +108,7 @@ namespace Marechai.App.Medias
{ "400", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
{ "401", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<UntypedNode>(requestInfo, UntypedNode.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return await RequestAdapter.SendPrimitiveAsync<int?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>

View File

@@ -59,7 +59,7 @@ namespace Marechai.App.MemoriesByMachine
public MemoriesByMachineRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/memories-by-machine", rawUrl)
{
}
/// <returns>A <see cref="UntypedNode"/></returns>
/// <returns>A <see cref="long"/></returns>
/// <param name="body">The request body</param>
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
@@ -67,11 +67,11 @@ namespace Marechai.App.MemoriesByMachine
/// <exception cref="global::Marechai.App.Models.ProblemDetails">When receiving a 401 status code</exception>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public async Task<UntypedNode?> PostAsync(global::Marechai.App.Models.MemoryByMachineDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<long?> PostAsync(global::Marechai.App.Models.MemoryByMachineDto body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
{
#nullable restore
#else
public async Task<UntypedNode> PostAsync(global::Marechai.App.Models.MemoryByMachineDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
public async Task<long?> PostAsync(global::Marechai.App.Models.MemoryByMachineDto body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
{
#endif
if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
@@ -81,7 +81,7 @@ namespace Marechai.App.MemoriesByMachine
{ "400", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
{ "401", global::Marechai.App.Models.ProblemDetails.CreateFromDiscriminatorValue },
};
return await RequestAdapter.SendAsync<UntypedNode>(requestInfo, UntypedNode.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
return await RequestAdapter.SendPrimitiveAsync<long?>(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
}
/// <returns>A <see cref="RequestInformation"/></returns>
/// <param name="body">The request body</param>

View File

@@ -23,21 +23,9 @@ namespace Marechai.App.Models
public string Book { get; set; }
#endif
/// <summary>The book_id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? BookId { get; set; }
#nullable restore
#else
public UntypedNode BookId { get; set; }
#endif
public long? BookId { get; set; }
/// <summary>The id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? Id { get; set; }
#nullable restore
#else
public UntypedNode Id { get; set; }
#endif
public long? Id { get; set; }
/// <summary>The machine property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
@@ -47,13 +35,7 @@ namespace Marechai.App.Models
public string Machine { get; set; }
#endif
/// <summary>The machine_id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? MachineId { get; set; }
#nullable restore
#else
public UntypedNode MachineId { get; set; }
#endif
public int? MachineId { get; set; }
/// <summary>
/// Instantiates a new <see cref="global::Marechai.App.Models.BookByMachineDto"/> and sets the default values.
/// </summary>
@@ -80,10 +62,10 @@ namespace Marechai.App.Models
return new Dictionary<string, Action<IParseNode>>
{
{ "book", n => { Book = n.GetStringValue(); } },
{ "book_id", n => { BookId = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "id", n => { Id = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "book_id", n => { BookId = n.GetLongValue(); } },
{ "id", n => { Id = n.GetLongValue(); } },
{ "machine", n => { Machine = n.GetStringValue(); } },
{ "machine_id", n => { MachineId = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "machine_id", n => { MachineId = n.GetIntValue(); } },
};
}
/// <summary>
@@ -94,10 +76,10 @@ namespace Marechai.App.Models
{
if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
writer.WriteStringValue("book", Book);
writer.WriteObjectValue<UntypedNode>("book_id", BookId);
writer.WriteObjectValue<UntypedNode>("id", Id);
writer.WriteLongValue("book_id", BookId);
writer.WriteLongValue("id", Id);
writer.WriteStringValue("machine", Machine);
writer.WriteObjectValue<UntypedNode>("machine_id", MachineId);
writer.WriteIntValue("machine_id", MachineId);
writer.WriteAdditionalData(AdditionalData);
}
}

View File

@@ -23,21 +23,9 @@ namespace Marechai.App.Models
public string Book { get; set; }
#endif
/// <summary>The book_id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? BookId { get; set; }
#nullable restore
#else
public UntypedNode BookId { get; set; }
#endif
public long? BookId { get; set; }
/// <summary>The id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? Id { get; set; }
#nullable restore
#else
public UntypedNode Id { get; set; }
#endif
public long? Id { get; set; }
/// <summary>The machine_family property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
@@ -47,13 +35,7 @@ namespace Marechai.App.Models
public string MachineFamily { get; set; }
#endif
/// <summary>The machine_family_id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? MachineFamilyId { get; set; }
#nullable restore
#else
public UntypedNode MachineFamilyId { get; set; }
#endif
public int? MachineFamilyId { get; set; }
/// <summary>
/// Instantiates a new <see cref="global::Marechai.App.Models.BookByMachineFamilyDto"/> and sets the default values.
/// </summary>
@@ -80,10 +62,10 @@ namespace Marechai.App.Models
return new Dictionary<string, Action<IParseNode>>
{
{ "book", n => { Book = n.GetStringValue(); } },
{ "book_id", n => { BookId = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "id", n => { Id = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "book_id", n => { BookId = n.GetLongValue(); } },
{ "id", n => { Id = n.GetLongValue(); } },
{ "machine_family", n => { MachineFamily = n.GetStringValue(); } },
{ "machine_family_id", n => { MachineFamilyId = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "machine_family_id", n => { MachineFamilyId = n.GetIntValue(); } },
};
}
/// <summary>
@@ -94,10 +76,10 @@ namespace Marechai.App.Models
{
if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
writer.WriteStringValue("book", Book);
writer.WriteObjectValue<UntypedNode>("book_id", BookId);
writer.WriteObjectValue<UntypedNode>("id", Id);
writer.WriteLongValue("book_id", BookId);
writer.WriteLongValue("id", Id);
writer.WriteStringValue("machine_family", MachineFamily);
writer.WriteObjectValue<UntypedNode>("machine_family_id", MachineFamilyId);
writer.WriteIntValue("machine_family_id", MachineFamilyId);
writer.WriteAdditionalData(AdditionalData);
}
}

View File

@@ -23,29 +23,11 @@ namespace Marechai.App.Models
public string Country { get; set; }
#endif
/// <summary>The country_id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? CountryId { get; set; }
#nullable restore
#else
public UntypedNode CountryId { get; set; }
#endif
public int? CountryId { get; set; }
/// <summary>The edition property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? Edition { get; set; }
#nullable restore
#else
public UntypedNode Edition { get; set; }
#endif
public int? Edition { get; set; }
/// <summary>The id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? Id { get; set; }
#nullable restore
#else
public UntypedNode Id { get; set; }
#endif
public long? Id { get; set; }
/// <summary>The isbn property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
@@ -63,31 +45,13 @@ namespace Marechai.App.Models
public string NativeTitle { get; set; }
#endif
/// <summary>The pages property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? Pages { get; set; }
#nullable restore
#else
public UntypedNode Pages { get; set; }
#endif
public int? Pages { get; set; }
/// <summary>The previous_id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? PreviousId { get; set; }
#nullable restore
#else
public UntypedNode PreviousId { get; set; }
#endif
public long? PreviousId { get; set; }
/// <summary>The published property</summary>
public DateTimeOffset? Published { get; set; }
/// <summary>The source_id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? SourceId { get; set; }
#nullable restore
#else
public UntypedNode SourceId { get; set; }
#endif
public long? SourceId { get; set; }
/// <summary>The synopsis property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
@@ -130,15 +94,15 @@ namespace Marechai.App.Models
return new Dictionary<string, Action<IParseNode>>
{
{ "country", n => { Country = n.GetStringValue(); } },
{ "country_id", n => { CountryId = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "edition", n => { Edition = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "id", n => { Id = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "country_id", n => { CountryId = n.GetIntValue(); } },
{ "edition", n => { Edition = n.GetIntValue(); } },
{ "id", n => { Id = n.GetLongValue(); } },
{ "isbn", n => { Isbn = n.GetStringValue(); } },
{ "native_title", n => { NativeTitle = n.GetStringValue(); } },
{ "pages", n => { Pages = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "previous_id", n => { PreviousId = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "pages", n => { Pages = n.GetIntValue(); } },
{ "previous_id", n => { PreviousId = n.GetLongValue(); } },
{ "published", n => { Published = n.GetDateTimeOffsetValue(); } },
{ "source_id", n => { SourceId = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "source_id", n => { SourceId = n.GetLongValue(); } },
{ "synopsis", n => { Synopsis = n.GetStringValue(); } },
{ "title", n => { Title = n.GetStringValue(); } },
};
@@ -151,15 +115,15 @@ namespace Marechai.App.Models
{
if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
writer.WriteStringValue("country", Country);
writer.WriteObjectValue<UntypedNode>("country_id", CountryId);
writer.WriteObjectValue<UntypedNode>("edition", Edition);
writer.WriteObjectValue<UntypedNode>("id", Id);
writer.WriteIntValue("country_id", CountryId);
writer.WriteIntValue("edition", Edition);
writer.WriteLongValue("id", Id);
writer.WriteStringValue("isbn", Isbn);
writer.WriteStringValue("native_title", NativeTitle);
writer.WriteObjectValue<UntypedNode>("pages", Pages);
writer.WriteObjectValue<UntypedNode>("previous_id", PreviousId);
writer.WriteIntValue("pages", Pages);
writer.WriteLongValue("previous_id", PreviousId);
writer.WriteDateTimeOffsetValue("published", Published);
writer.WriteObjectValue<UntypedNode>("source_id", SourceId);
writer.WriteLongValue("source_id", SourceId);
writer.WriteStringValue("synopsis", Synopsis);
writer.WriteStringValue("title", Title);
writer.WriteAdditionalData(AdditionalData);

View File

@@ -31,21 +31,9 @@ namespace Marechai.App.Models
public string Book { get; set; }
#endif
/// <summary>The book_id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? BookId { get; set; }
#nullable restore
#else
public UntypedNode BookId { get; set; }
#endif
public long? BookId { get; set; }
/// <summary>The colorspace property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public global::Marechai.App.Models.BookScanDto.BookScanDto_colorspace? Colorspace { get; set; }
#nullable restore
#else
public global::Marechai.App.Models.BookScanDto.BookScanDto_colorspace Colorspace { get; set; }
#endif
public int? Colorspace { get; set; }
/// <summary>The comments property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
@@ -65,13 +53,7 @@ namespace Marechai.App.Models
public string ExifVersion { get; set; }
#endif
/// <summary>The horizontal_resolution property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? HorizontalResolution { get; set; }
#nullable restore
#else
public UntypedNode HorizontalResolution { get; set; }
#endif
public double? HorizontalResolution { get; set; }
/// <summary>The id property</summary>
public Guid? Id { get; set; }
/// <summary>The original_extension property</summary>
@@ -83,21 +65,9 @@ namespace Marechai.App.Models
public string OriginalExtension { get; set; }
#endif
/// <summary>The page property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? Page { get; set; }
#nullable restore
#else
public UntypedNode Page { get; set; }
#endif
public int? Page { get; set; }
/// <summary>The resolution_unit property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public global::Marechai.App.Models.BookScanDto.BookScanDto_resolution_unit? ResolutionUnit { get; set; }
#nullable restore
#else
public global::Marechai.App.Models.BookScanDto.BookScanDto_resolution_unit ResolutionUnit { get; set; }
#endif
public int? ResolutionUnit { get; set; }
/// <summary>The scanner_manufacturer property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
@@ -135,13 +105,7 @@ namespace Marechai.App.Models
public string UserId { get; set; }
#endif
/// <summary>The vertical_resolution property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? VerticalResolution { get; set; }
#nullable restore
#else
public UntypedNode VerticalResolution { get; set; }
#endif
public double? VerticalResolution { get; set; }
/// <summary>
/// Instantiates a new <see cref="global::Marechai.App.Models.BookScanDto"/> and sets the default values.
/// </summary>
@@ -169,23 +133,23 @@ namespace Marechai.App.Models
{
{ "author", n => { Author = n.GetStringValue(); } },
{ "book", n => { Book = n.GetStringValue(); } },
{ "book_id", n => { BookId = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "colorspace", n => { Colorspace = n.GetObjectValue<global::Marechai.App.Models.BookScanDto.BookScanDto_colorspace>(global::Marechai.App.Models.BookScanDto.BookScanDto_colorspace.CreateFromDiscriminatorValue); } },
{ "book_id", n => { BookId = n.GetLongValue(); } },
{ "colorspace", n => { Colorspace = n.GetIntValue(); } },
{ "comments", n => { Comments = n.GetStringValue(); } },
{ "creation_date", n => { CreationDate = n.GetDateTimeOffsetValue(); } },
{ "exif_version", n => { ExifVersion = n.GetStringValue(); } },
{ "horizontal_resolution", n => { HorizontalResolution = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "horizontal_resolution", n => { HorizontalResolution = n.GetDoubleValue(); } },
{ "id", n => { Id = n.GetGuidValue(); } },
{ "original_extension", n => { OriginalExtension = n.GetStringValue(); } },
{ "page", n => { Page = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "resolution_unit", n => { ResolutionUnit = n.GetObjectValue<global::Marechai.App.Models.BookScanDto.BookScanDto_resolution_unit>(global::Marechai.App.Models.BookScanDto.BookScanDto_resolution_unit.CreateFromDiscriminatorValue); } },
{ "page", n => { Page = n.GetIntValue(); } },
{ "resolution_unit", n => { ResolutionUnit = n.GetIntValue(); } },
{ "scanner_manufacturer", n => { ScannerManufacturer = n.GetStringValue(); } },
{ "scanner_model", n => { ScannerModel = n.GetStringValue(); } },
{ "software", n => { Software = n.GetStringValue(); } },
{ "type", n => { Type = n.GetIntValue(); } },
{ "upload_date", n => { UploadDate = n.GetDateTimeOffsetValue(); } },
{ "user_id", n => { UserId = n.GetStringValue(); } },
{ "vertical_resolution", n => { VerticalResolution = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "vertical_resolution", n => { VerticalResolution = n.GetDoubleValue(); } },
};
}
/// <summary>
@@ -197,175 +161,25 @@ namespace Marechai.App.Models
if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
writer.WriteStringValue("author", Author);
writer.WriteStringValue("book", Book);
writer.WriteObjectValue<UntypedNode>("book_id", BookId);
writer.WriteObjectValue<global::Marechai.App.Models.BookScanDto.BookScanDto_colorspace>("colorspace", Colorspace);
writer.WriteLongValue("book_id", BookId);
writer.WriteIntValue("colorspace", Colorspace);
writer.WriteStringValue("comments", Comments);
writer.WriteDateTimeOffsetValue("creation_date", CreationDate);
writer.WriteStringValue("exif_version", ExifVersion);
writer.WriteObjectValue<UntypedNode>("horizontal_resolution", HorizontalResolution);
writer.WriteDoubleValue("horizontal_resolution", HorizontalResolution);
writer.WriteGuidValue("id", Id);
writer.WriteStringValue("original_extension", OriginalExtension);
writer.WriteObjectValue<UntypedNode>("page", Page);
writer.WriteObjectValue<global::Marechai.App.Models.BookScanDto.BookScanDto_resolution_unit>("resolution_unit", ResolutionUnit);
writer.WriteIntValue("page", Page);
writer.WriteIntValue("resolution_unit", ResolutionUnit);
writer.WriteStringValue("scanner_manufacturer", ScannerManufacturer);
writer.WriteStringValue("scanner_model", ScannerModel);
writer.WriteStringValue("software", Software);
writer.WriteIntValue("type", Type);
writer.WriteDateTimeOffsetValue("upload_date", UploadDate);
writer.WriteStringValue("user_id", UserId);
writer.WriteObjectValue<UntypedNode>("vertical_resolution", VerticalResolution);
writer.WriteDoubleValue("vertical_resolution", VerticalResolution);
writer.WriteAdditionalData(AdditionalData);
}
/// <summary>
/// Composed type wrapper for classes <see cref="global::Marechai.App.Models.BookScanDto_colorspaceMember1"/>, <see cref="global::Marechai.App.Models.ColorSpace"/>
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
public partial class BookScanDto_colorspace : IComposedTypeWrapper, IParsable
{
/// <summary>Composed type representation for type <see cref="global::Marechai.App.Models.BookScanDto_colorspaceMember1"/></summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public global::Marechai.App.Models.BookScanDto_colorspaceMember1? BookScanDtoColorspaceMember1 { get; set; }
#nullable restore
#else
public global::Marechai.App.Models.BookScanDto_colorspaceMember1 BookScanDtoColorspaceMember1 { get; set; }
#endif
/// <summary>Composed type representation for type <see cref="global::Marechai.App.Models.ColorSpace"/></summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public global::Marechai.App.Models.ColorSpace? ColorSpace { get; set; }
#nullable restore
#else
public global::Marechai.App.Models.ColorSpace ColorSpace { get; set; }
#endif
/// <summary>
/// Creates a new instance of the appropriate class based on discriminator value
/// </summary>
/// <returns>A <see cref="global::Marechai.App.Models.BookScanDto.BookScanDto_colorspace"/></returns>
/// <param name="parseNode">The parse node to use to read the discriminator value and create the object</param>
public static global::Marechai.App.Models.BookScanDto.BookScanDto_colorspace CreateFromDiscriminatorValue(IParseNode parseNode)
{
if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode));
var mappingValue = parseNode.GetChildNode("")?.GetStringValue();
var result = new global::Marechai.App.Models.BookScanDto.BookScanDto_colorspace();
if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase))
{
result.BookScanDtoColorspaceMember1 = new global::Marechai.App.Models.BookScanDto_colorspaceMember1();
}
else if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase))
{
result.ColorSpace = new global::Marechai.App.Models.ColorSpace();
}
return result;
}
/// <summary>
/// The deserialization information for the current model
/// </summary>
/// <returns>A IDictionary&lt;string, Action&lt;IParseNode&gt;&gt;</returns>
public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
{
if(BookScanDtoColorspaceMember1 != null)
{
return BookScanDtoColorspaceMember1.GetFieldDeserializers();
}
else if(ColorSpace != null)
{
return ColorSpace.GetFieldDeserializers();
}
return new Dictionary<string, Action<IParseNode>>();
}
/// <summary>
/// Serializes information the current object
/// </summary>
/// <param name="writer">Serialization writer to use to serialize this model</param>
public virtual void Serialize(ISerializationWriter writer)
{
if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
if(BookScanDtoColorspaceMember1 != null)
{
writer.WriteObjectValue<global::Marechai.App.Models.BookScanDto_colorspaceMember1>(null, BookScanDtoColorspaceMember1);
}
else if(ColorSpace != null)
{
writer.WriteObjectValue<global::Marechai.App.Models.ColorSpace>(null, ColorSpace);
}
}
}
/// <summary>
/// Composed type wrapper for classes <see cref="global::Marechai.App.Models.BookScanDto_resolution_unitMember1"/>, <see cref="global::Marechai.App.Models.ResolutionUnit"/>
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
public partial class BookScanDto_resolution_unit : IComposedTypeWrapper, IParsable
{
/// <summary>Composed type representation for type <see cref="global::Marechai.App.Models.BookScanDto_resolution_unitMember1"/></summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public global::Marechai.App.Models.BookScanDto_resolution_unitMember1? BookScanDtoResolutionUnitMember1 { get; set; }
#nullable restore
#else
public global::Marechai.App.Models.BookScanDto_resolution_unitMember1 BookScanDtoResolutionUnitMember1 { get; set; }
#endif
/// <summary>Composed type representation for type <see cref="global::Marechai.App.Models.ResolutionUnit"/></summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public global::Marechai.App.Models.ResolutionUnit? ResolutionUnit { get; set; }
#nullable restore
#else
public global::Marechai.App.Models.ResolutionUnit ResolutionUnit { get; set; }
#endif
/// <summary>
/// Creates a new instance of the appropriate class based on discriminator value
/// </summary>
/// <returns>A <see cref="global::Marechai.App.Models.BookScanDto.BookScanDto_resolution_unit"/></returns>
/// <param name="parseNode">The parse node to use to read the discriminator value and create the object</param>
public static global::Marechai.App.Models.BookScanDto.BookScanDto_resolution_unit CreateFromDiscriminatorValue(IParseNode parseNode)
{
if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode));
var mappingValue = parseNode.GetChildNode("")?.GetStringValue();
var result = new global::Marechai.App.Models.BookScanDto.BookScanDto_resolution_unit();
if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase))
{
result.BookScanDtoResolutionUnitMember1 = new global::Marechai.App.Models.BookScanDto_resolution_unitMember1();
}
else if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase))
{
result.ResolutionUnit = new global::Marechai.App.Models.ResolutionUnit();
}
return result;
}
/// <summary>
/// The deserialization information for the current model
/// </summary>
/// <returns>A IDictionary&lt;string, Action&lt;IParseNode&gt;&gt;</returns>
public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
{
if(BookScanDtoResolutionUnitMember1 != null)
{
return BookScanDtoResolutionUnitMember1.GetFieldDeserializers();
}
else if(ResolutionUnit != null)
{
return ResolutionUnit.GetFieldDeserializers();
}
return new Dictionary<string, Action<IParseNode>>();
}
/// <summary>
/// Serializes information the current object
/// </summary>
/// <param name="writer">Serialization writer to use to serialize this model</param>
public virtual void Serialize(ISerializationWriter writer)
{
if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
if(BookScanDtoResolutionUnitMember1 != null)
{
writer.WriteObjectValue<global::Marechai.App.Models.BookScanDto_resolution_unitMember1>(null, BookScanDtoResolutionUnitMember1);
}
else if(ResolutionUnit != null)
{
writer.WriteObjectValue<global::Marechai.App.Models.ResolutionUnit>(null, ResolutionUnit);
}
}
}
}
}
#pragma warning restore CS0618

View File

@@ -37,13 +37,7 @@ namespace Marechai.App.Models
/// <summary>The gif89 property</summary>
public bool? Gif89 { get; set; }
/// <summary>The id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? Id { get; set; }
#nullable restore
#else
public UntypedNode Id { get; set; }
#endif
public int? Id { get; set; }
/// <summary>The jpeg property</summary>
public bool? Jpeg { get; set; }
/// <summary>The js property</summary>
@@ -121,7 +115,7 @@ namespace Marechai.App.Models
{ "frames", n => { Frames = n.GetBoolValue(); } },
{ "gif87", n => { Gif87 = n.GetBoolValue(); } },
{ "gif89", n => { Gif89 = n.GetBoolValue(); } },
{ "id", n => { Id = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "id", n => { Id = n.GetIntValue(); } },
{ "jpeg", n => { Jpeg = n.GetBoolValue(); } },
{ "js", n => { Js = n.GetBoolValue(); } },
{ "os", n => { Os = n.GetStringValue(); } },
@@ -149,7 +143,7 @@ namespace Marechai.App.Models
writer.WriteBoolValue("frames", Frames);
writer.WriteBoolValue("gif87", Gif87);
writer.WriteBoolValue("gif89", Gif89);
writer.WriteObjectValue<UntypedNode>("id", Id);
writer.WriteIntValue("id", Id);
writer.WriteBoolValue("jpeg", Jpeg);
writer.WriteBoolValue("js", Js);
writer.WriteStringValue("os", Os);

View File

@@ -15,13 +15,7 @@ namespace Marechai.App.Models
/// <summary>Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.</summary>
public IDictionary<string, object> AdditionalData { get; set; }
/// <summary>The book_id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? BookId { get; set; }
#nullable restore
#else
public UntypedNode BookId { get; set; }
#endif
public long? BookId { get; set; }
/// <summary>The company property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
@@ -31,21 +25,9 @@ namespace Marechai.App.Models
public string Company { get; set; }
#endif
/// <summary>The company_id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? CompanyId { get; set; }
#nullable restore
#else
public UntypedNode CompanyId { get; set; }
#endif
public int? CompanyId { get; set; }
/// <summary>The id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? Id { get; set; }
#nullable restore
#else
public UntypedNode Id { get; set; }
#endif
public long? Id { get; set; }
/// <summary>The role property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
@@ -87,10 +69,10 @@ namespace Marechai.App.Models
{
return new Dictionary<string, Action<IParseNode>>
{
{ "book_id", n => { BookId = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "book_id", n => { BookId = n.GetLongValue(); } },
{ "company", n => { Company = n.GetStringValue(); } },
{ "company_id", n => { CompanyId = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "id", n => { Id = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "company_id", n => { CompanyId = n.GetIntValue(); } },
{ "id", n => { Id = n.GetLongValue(); } },
{ "role", n => { Role = n.GetStringValue(); } },
{ "role_id", n => { RoleId = n.GetStringValue(); } },
};
@@ -102,10 +84,10 @@ namespace Marechai.App.Models
public virtual void Serialize(ISerializationWriter writer)
{
if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
writer.WriteObjectValue<UntypedNode>("book_id", BookId);
writer.WriteLongValue("book_id", BookId);
writer.WriteStringValue("company", Company);
writer.WriteObjectValue<UntypedNode>("company_id", CompanyId);
writer.WriteObjectValue<UntypedNode>("id", Id);
writer.WriteIntValue("company_id", CompanyId);
writer.WriteLongValue("id", Id);
writer.WriteStringValue("role", Role);
writer.WriteStringValue("role_id", RoleId);
writer.WriteAdditionalData(AdditionalData);

View File

@@ -23,29 +23,11 @@ namespace Marechai.App.Models
public string Company { get; set; }
#endif
/// <summary>The company_id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? CompanyId { get; set; }
#nullable restore
#else
public UntypedNode CompanyId { get; set; }
#endif
public int? CompanyId { get; set; }
/// <summary>The document_id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? DocumentId { get; set; }
#nullable restore
#else
public UntypedNode DocumentId { get; set; }
#endif
public long? DocumentId { get; set; }
/// <summary>The id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? Id { get; set; }
#nullable restore
#else
public UntypedNode Id { get; set; }
#endif
public long? Id { get; set; }
/// <summary>The role property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
@@ -88,9 +70,9 @@ namespace Marechai.App.Models
return new Dictionary<string, Action<IParseNode>>
{
{ "company", n => { Company = n.GetStringValue(); } },
{ "company_id", n => { CompanyId = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "document_id", n => { DocumentId = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "id", n => { Id = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "company_id", n => { CompanyId = n.GetIntValue(); } },
{ "document_id", n => { DocumentId = n.GetLongValue(); } },
{ "id", n => { Id = n.GetLongValue(); } },
{ "role", n => { Role = n.GetStringValue(); } },
{ "role_id", n => { RoleId = n.GetStringValue(); } },
};
@@ -103,9 +85,9 @@ namespace Marechai.App.Models
{
if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
writer.WriteStringValue("company", Company);
writer.WriteObjectValue<UntypedNode>("company_id", CompanyId);
writer.WriteObjectValue<UntypedNode>("document_id", DocumentId);
writer.WriteObjectValue<UntypedNode>("id", Id);
writer.WriteIntValue("company_id", CompanyId);
writer.WriteLongValue("document_id", DocumentId);
writer.WriteLongValue("id", Id);
writer.WriteStringValue("role", Role);
writer.WriteStringValue("role_id", RoleId);
writer.WriteAdditionalData(AdditionalData);

View File

@@ -23,29 +23,11 @@ namespace Marechai.App.Models
public string Company { get; set; }
#endif
/// <summary>The company_id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? CompanyId { get; set; }
#nullable restore
#else
public UntypedNode CompanyId { get; set; }
#endif
public int? CompanyId { get; set; }
/// <summary>The id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? Id { get; set; }
#nullable restore
#else
public UntypedNode Id { get; set; }
#endif
public long? Id { get; set; }
/// <summary>The magazine_id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? MagazineId { get; set; }
#nullable restore
#else
public UntypedNode MagazineId { get; set; }
#endif
public long? MagazineId { get; set; }
/// <summary>The role property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
@@ -88,9 +70,9 @@ namespace Marechai.App.Models
return new Dictionary<string, Action<IParseNode>>
{
{ "company", n => { Company = n.GetStringValue(); } },
{ "company_id", n => { CompanyId = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "id", n => { Id = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "magazine_id", n => { MagazineId = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "company_id", n => { CompanyId = n.GetIntValue(); } },
{ "id", n => { Id = n.GetLongValue(); } },
{ "magazine_id", n => { MagazineId = n.GetLongValue(); } },
{ "role", n => { Role = n.GetStringValue(); } },
{ "role_id", n => { RoleId = n.GetStringValue(); } },
};
@@ -103,9 +85,9 @@ namespace Marechai.App.Models
{
if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
writer.WriteStringValue("company", Company);
writer.WriteObjectValue<UntypedNode>("company_id", CompanyId);
writer.WriteObjectValue<UntypedNode>("id", Id);
writer.WriteObjectValue<UntypedNode>("magazine_id", MagazineId);
writer.WriteIntValue("company_id", CompanyId);
writer.WriteLongValue("id", Id);
writer.WriteLongValue("magazine_id", MagazineId);
writer.WriteStringValue("role", Role);
writer.WriteStringValue("role_id", RoleId);
writer.WriteAdditionalData(AdditionalData);

View File

@@ -23,21 +23,9 @@ namespace Marechai.App.Models
public string Company { get; set; }
#endif
/// <summary>The company_id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? CompanyId { get; set; }
#nullable restore
#else
public UntypedNode CompanyId { get; set; }
#endif
public int? CompanyId { get; set; }
/// <summary>The id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? Id { get; set; }
#nullable restore
#else
public UntypedNode Id { get; set; }
#endif
public int? Id { get; set; }
/// <summary>The role property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
@@ -55,13 +43,7 @@ namespace Marechai.App.Models
public string RoleId { get; set; }
#endif
/// <summary>The software_family_id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? SoftwareFamilyId { get; set; }
#nullable restore
#else
public UntypedNode SoftwareFamilyId { get; set; }
#endif
public int? SoftwareFamilyId { get; set; }
/// <summary>
/// Instantiates a new <see cref="global::Marechai.App.Models.CompanyBySoftwareFamilyDto"/> and sets the default values.
/// </summary>
@@ -88,11 +70,11 @@ namespace Marechai.App.Models
return new Dictionary<string, Action<IParseNode>>
{
{ "company", n => { Company = n.GetStringValue(); } },
{ "company_id", n => { CompanyId = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "id", n => { Id = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "company_id", n => { CompanyId = n.GetIntValue(); } },
{ "id", n => { Id = n.GetIntValue(); } },
{ "role", n => { Role = n.GetStringValue(); } },
{ "role_id", n => { RoleId = n.GetStringValue(); } },
{ "software_family_id", n => { SoftwareFamilyId = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "software_family_id", n => { SoftwareFamilyId = n.GetIntValue(); } },
};
}
/// <summary>
@@ -103,11 +85,11 @@ namespace Marechai.App.Models
{
if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
writer.WriteStringValue("company", Company);
writer.WriteObjectValue<UntypedNode>("company_id", CompanyId);
writer.WriteObjectValue<UntypedNode>("id", Id);
writer.WriteIntValue("company_id", CompanyId);
writer.WriteIntValue("id", Id);
writer.WriteStringValue("role", Role);
writer.WriteStringValue("role_id", RoleId);
writer.WriteObjectValue<UntypedNode>("software_family_id", SoftwareFamilyId);
writer.WriteIntValue("software_family_id", SoftwareFamilyId);
writer.WriteAdditionalData(AdditionalData);
}
}

View File

@@ -23,21 +23,9 @@ namespace Marechai.App.Models
public string Company { get; set; }
#endif
/// <summary>The company_id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? CompanyId { get; set; }
#nullable restore
#else
public UntypedNode CompanyId { get; set; }
#endif
public int? CompanyId { get; set; }
/// <summary>The id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? Id { get; set; }
#nullable restore
#else
public UntypedNode Id { get; set; }
#endif
public int? Id { get; set; }
/// <summary>The role property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
@@ -55,13 +43,7 @@ namespace Marechai.App.Models
public string RoleId { get; set; }
#endif
/// <summary>The software_variant_id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? SoftwareVariantId { get; set; }
#nullable restore
#else
public UntypedNode SoftwareVariantId { get; set; }
#endif
public int? SoftwareVariantId { get; set; }
/// <summary>
/// Instantiates a new <see cref="global::Marechai.App.Models.CompanyBySoftwareVariantDto"/> and sets the default values.
/// </summary>
@@ -88,11 +70,11 @@ namespace Marechai.App.Models
return new Dictionary<string, Action<IParseNode>>
{
{ "company", n => { Company = n.GetStringValue(); } },
{ "company_id", n => { CompanyId = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "id", n => { Id = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "company_id", n => { CompanyId = n.GetIntValue(); } },
{ "id", n => { Id = n.GetIntValue(); } },
{ "role", n => { Role = n.GetStringValue(); } },
{ "role_id", n => { RoleId = n.GetStringValue(); } },
{ "software_variant_id", n => { SoftwareVariantId = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "software_variant_id", n => { SoftwareVariantId = n.GetIntValue(); } },
};
}
/// <summary>
@@ -103,11 +85,11 @@ namespace Marechai.App.Models
{
if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
writer.WriteStringValue("company", Company);
writer.WriteObjectValue<UntypedNode>("company_id", CompanyId);
writer.WriteObjectValue<UntypedNode>("id", Id);
writer.WriteIntValue("company_id", CompanyId);
writer.WriteIntValue("id", Id);
writer.WriteStringValue("role", Role);
writer.WriteStringValue("role_id", RoleId);
writer.WriteObjectValue<UntypedNode>("software_variant_id", SoftwareVariantId);
writer.WriteIntValue("software_variant_id", SoftwareVariantId);
writer.WriteAdditionalData(AdditionalData);
}
}

View File

@@ -23,21 +23,9 @@ namespace Marechai.App.Models
public string Company { get; set; }
#endif
/// <summary>The company_id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? CompanyId { get; set; }
#nullable restore
#else
public UntypedNode CompanyId { get; set; }
#endif
public int? CompanyId { get; set; }
/// <summary>The id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? Id { get; set; }
#nullable restore
#else
public UntypedNode Id { get; set; }
#endif
public int? Id { get; set; }
/// <summary>The role property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
@@ -55,13 +43,7 @@ namespace Marechai.App.Models
public string RoleId { get; set; }
#endif
/// <summary>The software_version_id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? SoftwareVersionId { get; set; }
#nullable restore
#else
public UntypedNode SoftwareVersionId { get; set; }
#endif
public int? SoftwareVersionId { get; set; }
/// <summary>
/// Instantiates a new <see cref="global::Marechai.App.Models.CompanyBySoftwareVersionDto"/> and sets the default values.
/// </summary>
@@ -88,11 +70,11 @@ namespace Marechai.App.Models
return new Dictionary<string, Action<IParseNode>>
{
{ "company", n => { Company = n.GetStringValue(); } },
{ "company_id", n => { CompanyId = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "id", n => { Id = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "company_id", n => { CompanyId = n.GetIntValue(); } },
{ "id", n => { Id = n.GetIntValue(); } },
{ "role", n => { Role = n.GetStringValue(); } },
{ "role_id", n => { RoleId = n.GetStringValue(); } },
{ "software_version_id", n => { SoftwareVersionId = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "software_version_id", n => { SoftwareVersionId = n.GetIntValue(); } },
};
}
/// <summary>
@@ -103,11 +85,11 @@ namespace Marechai.App.Models
{
if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
writer.WriteStringValue("company", Company);
writer.WriteObjectValue<UntypedNode>("company_id", CompanyId);
writer.WriteObjectValue<UntypedNode>("id", Id);
writer.WriteIntValue("company_id", CompanyId);
writer.WriteIntValue("id", Id);
writer.WriteStringValue("role", Role);
writer.WriteStringValue("role_id", RoleId);
writer.WriteObjectValue<UntypedNode>("software_version_id", SoftwareVersionId);
writer.WriteIntValue("software_version_id", SoftwareVersionId);
writer.WriteAdditionalData(AdditionalData);
}
}

View File

@@ -15,13 +15,7 @@ namespace Marechai.App.Models
/// <summary>Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.</summary>
public IDictionary<string, object> AdditionalData { get; set; }
/// <summary>The company_id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? CompanyId { get; set; }
#nullable restore
#else
public UntypedNode CompanyId { get; set; }
#endif
public int? CompanyId { get; set; }
/// <summary>The html property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
@@ -31,13 +25,7 @@ namespace Marechai.App.Models
public string Html { get; set; }
#endif
/// <summary>The id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? Id { get; set; }
#nullable restore
#else
public UntypedNode Id { get; set; }
#endif
public int? Id { get; set; }
/// <summary>The markdown property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
@@ -71,9 +59,9 @@ namespace Marechai.App.Models
{
return new Dictionary<string, Action<IParseNode>>
{
{ "company_id", n => { CompanyId = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "company_id", n => { CompanyId = n.GetIntValue(); } },
{ "html", n => { Html = n.GetStringValue(); } },
{ "id", n => { Id = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "id", n => { Id = n.GetIntValue(); } },
{ "markdown", n => { Markdown = n.GetStringValue(); } },
};
}
@@ -84,9 +72,9 @@ namespace Marechai.App.Models
public virtual void Serialize(ISerializationWriter writer)
{
if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
writer.WriteObjectValue<UntypedNode>("company_id", CompanyId);
writer.WriteIntValue("company_id", CompanyId);
writer.WriteStringValue("html", Html);
writer.WriteObjectValue<UntypedNode>("id", Id);
writer.WriteIntValue("id", Id);
writer.WriteStringValue("markdown", Markdown);
writer.WriteAdditionalData(AdditionalData);
}

View File

@@ -39,13 +39,7 @@ namespace Marechai.App.Models
public string Country { get; set; }
#endif
/// <summary>The country_id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? CountryId { get; set; }
#nullable restore
#else
public UntypedNode CountryId { get; set; }
#endif
public int? CountryId { get; set; }
/// <summary>The facebook property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
@@ -61,13 +55,7 @@ namespace Marechai.App.Models
/// <summary>The founded_month_is_unknown property</summary>
public bool? FoundedMonthIsUnknown { get; set; }
/// <summary>The id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? Id { get; set; }
#nullable restore
#else
public UntypedNode Id { get; set; }
#endif
public int? Id { get; set; }
/// <summary>The last_logo property</summary>
public Guid? LastLogo { get; set; }
/// <summary>The legal_name property</summary>
@@ -117,13 +105,7 @@ namespace Marechai.App.Models
public string SoldTo { get; set; }
#endif
/// <summary>The sold_to_id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? SoldToId { get; set; }
#nullable restore
#else
public UntypedNode SoldToId { get; set; }
#endif
public int? SoldToId { get; set; }
/// <summary>The status property</summary>
public int? Status { get; set; }
/// <summary>The twitter property</summary>
@@ -170,12 +152,12 @@ namespace Marechai.App.Models
{ "address", n => { Address = n.GetStringValue(); } },
{ "city", n => { City = n.GetStringValue(); } },
{ "country", n => { Country = n.GetStringValue(); } },
{ "country_id", n => { CountryId = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "country_id", n => { CountryId = n.GetIntValue(); } },
{ "facebook", n => { Facebook = n.GetStringValue(); } },
{ "founded", n => { Founded = n.GetDateTimeOffsetValue(); } },
{ "founded_day_is_unknown", n => { FoundedDayIsUnknown = n.GetBoolValue(); } },
{ "founded_month_is_unknown", n => { FoundedMonthIsUnknown = n.GetBoolValue(); } },
{ "id", n => { Id = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "id", n => { Id = n.GetIntValue(); } },
{ "last_logo", n => { LastLogo = n.GetGuidValue(); } },
{ "legal_name", n => { LegalName = n.GetStringValue(); } },
{ "name", n => { Name = n.GetStringValue(); } },
@@ -185,7 +167,7 @@ namespace Marechai.App.Models
{ "sold_day_is_unknown", n => { SoldDayIsUnknown = n.GetBoolValue(); } },
{ "sold_month_is_unknown", n => { SoldMonthIsUnknown = n.GetBoolValue(); } },
{ "sold_to", n => { SoldTo = n.GetStringValue(); } },
{ "sold_to_id", n => { SoldToId = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "sold_to_id", n => { SoldToId = n.GetIntValue(); } },
{ "status", n => { Status = n.GetIntValue(); } },
{ "twitter", n => { Twitter = n.GetStringValue(); } },
{ "website", n => { Website = n.GetStringValue(); } },
@@ -201,12 +183,12 @@ namespace Marechai.App.Models
writer.WriteStringValue("address", Address);
writer.WriteStringValue("city", City);
writer.WriteStringValue("country", Country);
writer.WriteObjectValue<UntypedNode>("country_id", CountryId);
writer.WriteIntValue("country_id", CountryId);
writer.WriteStringValue("facebook", Facebook);
writer.WriteDateTimeOffsetValue("founded", Founded);
writer.WriteBoolValue("founded_day_is_unknown", FoundedDayIsUnknown);
writer.WriteBoolValue("founded_month_is_unknown", FoundedMonthIsUnknown);
writer.WriteObjectValue<UntypedNode>("id", Id);
writer.WriteIntValue("id", Id);
writer.WriteGuidValue("last_logo", LastLogo);
writer.WriteStringValue("legal_name", LegalName);
writer.WriteStringValue("name", Name);
@@ -216,7 +198,7 @@ namespace Marechai.App.Models
writer.WriteBoolValue("sold_day_is_unknown", SoldDayIsUnknown);
writer.WriteBoolValue("sold_month_is_unknown", SoldMonthIsUnknown);
writer.WriteStringValue("sold_to", SoldTo);
writer.WriteObjectValue<UntypedNode>("sold_to_id", SoldToId);
writer.WriteIntValue("sold_to_id", SoldToId);
writer.WriteIntValue("status", Status);
writer.WriteStringValue("twitter", Twitter);
writer.WriteStringValue("website", Website);

View File

@@ -15,31 +15,13 @@ namespace Marechai.App.Models
/// <summary>Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.</summary>
public IDictionary<string, object> AdditionalData { get; set; }
/// <summary>The company_id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? CompanyId { get; set; }
#nullable restore
#else
public UntypedNode CompanyId { get; set; }
#endif
public int? CompanyId { get; set; }
/// <summary>The guid property</summary>
public Guid? Guid { get; set; }
/// <summary>The id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? Id { get; set; }
#nullable restore
#else
public UntypedNode Id { get; set; }
#endif
public int? Id { get; set; }
/// <summary>The year property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? Year { get; set; }
#nullable restore
#else
public UntypedNode Year { get; set; }
#endif
public int? Year { get; set; }
/// <summary>
/// Instantiates a new <see cref="global::Marechai.App.Models.CompanyLogoDto"/> and sets the default values.
/// </summary>
@@ -65,10 +47,10 @@ namespace Marechai.App.Models
{
return new Dictionary<string, Action<IParseNode>>
{
{ "company_id", n => { CompanyId = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "company_id", n => { CompanyId = n.GetIntValue(); } },
{ "guid", n => { Guid = n.GetGuidValue(); } },
{ "id", n => { Id = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "year", n => { Year = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "id", n => { Id = n.GetIntValue(); } },
{ "year", n => { Year = n.GetIntValue(); } },
};
}
/// <summary>
@@ -78,10 +60,10 @@ namespace Marechai.App.Models
public virtual void Serialize(ISerializationWriter writer)
{
if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
writer.WriteObjectValue<UntypedNode>("company_id", CompanyId);
writer.WriteIntValue("company_id", CompanyId);
writer.WriteGuidValue("guid", Guid);
writer.WriteObjectValue<UntypedNode>("id", Id);
writer.WriteObjectValue<UntypedNode>("year", Year);
writer.WriteIntValue("id", Id);
writer.WriteIntValue("year", Year);
writer.WriteAdditionalData(AdditionalData);
}
}

View File

@@ -23,21 +23,9 @@ namespace Marechai.App.Models
public string Code { get; set; }
#endif
/// <summary>The id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? Id { get; set; }
#nullable restore
#else
public UntypedNode Id { get; set; }
#endif
public int? Id { get; set; }
/// <summary>The inflation property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? Inflation { get; set; }
#nullable restore
#else
public UntypedNode Inflation { get; set; }
#endif
public float? Inflation { get; set; }
/// <summary>The name property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
@@ -47,13 +35,7 @@ namespace Marechai.App.Models
public string Name { get; set; }
#endif
/// <summary>The year property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? Year { get; set; }
#nullable restore
#else
public UntypedNode Year { get; set; }
#endif
public int? Year { get; set; }
/// <summary>
/// Instantiates a new <see cref="global::Marechai.App.Models.CurrencyInflationDto"/> and sets the default values.
/// </summary>
@@ -80,10 +62,10 @@ namespace Marechai.App.Models
return new Dictionary<string, Action<IParseNode>>
{
{ "code", n => { Code = n.GetStringValue(); } },
{ "id", n => { Id = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "inflation", n => { Inflation = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "id", n => { Id = n.GetIntValue(); } },
{ "inflation", n => { Inflation = n.GetFloatValue(); } },
{ "name", n => { Name = n.GetStringValue(); } },
{ "year", n => { Year = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "year", n => { Year = n.GetIntValue(); } },
};
}
/// <summary>
@@ -94,10 +76,10 @@ namespace Marechai.App.Models
{
if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
writer.WriteStringValue("code", Code);
writer.WriteObjectValue<UntypedNode>("id", Id);
writer.WriteObjectValue<UntypedNode>("inflation", Inflation);
writer.WriteIntValue("id", Id);
writer.WriteFloatValue("inflation", Inflation);
writer.WriteStringValue("name", Name);
writer.WriteObjectValue<UntypedNode>("year", Year);
writer.WriteIntValue("year", Year);
writer.WriteAdditionalData(AdditionalData);
}
}

View File

@@ -33,21 +33,9 @@ namespace Marechai.App.Models
/// <summary>The end property</summary>
public DateTimeOffset? End { get; set; }
/// <summary>The id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? Id { get; set; }
#nullable restore
#else
public UntypedNode Id { get; set; }
#endif
public int? Id { get; set; }
/// <summary>The ratio property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? Ratio { get; set; }
#nullable restore
#else
public UntypedNode Ratio { get; set; }
#endif
public float? Ratio { get; set; }
/// <summary>The source_code property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
@@ -94,8 +82,8 @@ namespace Marechai.App.Models
{ "destination_code", n => { DestinationCode = n.GetStringValue(); } },
{ "destination_name", n => { DestinationName = n.GetStringValue(); } },
{ "end", n => { End = n.GetDateTimeOffsetValue(); } },
{ "id", n => { Id = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "ratio", n => { Ratio = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "id", n => { Id = n.GetIntValue(); } },
{ "ratio", n => { Ratio = n.GetFloatValue(); } },
{ "source_code", n => { SourceCode = n.GetStringValue(); } },
{ "source_name", n => { SourceName = n.GetStringValue(); } },
{ "start", n => { Start = n.GetDateTimeOffsetValue(); } },
@@ -111,8 +99,8 @@ namespace Marechai.App.Models
writer.WriteStringValue("destination_code", DestinationCode);
writer.WriteStringValue("destination_name", DestinationName);
writer.WriteDateTimeOffsetValue("end", End);
writer.WriteObjectValue<UntypedNode>("id", Id);
writer.WriteObjectValue<UntypedNode>("ratio", Ratio);
writer.WriteIntValue("id", Id);
writer.WriteFloatValue("ratio", Ratio);
writer.WriteStringValue("source_code", SourceCode);
writer.WriteStringValue("source_name", SourceName);
writer.WriteDateTimeOffsetValue("start", Start);

View File

@@ -23,21 +23,9 @@ namespace Marechai.App.Models
public string Document { get; set; }
#endif
/// <summary>The document_id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? DocumentId { get; set; }
#nullable restore
#else
public UntypedNode DocumentId { get; set; }
#endif
public long? DocumentId { get; set; }
/// <summary>The id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? Id { get; set; }
#nullable restore
#else
public UntypedNode Id { get; set; }
#endif
public long? Id { get; set; }
/// <summary>The machine property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
@@ -47,13 +35,7 @@ namespace Marechai.App.Models
public string Machine { get; set; }
#endif
/// <summary>The machine_id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? MachineId { get; set; }
#nullable restore
#else
public UntypedNode MachineId { get; set; }
#endif
public int? MachineId { get; set; }
/// <summary>
/// Instantiates a new <see cref="global::Marechai.App.Models.DocumentByMachineDto"/> and sets the default values.
/// </summary>
@@ -80,10 +62,10 @@ namespace Marechai.App.Models
return new Dictionary<string, Action<IParseNode>>
{
{ "document", n => { Document = n.GetStringValue(); } },
{ "document_id", n => { DocumentId = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "id", n => { Id = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "document_id", n => { DocumentId = n.GetLongValue(); } },
{ "id", n => { Id = n.GetLongValue(); } },
{ "machine", n => { Machine = n.GetStringValue(); } },
{ "machine_id", n => { MachineId = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "machine_id", n => { MachineId = n.GetIntValue(); } },
};
}
/// <summary>
@@ -94,10 +76,10 @@ namespace Marechai.App.Models
{
if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
writer.WriteStringValue("document", Document);
writer.WriteObjectValue<UntypedNode>("document_id", DocumentId);
writer.WriteObjectValue<UntypedNode>("id", Id);
writer.WriteLongValue("document_id", DocumentId);
writer.WriteLongValue("id", Id);
writer.WriteStringValue("machine", Machine);
writer.WriteObjectValue<UntypedNode>("machine_id", MachineId);
writer.WriteIntValue("machine_id", MachineId);
writer.WriteAdditionalData(AdditionalData);
}
}

View File

@@ -23,21 +23,9 @@ namespace Marechai.App.Models
public string Document { get; set; }
#endif
/// <summary>The document_id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? DocumentId { get; set; }
#nullable restore
#else
public UntypedNode DocumentId { get; set; }
#endif
public long? DocumentId { get; set; }
/// <summary>The id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? Id { get; set; }
#nullable restore
#else
public UntypedNode Id { get; set; }
#endif
public long? Id { get; set; }
/// <summary>The machine_family property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
@@ -47,13 +35,7 @@ namespace Marechai.App.Models
public string MachineFamily { get; set; }
#endif
/// <summary>The machine_family_id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? MachineFamilyId { get; set; }
#nullable restore
#else
public UntypedNode MachineFamilyId { get; set; }
#endif
public int? MachineFamilyId { get; set; }
/// <summary>
/// Instantiates a new <see cref="global::Marechai.App.Models.DocumentByMachineFamilyDto"/> and sets the default values.
/// </summary>
@@ -80,10 +62,10 @@ namespace Marechai.App.Models
return new Dictionary<string, Action<IParseNode>>
{
{ "document", n => { Document = n.GetStringValue(); } },
{ "document_id", n => { DocumentId = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "id", n => { Id = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "document_id", n => { DocumentId = n.GetLongValue(); } },
{ "id", n => { Id = n.GetLongValue(); } },
{ "machine_family", n => { MachineFamily = n.GetStringValue(); } },
{ "machine_family_id", n => { MachineFamilyId = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "machine_family_id", n => { MachineFamilyId = n.GetIntValue(); } },
};
}
/// <summary>
@@ -94,10 +76,10 @@ namespace Marechai.App.Models
{
if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
writer.WriteStringValue("document", Document);
writer.WriteObjectValue<UntypedNode>("document_id", DocumentId);
writer.WriteObjectValue<UntypedNode>("id", Id);
writer.WriteLongValue("document_id", DocumentId);
writer.WriteLongValue("id", Id);
writer.WriteStringValue("machine_family", MachineFamily);
writer.WriteObjectValue<UntypedNode>("machine_family_id", MachineFamilyId);
writer.WriteIntValue("machine_family_id", MachineFamilyId);
writer.WriteAdditionalData(AdditionalData);
}
}

View File

@@ -23,21 +23,9 @@ namespace Marechai.App.Models
public string Company { get; set; }
#endif
/// <summary>The company_id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? CompanyId { get; set; }
#nullable restore
#else
public UntypedNode CompanyId { get; set; }
#endif
public int? CompanyId { get; set; }
/// <summary>The id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? Id { get; set; }
#nullable restore
#else
public UntypedNode Id { get; set; }
#endif
public int? Id { get; set; }
/// <summary>The name property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
@@ -72,8 +60,8 @@ namespace Marechai.App.Models
return new Dictionary<string, Action<IParseNode>>
{
{ "company", n => { Company = n.GetStringValue(); } },
{ "company_id", n => { CompanyId = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "id", n => { Id = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "company_id", n => { CompanyId = n.GetIntValue(); } },
{ "id", n => { Id = n.GetIntValue(); } },
{ "name", n => { Name = n.GetStringValue(); } },
};
}
@@ -85,8 +73,8 @@ namespace Marechai.App.Models
{
if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
writer.WriteStringValue("company", Company);
writer.WriteObjectValue<UntypedNode>("company_id", CompanyId);
writer.WriteObjectValue<UntypedNode>("id", Id);
writer.WriteIntValue("company_id", CompanyId);
writer.WriteIntValue("id", Id);
writer.WriteStringValue("name", Name);
writer.WriteAdditionalData(AdditionalData);
}

View File

@@ -23,21 +23,9 @@ namespace Marechai.App.Models
public string Country { get; set; }
#endif
/// <summary>The country_id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? CountryId { get; set; }
#nullable restore
#else
public UntypedNode CountryId { get; set; }
#endif
public int? CountryId { get; set; }
/// <summary>The id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? Id { get; set; }
#nullable restore
#else
public UntypedNode Id { get; set; }
#endif
public long? Id { get; set; }
/// <summary>The native_title property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
@@ -90,8 +78,8 @@ namespace Marechai.App.Models
return new Dictionary<string, Action<IParseNode>>
{
{ "country", n => { Country = n.GetStringValue(); } },
{ "country_id", n => { CountryId = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "id", n => { Id = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "country_id", n => { CountryId = n.GetIntValue(); } },
{ "id", n => { Id = n.GetLongValue(); } },
{ "native_title", n => { NativeTitle = n.GetStringValue(); } },
{ "published", n => { Published = n.GetDateTimeOffsetValue(); } },
{ "synopsis", n => { Synopsis = n.GetStringValue(); } },
@@ -106,8 +94,8 @@ namespace Marechai.App.Models
{
if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
writer.WriteStringValue("country", Country);
writer.WriteObjectValue<UntypedNode>("country_id", CountryId);
writer.WriteObjectValue<UntypedNode>("id", Id);
writer.WriteIntValue("country_id", CountryId);
writer.WriteLongValue("id", Id);
writer.WriteStringValue("native_title", NativeTitle);
writer.WriteDateTimeOffsetValue("published", Published);
writer.WriteStringValue("synopsis", Synopsis);

View File

@@ -31,13 +31,7 @@ namespace Marechai.App.Models
public string DisplayName { get; set; }
#endif
/// <summary>The id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? Id { get; set; }
#nullable restore
#else
public UntypedNode Id { get; set; }
#endif
public int? Id { get; set; }
/// <summary>The name property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
@@ -55,13 +49,7 @@ namespace Marechai.App.Models
public string Person { get; set; }
#endif
/// <summary>The person_id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? PersonId { get; set; }
#nullable restore
#else
public UntypedNode PersonId { get; set; }
#endif
public int? PersonId { get; set; }
/// <summary>The surname property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
@@ -97,10 +85,10 @@ namespace Marechai.App.Models
{
{ "alias", n => { Alias = n.GetStringValue(); } },
{ "display_name", n => { DisplayName = n.GetStringValue(); } },
{ "id", n => { Id = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "id", n => { Id = n.GetIntValue(); } },
{ "name", n => { Name = n.GetStringValue(); } },
{ "person", n => { Person = n.GetStringValue(); } },
{ "person_id", n => { PersonId = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "person_id", n => { PersonId = n.GetIntValue(); } },
{ "surname", n => { Surname = n.GetStringValue(); } },
};
}
@@ -113,10 +101,10 @@ namespace Marechai.App.Models
if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
writer.WriteStringValue("alias", Alias);
writer.WriteStringValue("display_name", DisplayName);
writer.WriteObjectValue<UntypedNode>("id", Id);
writer.WriteIntValue("id", Id);
writer.WriteStringValue("name", Name);
writer.WriteStringValue("person", Person);
writer.WriteObjectValue<UntypedNode>("person_id", PersonId);
writer.WriteIntValue("person_id", PersonId);
writer.WriteStringValue("surname", Surname);
writer.WriteAdditionalData(AdditionalData);
}

View File

@@ -23,13 +23,7 @@ namespace Marechai.App.Models
public string Author { get; set; }
#endif
/// <summary>The colorspace property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public global::Marechai.App.Models.DocumentScanDto.DocumentScanDto_colorspace? Colorspace { get; set; }
#nullable restore
#else
public global::Marechai.App.Models.DocumentScanDto.DocumentScanDto_colorspace Colorspace { get; set; }
#endif
public int? Colorspace { get; set; }
/// <summary>The comments property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
@@ -49,13 +43,7 @@ namespace Marechai.App.Models
public string Document { get; set; }
#endif
/// <summary>The document_id property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? DocumentId { get; set; }
#nullable restore
#else
public UntypedNode DocumentId { get; set; }
#endif
public long? DocumentId { get; set; }
/// <summary>The exif_version property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
@@ -65,13 +53,7 @@ namespace Marechai.App.Models
public string ExifVersion { get; set; }
#endif
/// <summary>The horizontal_resolution property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? HorizontalResolution { get; set; }
#nullable restore
#else
public UntypedNode HorizontalResolution { get; set; }
#endif
public double? HorizontalResolution { get; set; }
/// <summary>The id property</summary>
public Guid? Id { get; set; }
/// <summary>The original_extension property</summary>
@@ -83,21 +65,9 @@ namespace Marechai.App.Models
public string OriginalExtension { get; set; }
#endif
/// <summary>The page property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? Page { get; set; }
#nullable restore
#else
public UntypedNode Page { get; set; }
#endif
public int? Page { get; set; }
/// <summary>The resolution_unit property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public global::Marechai.App.Models.DocumentScanDto.DocumentScanDto_resolution_unit? ResolutionUnit { get; set; }
#nullable restore
#else
public global::Marechai.App.Models.DocumentScanDto.DocumentScanDto_resolution_unit ResolutionUnit { get; set; }
#endif
public int? ResolutionUnit { get; set; }
/// <summary>The scanner_manufacturer property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
@@ -135,13 +105,7 @@ namespace Marechai.App.Models
public string UserId { get; set; }
#endif
/// <summary>The vertical_resolution property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public UntypedNode? VerticalResolution { get; set; }
#nullable restore
#else
public UntypedNode VerticalResolution { get; set; }
#endif
public double? VerticalResolution { get; set; }
/// <summary>
/// Instantiates a new <see cref="global::Marechai.App.Models.DocumentScanDto"/> and sets the default values.
/// </summary>
@@ -168,24 +132,24 @@ namespace Marechai.App.Models
return new Dictionary<string, Action<IParseNode>>
{
{ "author", n => { Author = n.GetStringValue(); } },
{ "colorspace", n => { Colorspace = n.GetObjectValue<global::Marechai.App.Models.DocumentScanDto.DocumentScanDto_colorspace>(global::Marechai.App.Models.DocumentScanDto.DocumentScanDto_colorspace.CreateFromDiscriminatorValue); } },
{ "colorspace", n => { Colorspace = n.GetIntValue(); } },
{ "comments", n => { Comments = n.GetStringValue(); } },
{ "creation_date", n => { CreationDate = n.GetDateTimeOffsetValue(); } },
{ "document", n => { Document = n.GetStringValue(); } },
{ "document_id", n => { DocumentId = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "document_id", n => { DocumentId = n.GetLongValue(); } },
{ "exif_version", n => { ExifVersion = n.GetStringValue(); } },
{ "horizontal_resolution", n => { HorizontalResolution = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "horizontal_resolution", n => { HorizontalResolution = n.GetDoubleValue(); } },
{ "id", n => { Id = n.GetGuidValue(); } },
{ "original_extension", n => { OriginalExtension = n.GetStringValue(); } },
{ "page", n => { Page = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "resolution_unit", n => { ResolutionUnit = n.GetObjectValue<global::Marechai.App.Models.DocumentScanDto.DocumentScanDto_resolution_unit>(global::Marechai.App.Models.DocumentScanDto.DocumentScanDto_resolution_unit.CreateFromDiscriminatorValue); } },
{ "page", n => { Page = n.GetIntValue(); } },
{ "resolution_unit", n => { ResolutionUnit = n.GetIntValue(); } },
{ "scanner_manufacturer", n => { ScannerManufacturer = n.GetStringValue(); } },
{ "scanner_model", n => { ScannerModel = n.GetStringValue(); } },
{ "software", n => { Software = n.GetStringValue(); } },
{ "type", n => { Type = n.GetIntValue(); } },
{ "upload_date", n => { UploadDate = n.GetDateTimeOffsetValue(); } },
{ "user_id", n => { UserId = n.GetStringValue(); } },
{ "vertical_resolution", n => { VerticalResolution = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
{ "vertical_resolution", n => { VerticalResolution = n.GetDoubleValue(); } },
};
}
/// <summary>
@@ -196,176 +160,26 @@ namespace Marechai.App.Models
{
if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
writer.WriteStringValue("author", Author);
writer.WriteObjectValue<global::Marechai.App.Models.DocumentScanDto.DocumentScanDto_colorspace>("colorspace", Colorspace);
writer.WriteIntValue("colorspace", Colorspace);
writer.WriteStringValue("comments", Comments);
writer.WriteDateTimeOffsetValue("creation_date", CreationDate);
writer.WriteStringValue("document", Document);
writer.WriteObjectValue<UntypedNode>("document_id", DocumentId);
writer.WriteLongValue("document_id", DocumentId);
writer.WriteStringValue("exif_version", ExifVersion);
writer.WriteObjectValue<UntypedNode>("horizontal_resolution", HorizontalResolution);
writer.WriteDoubleValue("horizontal_resolution", HorizontalResolution);
writer.WriteGuidValue("id", Id);
writer.WriteStringValue("original_extension", OriginalExtension);
writer.WriteObjectValue<UntypedNode>("page", Page);
writer.WriteObjectValue<global::Marechai.App.Models.DocumentScanDto.DocumentScanDto_resolution_unit>("resolution_unit", ResolutionUnit);
writer.WriteIntValue("page", Page);
writer.WriteIntValue("resolution_unit", ResolutionUnit);
writer.WriteStringValue("scanner_manufacturer", ScannerManufacturer);
writer.WriteStringValue("scanner_model", ScannerModel);
writer.WriteStringValue("software", Software);
writer.WriteIntValue("type", Type);
writer.WriteDateTimeOffsetValue("upload_date", UploadDate);
writer.WriteStringValue("user_id", UserId);
writer.WriteObjectValue<UntypedNode>("vertical_resolution", VerticalResolution);
writer.WriteDoubleValue("vertical_resolution", VerticalResolution);
writer.WriteAdditionalData(AdditionalData);
}
/// <summary>
/// Composed type wrapper for classes <see cref="global::Marechai.App.Models.ColorSpace"/>, <see cref="global::Marechai.App.Models.DocumentScanDto_colorspaceMember1"/>
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
public partial class DocumentScanDto_colorspace : IComposedTypeWrapper, IParsable
{
/// <summary>Composed type representation for type <see cref="global::Marechai.App.Models.ColorSpace"/></summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public global::Marechai.App.Models.ColorSpace? ColorSpace { get; set; }
#nullable restore
#else
public global::Marechai.App.Models.ColorSpace ColorSpace { get; set; }
#endif
/// <summary>Composed type representation for type <see cref="global::Marechai.App.Models.DocumentScanDto_colorspaceMember1"/></summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public global::Marechai.App.Models.DocumentScanDto_colorspaceMember1? DocumentScanDtoColorspaceMember1 { get; set; }
#nullable restore
#else
public global::Marechai.App.Models.DocumentScanDto_colorspaceMember1 DocumentScanDtoColorspaceMember1 { get; set; }
#endif
/// <summary>
/// Creates a new instance of the appropriate class based on discriminator value
/// </summary>
/// <returns>A <see cref="global::Marechai.App.Models.DocumentScanDto.DocumentScanDto_colorspace"/></returns>
/// <param name="parseNode">The parse node to use to read the discriminator value and create the object</param>
public static global::Marechai.App.Models.DocumentScanDto.DocumentScanDto_colorspace CreateFromDiscriminatorValue(IParseNode parseNode)
{
if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode));
var mappingValue = parseNode.GetChildNode("")?.GetStringValue();
var result = new global::Marechai.App.Models.DocumentScanDto.DocumentScanDto_colorspace();
if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase))
{
result.ColorSpace = new global::Marechai.App.Models.ColorSpace();
}
else if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase))
{
result.DocumentScanDtoColorspaceMember1 = new global::Marechai.App.Models.DocumentScanDto_colorspaceMember1();
}
return result;
}
/// <summary>
/// The deserialization information for the current model
/// </summary>
/// <returns>A IDictionary&lt;string, Action&lt;IParseNode&gt;&gt;</returns>
public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
{
if(ColorSpace != null)
{
return ColorSpace.GetFieldDeserializers();
}
else if(DocumentScanDtoColorspaceMember1 != null)
{
return DocumentScanDtoColorspaceMember1.GetFieldDeserializers();
}
return new Dictionary<string, Action<IParseNode>>();
}
/// <summary>
/// Serializes information the current object
/// </summary>
/// <param name="writer">Serialization writer to use to serialize this model</param>
public virtual void Serialize(ISerializationWriter writer)
{
if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
if(ColorSpace != null)
{
writer.WriteObjectValue<global::Marechai.App.Models.ColorSpace>(null, ColorSpace);
}
else if(DocumentScanDtoColorspaceMember1 != null)
{
writer.WriteObjectValue<global::Marechai.App.Models.DocumentScanDto_colorspaceMember1>(null, DocumentScanDtoColorspaceMember1);
}
}
}
/// <summary>
/// Composed type wrapper for classes <see cref="global::Marechai.App.Models.DocumentScanDto_resolution_unitMember1"/>, <see cref="global::Marechai.App.Models.ResolutionUnit"/>
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
public partial class DocumentScanDto_resolution_unit : IComposedTypeWrapper, IParsable
{
/// <summary>Composed type representation for type <see cref="global::Marechai.App.Models.DocumentScanDto_resolution_unitMember1"/></summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public global::Marechai.App.Models.DocumentScanDto_resolution_unitMember1? DocumentScanDtoResolutionUnitMember1 { get; set; }
#nullable restore
#else
public global::Marechai.App.Models.DocumentScanDto_resolution_unitMember1 DocumentScanDtoResolutionUnitMember1 { get; set; }
#endif
/// <summary>Composed type representation for type <see cref="global::Marechai.App.Models.ResolutionUnit"/></summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public global::Marechai.App.Models.ResolutionUnit? ResolutionUnit { get; set; }
#nullable restore
#else
public global::Marechai.App.Models.ResolutionUnit ResolutionUnit { get; set; }
#endif
/// <summary>
/// Creates a new instance of the appropriate class based on discriminator value
/// </summary>
/// <returns>A <see cref="global::Marechai.App.Models.DocumentScanDto.DocumentScanDto_resolution_unit"/></returns>
/// <param name="parseNode">The parse node to use to read the discriminator value and create the object</param>
public static global::Marechai.App.Models.DocumentScanDto.DocumentScanDto_resolution_unit CreateFromDiscriminatorValue(IParseNode parseNode)
{
if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode));
var mappingValue = parseNode.GetChildNode("")?.GetStringValue();
var result = new global::Marechai.App.Models.DocumentScanDto.DocumentScanDto_resolution_unit();
if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase))
{
result.DocumentScanDtoResolutionUnitMember1 = new global::Marechai.App.Models.DocumentScanDto_resolution_unitMember1();
}
else if("".Equals(mappingValue, StringComparison.OrdinalIgnoreCase))
{
result.ResolutionUnit = new global::Marechai.App.Models.ResolutionUnit();
}
return result;
}
/// <summary>
/// The deserialization information for the current model
/// </summary>
/// <returns>A IDictionary&lt;string, Action&lt;IParseNode&gt;&gt;</returns>
public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
{
if(DocumentScanDtoResolutionUnitMember1 != null)
{
return DocumentScanDtoResolutionUnitMember1.GetFieldDeserializers();
}
else if(ResolutionUnit != null)
{
return ResolutionUnit.GetFieldDeserializers();
}
return new Dictionary<string, Action<IParseNode>>();
}
/// <summary>
/// Serializes information the current object
/// </summary>
/// <param name="writer">Serialization writer to use to serialize this model</param>
public virtual void Serialize(ISerializationWriter writer)
{
if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
if(DocumentScanDtoResolutionUnitMember1 != null)
{
writer.WriteObjectValue<global::Marechai.App.Models.DocumentScanDto_resolution_unitMember1>(null, DocumentScanDtoResolutionUnitMember1);
}
else if(ResolutionUnit != null)
{
writer.WriteObjectValue<global::Marechai.App.Models.ResolutionUnit>(null, ResolutionUnit);
}
}
}
}
}
#pragma warning restore CS0618

Some files were not shown because too many files have changed in this diff Show More