diff --git a/Marechai.Data/Dtos/BaseDto.cs b/Marechai.Data/Dtos/BaseDto.cs index 9cf69dee..5b1465dc 100644 --- a/Marechai.Data/Dtos/BaseDto.cs +++ b/Marechai.Data/Dtos/BaseDto.cs @@ -23,9 +23,14 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class BaseDto { - public TKey Id; + [JsonPropertyName("id")] + [Required] + public TKey Id { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/BasePhotoDto.cs b/Marechai.Data/Dtos/BasePhotoDto.cs index 48ce4880..ff0d7274 100644 --- a/Marechai.Data/Dtos/BasePhotoDto.cs +++ b/Marechai.Data/Dtos/BasePhotoDto.cs @@ -23,47 +23,85 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; using Marechai.Database; namespace Marechai.Data.Dtos; public class BasePhotoDto : BaseDto { - public double? Aperture { get; set; } - public string Author { get; set; } - public string CameraManufacturer { get; set; } - public string CameraModel { get; set; } - public ColorSpace? ColorSpace { get; set; } - public string Comments { get; set; } - public Contrast? Contrast { get; set; } - public DateTime? CreationDate { get; set; } - public double? DigitalZoomRatio { get; set; } - public string ExifVersion { get; set; } - public double? ExposureTime { get; set; } - public ExposureMode? ExposureMethod { get; set; } - public ExposureProgram? ExposureProgram { get; set; } - public Flash? Flash { get; set; } - public double? Focal { get; set; } - public double? FocalLength { get; set; } - public double? FocalLengthEquivalent { get; set; } - public double? HorizontalResolution { get; set; } - public ushort? IsoRating { get; set; } - public string Lens { get; set; } - public LightSource? LightSource { get; set; } - public MeteringMode? MeteringMode { get; set; } - public ResolutionUnit? ResolutionUnit { get; set; } - public Orientation? Orientation { get; set; } - public Saturation? Saturation { get; set; } - public SceneCaptureType? SceneCaptureType { get; set; } - public SensingMethod? SensingMethod { get; set; } - public Sharpness? Sharpness { get; set; } - public string SoftwareUsed { get; set; } - public SubjectDistanceRange? SubjectDistanceRange { get; set; } - public DateTime UploadDate { get; set; } - public double? VerticalResolution { get; set; } - public WhiteBalance? WhiteBalance { get; set; } - public string UserId { get; set; } - public string LicenseName { get; set; } - public int LicenseId { get; set; } - public string OriginalExtension { get; set; } + [JsonPropertyName("aperture")] + public double? Aperture { get; set; } + [JsonPropertyName("author")] + public string Author { get; set; } + [JsonPropertyName("camera_manufacturer")] + public string CameraManufacturer { get; set; } + [JsonPropertyName("camera_model")] + public string CameraModel { get; set; } + [JsonPropertyName("colorspace")] + public ColorSpace? ColorSpace { get; set; } + [JsonPropertyName("comments")] + public string Comments { get; set; } + [JsonPropertyName("contrast")] + public Contrast? Contrast { get; set; } + [JsonPropertyName("creation_date")] + public DateTime? CreationDate { get; set; } + [JsonPropertyName("digital_zoom")] + public double? DigitalZoomRatio { get; set; } + [JsonPropertyName("exif_version")] + public string ExifVersion { get; set; } + [JsonPropertyName("exposure")] + public double? ExposureTime { get; set; } + [JsonPropertyName("exposure_method")] + public ExposureMode? ExposureMethod { get; set; } + [JsonPropertyName("exposure_program")] + public ExposureProgram? ExposureProgram { get; set; } + [JsonPropertyName("flash")] + public Flash? Flash { get; set; } + [JsonPropertyName("focal")] + public double? Focal { get; set; } + [JsonPropertyName("focal_length")] + public double? FocalLength { get; set; } + [JsonPropertyName("focal_equivalent")] + public double? FocalLengthEquivalent { get; set; } + [JsonPropertyName("horizontal_resolution")] + public double? HorizontalResolution { get; set; } + [JsonPropertyName("iso")] + public ushort? IsoRating { get; set; } + [JsonPropertyName("lens")] + public string Lens { get; set; } + [JsonPropertyName("light_source")] + public LightSource? LightSource { get; set; } + [JsonPropertyName("metering_mode")] + public MeteringMode? MeteringMode { get; set; } + [JsonPropertyName("resolution_unit")] + public ResolutionUnit? ResolutionUnit { get; set; } + [JsonPropertyName("orientation")] + public Orientation? Orientation { get; set; } + [JsonPropertyName("saturation")] + public Saturation? Saturation { get; set; } + [JsonPropertyName("scene_capture_type")] + public SceneCaptureType? SceneCaptureType { get; set; } + [JsonPropertyName("sensing_method")] + public SensingMethod? SensingMethod { get; set; } + [JsonPropertyName("sharpness")] + public Sharpness? Sharpness { get; set; } + [JsonPropertyName("software")] + public string SoftwareUsed { get; set; } + [JsonPropertyName("subject_distance_range")] + public SubjectDistanceRange? SubjectDistanceRange { get; set; } + [JsonPropertyName("upload_date")] + public DateTime UploadDate { get; set; } + [JsonPropertyName("vertical_resolution")] + public double? VerticalResolution { get; set; } + [JsonPropertyName("white_balance")] + public WhiteBalance? WhiteBalance { get; set; } + [JsonPropertyName("user_id")] + public string UserId { get; set; } + [JsonPropertyName("license_name")] + public string LicenseName { get; set; } + [JsonPropertyName("license_id")] + public int LicenseId { get; set; } + [JsonPropertyName("original_extension")] + public string OriginalExtension { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/BaseScanDto.cs b/Marechai.Data/Dtos/BaseScanDto.cs index 1afbe5c0..8ecc59e2 100644 --- a/Marechai.Data/Dtos/BaseScanDto.cs +++ b/Marechai.Data/Dtos/BaseScanDto.cs @@ -23,24 +23,39 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; using Marechai.Database; namespace Marechai.Data.Dtos; public class BaseScanDto : BaseDto { - public string Author { get; set; } - public ColorSpace? ColorSpace { get; set; } - public string Comments { get; set; } - public DateTime? CreationDate { get; set; } - public string ExifVersion { get; set; } - public double? HorizontalResolution { get; set; } - public ResolutionUnit? ResolutionUnit { get; set; } - public string ScannerManufacturer { get; set; } - public string ScannerModel { get; set; } - public string SoftwareUsed { get; set; } - public DateTime UploadDate { get; set; } - public double? VerticalResolution { get; set; } - public string OriginalExtension { get; set; } - public string UserId { get; set; } + [JsonPropertyName("author")] + public string Author { get; set; } + [JsonPropertyName("colorspace")] + public ColorSpace? ColorSpace { get; set; } + [JsonPropertyName("comments")] + public string Comments { get; set; } + [JsonPropertyName("creation_date")] + public DateTime? CreationDate { get; set; } + [JsonPropertyName("exif_version")] + public string ExifVersion { get; set; } + [JsonPropertyName("horizontal_resolution")] + public double? HorizontalResolution { get; set; } + [JsonPropertyName("resolution_unit")] + public ResolutionUnit? ResolutionUnit { get; set; } + [JsonPropertyName("scanner_manufacturer")] + public string ScannerManufacturer { get; set; } + [JsonPropertyName("scanner_model")] + public string ScannerModel { get; set; } + [JsonPropertyName("software")] + public string SoftwareUsed { get; set; } + [JsonPropertyName("upload_date")] + public DateTime UploadDate { get; set; } + [JsonPropertyName("vertical_resolution")] + public double? VerticalResolution { get; set; } + [JsonPropertyName("original_extension")] + public string OriginalExtension { get; set; } + [JsonPropertyName("user_id")] + public string UserId { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/BookByMachineDto.cs b/Marechai.Data/Dtos/BookByMachineDto.cs index 258b0c2e..0b991186 100644 --- a/Marechai.Data/Dtos/BookByMachineDto.cs +++ b/Marechai.Data/Dtos/BookByMachineDto.cs @@ -23,12 +23,18 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class BookByMachineDto : BaseDto { - public long BookId { get; set; } - public string Book { get; set; } - public int MachineId { get; set; } - public string Machine { get; set; } + [JsonPropertyName("book_id")] + public long BookId { get; set; } + [JsonPropertyName("book")] + public string Book { get; set; } + [JsonPropertyName("machine_id")] + public int MachineId { get; set; } + [JsonPropertyName("machine")] + public string Machine { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/BookByMachineFamilyDto.cs b/Marechai.Data/Dtos/BookByMachineFamilyDto.cs index 4d0cf3ef..62ec9709 100644 --- a/Marechai.Data/Dtos/BookByMachineFamilyDto.cs +++ b/Marechai.Data/Dtos/BookByMachineFamilyDto.cs @@ -23,12 +23,18 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class BookByMachineFamilyDto : BaseDto { - public long BookId { get; set; } - public string Book { get; set; } - public int MachineFamilyId { get; set; } - public string MachineFamily { get; set; } + [JsonPropertyName("book_id")] + public long BookId { get; set; } + [JsonPropertyName("book")] + public string Book { get; set; } + [JsonPropertyName("machine_family_id")] + public int MachineFamilyId { get; set; } + [JsonPropertyName("machine_family")] + public string MachineFamily { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/BookDto.cs b/Marechai.Data/Dtos/BookDto.cs index 5cf7ae28..8b45eadb 100644 --- a/Marechai.Data/Dtos/BookDto.cs +++ b/Marechai.Data/Dtos/BookDto.cs @@ -1,10 +1,17 @@ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class BookDto : DocumentBaseDto { - public string Isbn { get; set; } - public short? Pages { get; set; } - public int? Edition { get; set; } - public long? PreviousId { get; set; } - public long? SourceId { get; set; } + [JsonPropertyName("isbn")] + public string Isbn { get; set; } + [JsonPropertyName("pages")] + public short? Pages { get; set; } + [JsonPropertyName("edition")] + public int? Edition { get; set; } + [JsonPropertyName("previous_id")] + public long? PreviousId { get; set; } + [JsonPropertyName("source_id")] + public long? SourceId { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/BookScanDto.cs b/Marechai.Data/Dtos/BookScanDto.cs index 1aed72cd..6a384df9 100644 --- a/Marechai.Data/Dtos/BookScanDto.cs +++ b/Marechai.Data/Dtos/BookScanDto.cs @@ -23,10 +23,14 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class BookScanDto : DocumentScanBaseDto { - public long BookId { get; set; } - public string Book { get; set; } + [JsonPropertyName("book_id")] + public long BookId { get; set; } + [JsonPropertyName("book")] + public string Book { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/CompanyByBookDto.cs b/Marechai.Data/Dtos/CompanyByBookDto.cs index acab159c..21f2f087 100644 --- a/Marechai.Data/Dtos/CompanyByBookDto.cs +++ b/Marechai.Data/Dtos/CompanyByBookDto.cs @@ -23,13 +23,20 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class CompanyByBookDto : BaseDto { - public int CompanyId { get; set; } - public long BookId { get; set; } - public string RoleId { get; set; } - public string Company { get; set; } - public string Role { get; set; } + [JsonPropertyName("company_id")] + public int CompanyId { get; set; } + [JsonPropertyName("book_id")] + public long BookId { get; set; } + [JsonPropertyName("role_id")] + public string RoleId { get; set; } + [JsonPropertyName("company")] + public string Company { get; set; } + [JsonPropertyName("role")] + public string Role { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/CompanyByDocumentDto.cs b/Marechai.Data/Dtos/CompanyByDocumentDto.cs index 98bbfa24..48e279e4 100644 --- a/Marechai.Data/Dtos/CompanyByDocumentDto.cs +++ b/Marechai.Data/Dtos/CompanyByDocumentDto.cs @@ -23,13 +23,20 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class CompanyByDocumentDto : BaseDto { - public int CompanyId { get; set; } - public long DocumentId { get; set; } - public string RoleId { get; set; } - public string Company { get; set; } - public string Role { get; set; } + [JsonPropertyName("company_id")] + public int CompanyId { get; set; } + [JsonPropertyName("document_id")] + public long DocumentId { get; set; } + [JsonPropertyName("role_id")] + public string RoleId { get; set; } + [JsonPropertyName("company")] + public string Company { get; set; } + [JsonPropertyName("role")] + public string Role { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/CompanyByMagazineDto.cs b/Marechai.Data/Dtos/CompanyByMagazineDto.cs index 2545d57f..03c7d1d8 100644 --- a/Marechai.Data/Dtos/CompanyByMagazineDto.cs +++ b/Marechai.Data/Dtos/CompanyByMagazineDto.cs @@ -23,13 +23,20 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class CompanyByMagazineDto : BaseDto { - public int CompanyId { get; set; } - public long MagazineId { get; set; } - public string RoleId { get; set; } - public string Company { get; set; } - public string Role { get; set; } + [JsonPropertyName("company_id")] + public int CompanyId { get; set; } + [JsonPropertyName("magazine_id")] + public long MagazineId { get; set; } + [JsonPropertyName("role_id")] + public string RoleId { get; set; } + [JsonPropertyName("company")] + public string Company { get; set; } + [JsonPropertyName("role")] + public string Role { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/CompanyBySoftwareFamilyDto.cs b/Marechai.Data/Dtos/CompanyBySoftwareFamilyDto.cs index 85728605..dde7c7bc 100644 --- a/Marechai.Data/Dtos/CompanyBySoftwareFamilyDto.cs +++ b/Marechai.Data/Dtos/CompanyBySoftwareFamilyDto.cs @@ -23,13 +23,20 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class CompanyBySoftwareFamilyDto : BaseDto { - public int CompanyId { get; set; } - public ulong SoftwareFamilyId { get; set; } - public string RoleId { get; set; } - public string Company { get; set; } - public string Role { get; set; } + [JsonPropertyName("company_id")] + public int CompanyId { get; set; } + [JsonPropertyName("software_family_id")] + public ulong SoftwareFamilyId { get; set; } + [JsonPropertyName("role_id")] + public string RoleId { get; set; } + [JsonPropertyName("company")] + public string Company { get; set; } + [JsonPropertyName("role")] + public string Role { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/CompanyBySoftwareVariantDto.cs b/Marechai.Data/Dtos/CompanyBySoftwareVariantDto.cs index 40695b50..a02bd723 100644 --- a/Marechai.Data/Dtos/CompanyBySoftwareVariantDto.cs +++ b/Marechai.Data/Dtos/CompanyBySoftwareVariantDto.cs @@ -23,13 +23,20 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class CompanyBySoftwareVariantDto : BaseDto { - public int CompanyId { get; set; } - public ulong SoftwareVariantId { get; set; } - public string RoleId { get; set; } - public string Company { get; set; } - public string Role { get; set; } + [JsonPropertyName("company_id")] + public int CompanyId { get; set; } + [JsonPropertyName("software_variant_id")] + public ulong SoftwareVariantId { get; set; } + [JsonPropertyName("role_id")] + public string RoleId { get; set; } + [JsonPropertyName("company")] + public string Company { get; set; } + [JsonPropertyName("role")] + public string Role { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/CompanyBySoftwareVersionDto.cs b/Marechai.Data/Dtos/CompanyBySoftwareVersionDto.cs index 098334fa..26b40c57 100644 --- a/Marechai.Data/Dtos/CompanyBySoftwareVersionDto.cs +++ b/Marechai.Data/Dtos/CompanyBySoftwareVersionDto.cs @@ -23,13 +23,20 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class CompanyBySoftwareVersionDto : BaseDto { - public int CompanyId { get; set; } - public ulong SoftwareVersionId { get; set; } - public string RoleId { get; set; } - public string Company { get; set; } - public string Role { get; set; } + [JsonPropertyName("company_id")] + public int CompanyId { get; set; } + [JsonPropertyName("software_version_id")] + public ulong SoftwareVersionId { get; set; } + [JsonPropertyName("role_id")] + public string RoleId { get; set; } + [JsonPropertyName("company")] + public string Company { get; set; } + [JsonPropertyName("role")] + public string Role { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/CompanyDescriptionDto.cs b/Marechai.Data/Dtos/CompanyDescriptionDto.cs index 47d032f2..45ac17a2 100644 --- a/Marechai.Data/Dtos/CompanyDescriptionDto.cs +++ b/Marechai.Data/Dtos/CompanyDescriptionDto.cs @@ -23,11 +23,16 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class CompanyDescriptionDto : BaseDto { - public string Markdown { get; set; } - public string Html { get; set; } - public int CompanyId { get; set; } + [JsonPropertyName("markdown")] + public string Markdown { get; set; } + [JsonPropertyName("html")] + public string Html { get; set; } + [JsonPropertyName("company_id")] + public int CompanyId { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/CompanyDto.cs b/Marechai.Data/Dtos/CompanyDto.cs index 289ded64..4e83ecf0 100644 --- a/Marechai.Data/Dtos/CompanyDto.cs +++ b/Marechai.Data/Dtos/CompanyDto.cs @@ -23,34 +23,58 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; +using System.Text.Json.Serialization; using Marechai.Database; namespace Marechai.Data.Dtos; public class CompanyDto : BaseDto { - public string Name { get; set; } - public DateTime? Founded { get; set; } - public string Website { get; set; } - public string Twitter { get; set; } - public string Facebook { get; set; } - public DateTime? Sold { get; set; } - public int? SoldToId { get; set; } - public string Address { get; set; } - public string City { get; set; } - public string Province { get; set; } - public string PostalCode { get; set; } - public short? CountryId { get; set; } - public CompanyStatus Status { get; set; } - public Guid? LastLogo { get; set; } - public string SoldTo { get; set; } - public string Country { get; set; } - public bool FoundedDayIsUnknown { get; set; } - public bool FoundedMonthIsUnknown { get; set; } - public bool SoldDayIsUnknown { get; set; } - public bool SoldMonthIsUnknown { get; set; } - public string LegalName { get; set; } - + [JsonPropertyName("name")] + [Required] + public string Name { get; set; } + [JsonPropertyName("founded")] + public DateTime? Founded { get; set; } + [JsonPropertyName("website")] + public string Website { get; set; } + [JsonPropertyName("twitter")] + public string Twitter { get; set; } + [JsonPropertyName("facebook")] + public string Facebook { get; set; } + [JsonPropertyName("sold")] + public DateTime? Sold { get; set; } + [JsonPropertyName("sold_to_id")] + public int? SoldToId { get; set; } + [JsonPropertyName("address")] + public string Address { get; set; } + [JsonPropertyName("city")] + public string City { get; set; } + [JsonPropertyName("province")] + public string Province { get; set; } + [JsonPropertyName("postal_code")] + public string PostalCode { get; set; } + [JsonPropertyName("country_id")] + public short? CountryId { get; set; } + [JsonPropertyName("status")] + public CompanyStatus Status { get; set; } + [JsonPropertyName("last_logo")] + public Guid? LastLogo { get; set; } + [JsonPropertyName("sold_to")] + public string SoldTo { get; set; } + [JsonPropertyName("country")] + public string Country { get; set; } + [JsonPropertyName("founded_day_is_unknown")] + public bool FoundedDayIsUnknown { get; set; } + [JsonPropertyName("founded_month_is_unknown")] + public bool FoundedMonthIsUnknown { get; set; } + [JsonPropertyName("sold_day_is_unknown")] + public bool SoldDayIsUnknown { get; set; } + [JsonPropertyName("sold_month_is_unknown")] + public bool SoldMonthIsUnknown { get; set; } + [JsonPropertyName("legal_name")] + public string LegalName { get; set; } + [JsonIgnore] public string SoldView => Status != CompanyStatus.Active && Status != CompanyStatus.Unknown ? Sold?.ToShortDateString() ?? "Unknown" : Sold?.ToShortDateString() ?? (SoldTo is null ? "" : "Unknown"); diff --git a/Marechai.Data/Dtos/CurrencyInflationDto.cs b/Marechai.Data/Dtos/CurrencyInflationDto.cs index 9e6d78fe..ded02575 100644 --- a/Marechai.Data/Dtos/CurrencyInflationDto.cs +++ b/Marechai.Data/Dtos/CurrencyInflationDto.cs @@ -23,12 +23,18 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class CurrencyInflationDto : BaseDto { + [JsonPropertyName("code")] public string CurrencyCode { get; set; } + [JsonPropertyName("name")] public string CurrencyName { get; set; } - public uint Year { get; set; } - public float Inflation { get; set; } + [JsonPropertyName("year")] + public uint Year { get; set; } + [JsonPropertyName("inflation")] + public float Inflation { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/CurrencyPeggingDto.cs b/Marechai.Data/Dtos/CurrencyPeggingDto.cs index 569be640..e116c50c 100644 --- a/Marechai.Data/Dtos/CurrencyPeggingDto.cs +++ b/Marechai.Data/Dtos/CurrencyPeggingDto.cs @@ -23,15 +23,24 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class CurrencyPeggingDto : BaseDto { - public string SourceCode { get; set; } - public string DestinationCode { get; set; } - public string SourceName { get; set; } - public string DestinationName { get; set; } - public float Ratio { get; set; } - public DateTime Start { get; set; } - public DateTime? End { get; set; } + [JsonPropertyName("source_code")] + public string SourceCode { get; set; } + [JsonPropertyName("destination_code")] + public string DestinationCode { get; set; } + [JsonPropertyName("source_name")] + public string SourceName { get; set; } + [JsonPropertyName("destination_name")] + public string DestinationName { get; set; } + [JsonPropertyName("ratio")] + public float Ratio { get; set; } + [JsonPropertyName("start")] + public DateTime Start { get; set; } + [JsonPropertyName("end")] + public DateTime? End { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/DocumentBaseDto.cs b/Marechai.Data/Dtos/DocumentBaseDto.cs index 32aed6e1..99d7aaa1 100644 --- a/Marechai.Data/Dtos/DocumentBaseDto.cs +++ b/Marechai.Data/Dtos/DocumentBaseDto.cs @@ -1,11 +1,19 @@ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public abstract class DocumentBaseDto : BaseDto { - public string Title { get; set; } - public string NativeTitle { get; set; } - public DateTime? Published { get; set; } - public short? CountryId { get; set; } - public string Country { get; set; } - public string Synopsis { get; set; } + [JsonPropertyName("title")] + public string Title { get; set; } + [JsonPropertyName("native_title")] + public string NativeTitle { get; set; } + [JsonPropertyName("published")] + public DateTime? Published { get; set; } + [JsonPropertyName("country_id")] + public short? CountryId { get; set; } + [JsonPropertyName("country")] + public string Country { get; set; } + [JsonPropertyName("synopsis")] + public string Synopsis { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/DocumentByMachineDto.cs b/Marechai.Data/Dtos/DocumentByMachineDto.cs index ec706a09..0ed4b9d0 100644 --- a/Marechai.Data/Dtos/DocumentByMachineDto.cs +++ b/Marechai.Data/Dtos/DocumentByMachineDto.cs @@ -23,12 +23,18 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class DocumentByMachineDto : BaseDto { - public long DocumentId { get; set; } - public string Document { get; set; } - public int MachineId { get; set; } - public string Machine { get; set; } + [JsonPropertyName("document_id")] + public long DocumentId { get; set; } + [JsonPropertyName("document")] + public string Document { get; set; } + [JsonPropertyName("machine_id")] + public int MachineId { get; set; } + [JsonPropertyName("machine")] + public string Machine { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/DocumentByMachineFamilyDto.cs b/Marechai.Data/Dtos/DocumentByMachineFamilyDto.cs index ab210015..a6884eef 100644 --- a/Marechai.Data/Dtos/DocumentByMachineFamilyDto.cs +++ b/Marechai.Data/Dtos/DocumentByMachineFamilyDto.cs @@ -23,12 +23,18 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class DocumentByMachineFamilyDto : BaseDto { - public long DocumentId { get; set; } - public string Document { get; set; } - public int MachineFamilyId { get; set; } - public string MachineFamily { get; set; } + [JsonPropertyName("document_id")] + public long DocumentId { get; set; } + [JsonPropertyName("document")] + public string Document { get; set; } + [JsonPropertyName("machine_family_id")] + public int MachineFamilyId { get; set; } + [JsonPropertyName("machine_family")] + public string MachineFamily { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/DocumentCompanyDto.cs b/Marechai.Data/Dtos/DocumentCompanyDto.cs index 3a4997a9..9c3eea03 100644 --- a/Marechai.Data/Dtos/DocumentCompanyDto.cs +++ b/Marechai.Data/Dtos/DocumentCompanyDto.cs @@ -24,13 +24,17 @@ *******************************************************************************/ using System.ComponentModel; +using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; public class DocumentCompanyDto : BaseDto { + [JsonPropertyName("name")] public string Name { get; set; } [DisplayName("Linked company")] + [JsonPropertyName("company")] public string Company { get; set; } + [JsonPropertyName("company_id")] public int? CompanyId { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/DocumentPersonDto.cs b/Marechai.Data/Dtos/DocumentPersonDto.cs index f11c2a34..bc949b61 100644 --- a/Marechai.Data/Dtos/DocumentPersonDto.cs +++ b/Marechai.Data/Dtos/DocumentPersonDto.cs @@ -23,16 +23,25 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class DocumentPersonDto : BaseDto { - public string Name { get; set; } - public string Person { get; set; } - public int? PersonId { get; set; } - public string Alias { get; set; } - public string Surname { get; set; } + [JsonPropertyName("name")] + public string Name { get; set; } + [JsonPropertyName("person")] + public string Person { get; set; } + [JsonPropertyName("person_id")] + public int? PersonId { get; set; } + [JsonPropertyName("alias")] + public string Alias { get; set; } + [JsonPropertyName("surname")] + public string Surname { get; set; } + [JsonPropertyName("display_name")] public string DisplayName { get; set; } + [JsonIgnore] public string FullName => DisplayName ?? Alias ?? $"{Name} {Surname}"; } \ No newline at end of file diff --git a/Marechai.Data/Dtos/DocumentRoleDto.cs b/Marechai.Data/Dtos/DocumentRoleDto.cs index 50b5b5d5..a61ed16d 100644 --- a/Marechai.Data/Dtos/DocumentRoleDto.cs +++ b/Marechai.Data/Dtos/DocumentRoleDto.cs @@ -23,10 +23,14 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class DocumentRoleDto : BaseDto { - public string Name { get; set; } - public bool Enabled { get; set; } + [JsonPropertyName("name")] + public string Name { get; set; } + [JsonPropertyName("enabled")] + public bool Enabled { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/DocumentScanBaseDto.cs b/Marechai.Data/Dtos/DocumentScanBaseDto.cs index 44a64a47..f7c17d3b 100644 --- a/Marechai.Data/Dtos/DocumentScanBaseDto.cs +++ b/Marechai.Data/Dtos/DocumentScanBaseDto.cs @@ -23,12 +23,15 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; using Marechai.Database; namespace Marechai.Data.Dtos; public class DocumentScanBaseDto : BaseScanDto { + [JsonPropertyName("type")] public DocumentScanType Type { get; set; } - public uint? Page { get; set; } + [JsonPropertyName("page")] + public uint? Page { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/DocumentScanDto.cs b/Marechai.Data/Dtos/DocumentScanDto.cs index f43cb78c..3872353f 100644 --- a/Marechai.Data/Dtos/DocumentScanDto.cs +++ b/Marechai.Data/Dtos/DocumentScanDto.cs @@ -23,10 +23,14 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class DocumentScanDto : DocumentScanBaseDto { - public long DocumentId { get; set; } - public string Document { get; set; } + [JsonPropertyName("document_id")] + public long DocumentId { get; set; } + [JsonPropertyName("document")] + public string Document { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/DumpDto.cs b/Marechai.Data/Dtos/DumpDto.cs index 01f405ad..73c130fe 100644 --- a/Marechai.Data/Dtos/DumpDto.cs +++ b/Marechai.Data/Dtos/DumpDto.cs @@ -23,16 +23,26 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class DumpDto : BaseDto { - public string Dumper { get; set; } - public string UserId { get; set; } - public string DumpingGroup { get; set; } - public DateTime? DumpDate { get; set; } - public string UserName { get; set; } - public ulong MediaId { get; set; } - public string MediaTitle { get; set; } - public ulong MediaDumpId { get; set; } + [JsonPropertyName("dumper")] + public string Dumper { get; set; } + [JsonPropertyName("user_id")] + public string UserId { get; set; } + [JsonPropertyName("dumping_group")] + public string DumpingGroup { get; set; } + [JsonPropertyName("dump_date")] + public DateTime? DumpDate { get; set; } + [JsonPropertyName("username")] + public string UserName { get; set; } + [JsonPropertyName("media_id")] + public ulong MediaId { get; set; } + [JsonPropertyName("media_title")] + public string MediaTitle { get; set; } + [JsonPropertyName("media_dump_id")] + public ulong MediaDumpId { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/GpuByMachineDto.cs b/Marechai.Data/Dtos/GpuByMachineDto.cs index cd37ef98..e6332525 100644 --- a/Marechai.Data/Dtos/GpuByMachineDto.cs +++ b/Marechai.Data/Dtos/GpuByMachineDto.cs @@ -23,12 +23,18 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class GpuByMachineDto : BaseDto { - public int GpuId { get; set; } - public int MachineId { get; set; } + [JsonPropertyName("gpu_id")] + public int GpuId { get; set; } + [JsonPropertyName("machine_id")] + public int MachineId { get; set; } + [JsonPropertyName("company")] public string CompanyName { get; set; } - public string Name { get; set; } + [JsonPropertyName("name")] + public string Name { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/GpuDto.cs b/Marechai.Data/Dtos/GpuDto.cs index 22e9c88e..a278febc 100644 --- a/Marechai.Data/Dtos/GpuDto.cs +++ b/Marechai.Data/Dtos/GpuDto.cs @@ -23,20 +23,32 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class GpuDto : BaseDto { - public string Name { get; set; } - public int? CompanyId { get; set; } - public string Company { get; set; } - public string ModelCode { get; set; } - public DateTime? Introduced { get; set; } - public string Package { get; set; } - public string Process { get; set; } - public float? ProcessNm { get; set; } - public float? DieSize { get; set; } - public long? Transistors { get; set; } - + [JsonPropertyName("name")] + public string Name { get; set; } + [JsonPropertyName("company_id")] + public int? CompanyId { get; set; } + [JsonPropertyName("company")] + public string Company { get; set; } + [JsonPropertyName("model_code")] + public string ModelCode { get; set; } + [JsonPropertyName("introduced")] + public DateTime? Introduced { get; set; } + [JsonPropertyName("package")] + public string Package { get; set; } + [JsonPropertyName("process")] + public string Process { get; set; } + [JsonPropertyName("process_nm")] + public float? ProcessNm { get; set; } + [JsonPropertyName("die_size")] + public float? DieSize { get; set; } + [JsonPropertyName("transistors")] + public long? Transistors { get; set; } + [JsonIgnore] public string IntroducedView => Introduced?.ToShortDateString() ?? "Unknown"; } \ No newline at end of file diff --git a/Marechai.Data/Dtos/InstructionSetExtensionByProcessorDto.cs b/Marechai.Data/Dtos/InstructionSetExtensionByProcessorDto.cs index c7906289..7c0d4032 100644 --- a/Marechai.Data/Dtos/InstructionSetExtensionByProcessorDto.cs +++ b/Marechai.Data/Dtos/InstructionSetExtensionByProcessorDto.cs @@ -23,12 +23,18 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class InstructionSetExtensionByProcessorDto : BaseDto { - public string Extension { get; set; } - public string Processor { get; set; } - public int ProcessorId { get; set; } - public int ExtensionId { get; set; } + [JsonPropertyName("extensions")] + public string Extension { get; set; } + [JsonPropertyName("processor")] + public string Processor { get; set; } + [JsonPropertyName("processor_id")] + public int ProcessorId { get; set; } + [JsonPropertyName("extension_id")] + public int ExtensionId { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/MachineDto.cs b/Marechai.Data/Dtos/MachineDto.cs index d634a3b7..09b0be37 100644 --- a/Marechai.Data/Dtos/MachineDto.cs +++ b/Marechai.Data/Dtos/MachineDto.cs @@ -23,27 +23,39 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; using Marechai.Database; namespace Marechai.Data.Dtos; public class MachineDto : BaseDto { - public string Name { get; set; } - public string Model { get; set; } - public int CompanyId { get; set; } - public Guid? CompanyLogo { get; set; } - public DateTime? Introduced { get; set; } - public int? FamilyId { get; set; } - public string FamilyName { get; set; } + [JsonPropertyName("name")] + public string Name { get; set; } + [JsonPropertyName("model")] + public string Model { get; set; } + [JsonPropertyName("company_id")] + public int CompanyId { get; set; } + [JsonPropertyName("company_logo")] + public Guid? CompanyLogo { get; set; } + [JsonPropertyName("introduced")] + public DateTime? Introduced { get; set; } + [JsonPropertyName("family_id")] + public int? FamilyId { get; set; } + [JsonPropertyName("family_name")] + public string FamilyName { get; set; } public List Gpus { get; set; } public List Memory { get; set; } public List Processors { get; set; } public List SoundSynthesizers { get; set; } public List Storage { get; set; } - public string Company { get; set; } - public MachineType Type { get; set; } - public string Family { get; set; } + [JsonPropertyName("company")] + public string Company { get; set; } + [JsonPropertyName("type")] + public MachineType Type { get; set; } + [JsonPropertyName("family")] + public string Family { get; set; } + [JsonIgnore] public string IntroducedView => Introduced?.Year == 1000 ? "Prototype" : Introduced?.ToShortDateString() ?? "Unknown"; } \ No newline at end of file diff --git a/Marechai.Data/Dtos/MachineFamilyDto.cs b/Marechai.Data/Dtos/MachineFamilyDto.cs index 33b77f28..f479016c 100644 --- a/Marechai.Data/Dtos/MachineFamilyDto.cs +++ b/Marechai.Data/Dtos/MachineFamilyDto.cs @@ -23,11 +23,16 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class MachineFamilyDto : BaseDto { - public string Company { get; set; } - public string Name { get; set; } - public int CompanyId { get; set; } + [JsonPropertyName("company")] + public string Company { get; set; } + [JsonPropertyName("name")] + public string Name { get; set; } + [JsonPropertyName("company_id")] + public int CompanyId { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/MachinePhotoDto.cs b/Marechai.Data/Dtos/MachinePhotoDto.cs index 862af62d..a4fc51c5 100644 --- a/Marechai.Data/Dtos/MachinePhotoDto.cs +++ b/Marechai.Data/Dtos/MachinePhotoDto.cs @@ -23,12 +23,18 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class MachinePhotoDto : BasePhotoDto { - public string Source { get; set; } - public string MachineName { get; set; } + [JsonPropertyName("source")] + public string Source { get; set; } + [JsonPropertyName("machine_name")] + public string MachineName { get; set; } + [JsonPropertyName("machine_company_name")] public string MachineCompanyName { get; set; } - public int MachineId { get; set; } + [JsonPropertyName("machine_id")] + public int MachineId { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/MagazineByMachineDto.cs b/Marechai.Data/Dtos/MagazineByMachineDto.cs index bdd65c4b..a61c6fb6 100644 --- a/Marechai.Data/Dtos/MagazineByMachineDto.cs +++ b/Marechai.Data/Dtos/MagazineByMachineDto.cs @@ -23,12 +23,18 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class MagazineByMachineDto : BaseDto { - public long MagazineId { get; set; } - public string Magazine { get; set; } - public int MachineId { get; set; } - public string Machine { get; set; } + [JsonPropertyName("magazine_id")] + public long MagazineId { get; set; } + [JsonPropertyName("magazine")] + public string Magazine { get; set; } + [JsonPropertyName("machine_id")] + public int MachineId { get; set; } + [JsonPropertyName("machine")] + public string Machine { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/MagazineByMachineFamilyDto.cs b/Marechai.Data/Dtos/MagazineByMachineFamilyDto.cs index 19d89533..b2886a94 100644 --- a/Marechai.Data/Dtos/MagazineByMachineFamilyDto.cs +++ b/Marechai.Data/Dtos/MagazineByMachineFamilyDto.cs @@ -23,12 +23,18 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class MagazineByMachineFamilyDto : BaseDto { - public long MagazineId { get; set; } - public string Magazine { get; set; } - public int MachineFamilyId { get; set; } - public string MachineFamily { get; set; } + [JsonPropertyName("magazine_id")] + public long MagazineId { get; set; } + [JsonPropertyName("magazine")] + public string Magazine { get; set; } + [JsonPropertyName("machine_family_id")] + public int MachineFamilyId { get; set; } + [JsonPropertyName("machine_family")] + public string MachineFamily { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/MagazineDto.cs b/Marechai.Data/Dtos/MagazineDto.cs index 78215477..914a1dd0 100644 --- a/Marechai.Data/Dtos/MagazineDto.cs +++ b/Marechai.Data/Dtos/MagazineDto.cs @@ -23,10 +23,14 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class MagazineDto : DocumentBaseDto { - public string Issn { get; set; } + [JsonPropertyName("issn")] + public string Issn { get; set; } + [JsonPropertyName("first_publication")] public DateTime? FirstPublication { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/MagazineIssueDto.cs b/Marechai.Data/Dtos/MagazineIssueDto.cs index a090ed35..baed690b 100644 --- a/Marechai.Data/Dtos/MagazineIssueDto.cs +++ b/Marechai.Data/Dtos/MagazineIssueDto.cs @@ -23,16 +23,26 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class MagazineIssueDto : BaseDto { - public long MagazineId { get; set; } - public string MagazineTitle { get; set; } - public string Caption { get; set; } - public string NativeCaption { get; set; } - public DateTime? Published { get; set; } - public string ProductCode { get; set; } - public short? Pages { get; set; } - public uint? IssueNumber { get; set; } + [JsonPropertyName("magazine_id")] + public long MagazineId { get; set; } + [JsonPropertyName("magazine_title")] + public string MagazineTitle { get; set; } + [JsonPropertyName("caption")] + public string Caption { get; set; } + [JsonPropertyName("native_caption")] + public string NativeCaption { get; set; } + [JsonPropertyName("published")] + public DateTime? Published { get; set; } + [JsonPropertyName("product_code")] + public string ProductCode { get; set; } + [JsonPropertyName("pages")] + public short? Pages { get; set; } + [JsonPropertyName("issue_number")] + public uint? IssueNumber { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/MagazineScanDto.cs b/Marechai.Data/Dtos/MagazineScanDto.cs index a4c7d2b0..408852ce 100644 --- a/Marechai.Data/Dtos/MagazineScanDto.cs +++ b/Marechai.Data/Dtos/MagazineScanDto.cs @@ -23,10 +23,14 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class MagazineScanDto : DocumentScanBaseDto { - public long MagazineId { get; set; } - public string Magazine { get; set; } + [JsonPropertyName("magazine_id")] + public long MagazineId { get; set; } + [JsonPropertyName("magazine")] + public string Magazine { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/MediaDto.cs b/Marechai.Data/Dtos/MediaDto.cs index aab6b073..84c500b1 100644 --- a/Marechai.Data/Dtos/MediaDto.cs +++ b/Marechai.Data/Dtos/MediaDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; using Aaru.CommonTypes; using Marechai.Database; using Marechai.Database.Models; @@ -31,29 +32,54 @@ namespace Marechai.Data.Dtos; public class MediaDto : BaseDto { - public string Title { get; set; } - public ushort? Sequence { get; set; } - public ushort? LastSequence { get; set; } - public MediaType Type { get; set; } - public int? WriteOffset { get; set; } - public ushort? Sides { get; set; } - public ushort? Layers { get; set; } - public ushort? Sessions { get; set; } - public ushort? Tracks { get; set; } - public ulong Sectors { get; set; } - public ulong Size { get; set; } - public string CopyProtection { get; set; } - public string PartNumber { get; set; } - public string SerialNumber { get; set; } - public string Barcode { get; set; } - public string CatalogueNumber { get; set; } - public string Manufacturer { get; set; } - public string Model { get; set; } - public string Revision { get; set; } - public string Firmware { get; set; } - public int? PhysicalBlockSize { get; set; } - public int? LogicalBlockSize { get; set; } - public VariableBlockSize[] BlockSizes { get; set; } - public StorageInterface? StorageInterface { get; set; } - public OpticalDiscTrack[] TableOfContents { get; set; } + [JsonPropertyName("title")] + public string Title { get; set; } + [JsonPropertyName("sequence")] + public ushort? Sequence { get; set; } + [JsonPropertyName("last_sequence")] + public ushort? LastSequence { get; set; } + [JsonPropertyName("type")] + public MediaType Type { get; set; } + [JsonPropertyName("write_offset")] + public int? WriteOffset { get; set; } + [JsonPropertyName("sides")] + public ushort? Sides { get; set; } + [JsonPropertyName("layers")] + public ushort? Layers { get; set; } + [JsonPropertyName("sessions")] + public ushort? Sessions { get; set; } + [JsonPropertyName("tracks")] + public ushort? Tracks { get; set; } + [JsonPropertyName("sectors")] + public ulong Sectors { get; set; } + [JsonPropertyName("size")] + public ulong Size { get; set; } + [JsonPropertyName("copy_protection")] + public string CopyProtection { get; set; } + [JsonPropertyName("part_number")] + public string PartNumber { get; set; } + [JsonPropertyName("serial_number")] + public string SerialNumber { get; set; } + [JsonPropertyName("barcode")] + public string Barcode { get; set; } + [JsonPropertyName("catalogue_number")] + public string CatalogueNumber { get; set; } + [JsonPropertyName("manufacturer")] + public string Manufacturer { get; set; } + [JsonPropertyName("model")] + public string Model { get; set; } + [JsonPropertyName("revision")] + public string Revision { get; set; } + [JsonPropertyName("firmware")] + public string Firmware { get; set; } + [JsonPropertyName("physical_block_size")] + public int? PhysicalBlockSize { get; set; } + [JsonPropertyName("logical_block_size")] + public int? LogicalBlockSize { get; set; } + [JsonPropertyName("block_sizes")] + public VariableBlockSize[] BlockSizes { get; set; } + [JsonPropertyName("storage_interface")] + public StorageInterface? StorageInterface { get; set; } + [JsonPropertyName("table_of_contents")] + public OpticalDiscTrack[] TableOfContents { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/MemoryByMachineDto.cs b/Marechai.Data/Dtos/MemoryByMachineDto.cs index 6377b8cc..34751b00 100644 --- a/Marechai.Data/Dtos/MemoryByMachineDto.cs +++ b/Marechai.Data/Dtos/MemoryByMachineDto.cs @@ -23,15 +23,21 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; using Marechai.Database; namespace Marechai.Data.Dtos; public class MemoryByMachineDto : BaseDto { - public int MachineId { get; set; } - public MemoryType Type { get; set; } - public MemoryUsage Usage { get; set; } - public long? Size { get; set; } - public double? Speed { get; set; } + [JsonPropertyName("machine_id")] + public int MachineId { get; set; } + [JsonPropertyName("type")] + public MemoryType Type { get; set; } + [JsonPropertyName("usage")] + public MemoryUsage Usage { get; set; } + [JsonPropertyName("size")] + public long? Size { get; set; } + [JsonPropertyName("speed")] + public double? Speed { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/MemoryDto.cs b/Marechai.Data/Dtos/MemoryDto.cs index 6eaa04f9..2cc08967 100644 --- a/Marechai.Data/Dtos/MemoryDto.cs +++ b/Marechai.Data/Dtos/MemoryDto.cs @@ -23,14 +23,19 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; using Marechai.Database; namespace Marechai.Data.Dtos; public class MemoryDto { - public MemoryType Type { get; set; } + [JsonPropertyName("type")] + public MemoryType Type { get; set; } + [JsonPropertyName("usage")] public MemoryUsage Usage { get; set; } - public long? Size { get; set; } - public double? Speed { get; set; } + [JsonPropertyName("size")] + public long? Size { get; set; } + [JsonPropertyName("speed")] + public double? Speed { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/NewsDto.cs b/Marechai.Data/Dtos/NewsDto.cs index fa0660ba..371c6508 100644 --- a/Marechai.Data/Dtos/NewsDto.cs +++ b/Marechai.Data/Dtos/NewsDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; using Marechai.Database; namespace Marechai.Data.Dtos; @@ -40,10 +41,16 @@ public sealed class NewsDto : BaseDto ItemName = itemName; } - public NewsType Type { get; set; } - public int AffectedId { get; set; } - public string Controller { get; } - public string ItemName { get; } - public string Text { get; } - public DateTime Timestamp { get; set; } + [JsonPropertyName("type")] + public NewsType Type { get; set; } + [JsonPropertyName("affected_id")] + public int AffectedId { get; set; } + [JsonPropertyName("controller")] + public string Controller { get; } + [JsonPropertyName("item_name")] + public string ItemName { get; } + [JsonPropertyName("text")] + public string Text { get; } + [JsonPropertyName("timestamp")] + public DateTime Timestamp { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/PersonByBookDto.cs b/Marechai.Data/Dtos/PersonByBookDto.cs index aa19ce50..7bb5b114 100644 --- a/Marechai.Data/Dtos/PersonByBookDto.cs +++ b/Marechai.Data/Dtos/PersonByBookDto.cs @@ -23,18 +23,28 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class PersonByBookDto : BaseDto { - public int PersonId { get; set; } - public long BookId { get; set; } - public string RoleId { get; set; } - public string Role { get; set; } - public string Name { get; set; } - public string Alias { get; set; } - public string Surname { get; set; } + [JsonPropertyName("person_id")] + public int PersonId { get; set; } + [JsonPropertyName("book_id")] + public long BookId { get; set; } + [JsonPropertyName("role_id")] + public string RoleId { get; set; } + [JsonPropertyName("role")] + public string Role { get; set; } + [JsonPropertyName("name")] + public string Name { get; set; } + [JsonPropertyName("alias")] + public string Alias { get; set; } + [JsonPropertyName("surname")] + public string Surname { get; set; } + [JsonPropertyName("display_name")] public string DisplayName { get; set; } - + [JsonIgnore] public string FullName => DisplayName ?? Alias ?? $"{Name} {Surname}"; } \ No newline at end of file diff --git a/Marechai.Data/Dtos/PersonByDocumentDto.cs b/Marechai.Data/Dtos/PersonByDocumentDto.cs index 4fc9ea26..21708272 100644 --- a/Marechai.Data/Dtos/PersonByDocumentDto.cs +++ b/Marechai.Data/Dtos/PersonByDocumentDto.cs @@ -23,18 +23,28 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class PersonByDocumentDto : BaseDto { - public int PersonId { get; set; } - public long DocumentId { get; set; } - public string RoleId { get; set; } - public string Role { get; set; } - public string Name { get; set; } - public string Alias { get; set; } - public string Surname { get; set; } + [JsonPropertyName("person_id")] + public int PersonId { get; set; } + [JsonPropertyName("document_id")] + public long DocumentId { get; set; } + [JsonPropertyName("role_id")] + public string RoleId { get; set; } + [JsonPropertyName("role")] + public string Role { get; set; } + [JsonPropertyName("name")] + public string Name { get; set; } + [JsonPropertyName("alias")] + public string Alias { get; set; } + [JsonPropertyName("surname")] + public string Surname { get; set; } + [JsonPropertyName("display_name")] public string DisplayName { get; set; } - + [JsonIgnore] public string FullName => DisplayName ?? Alias ?? $"{Name} {Surname}"; } \ No newline at end of file diff --git a/Marechai.Data/Dtos/PersonByMagazineDto.cs b/Marechai.Data/Dtos/PersonByMagazineDto.cs index 68d9b747..4c5c2668 100644 --- a/Marechai.Data/Dtos/PersonByMagazineDto.cs +++ b/Marechai.Data/Dtos/PersonByMagazineDto.cs @@ -23,18 +23,28 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class PersonByMagazineDto : BaseDto { - public int PersonId { get; set; } - public long MagazineId { get; set; } - public string RoleId { get; set; } - public string Role { get; set; } - public string Name { get; set; } - public string Alias { get; set; } - public string Surname { get; set; } + [JsonPropertyName("person_id")] + public int PersonId { get; set; } + [JsonPropertyName("magazine_id")] + public long MagazineId { get; set; } + [JsonPropertyName("role_id")] + public string RoleId { get; set; } + [JsonPropertyName("role")] + public string Role { get; set; } + [JsonPropertyName("name")] + public string Name { get; set; } + [JsonPropertyName("alias")] + public string Alias { get; set; } + [JsonPropertyName("surname")] + public string Surname { get; set; } + [JsonPropertyName("display_name")] public string DisplayName { get; set; } - + [JsonIgnore] public string FullName => DisplayName ?? Alias ?? $"{Name} {Surname}"; } \ No newline at end of file diff --git a/Marechai.Data/Dtos/PersonDto.cs b/Marechai.Data/Dtos/PersonDto.cs index cc0936de..b76d2047 100644 --- a/Marechai.Data/Dtos/PersonDto.cs +++ b/Marechai.Data/Dtos/PersonDto.cs @@ -23,22 +23,36 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class PersonDto : BaseDto { - public string Name { get; set; } - public string Surname { get; set; } - public string CountryOfBirth { get; set; } - public DateTime BirthDate { get; set; } - public DateTime? DeathDate { get; set; } - public string Webpage { get; set; } - public string Twitter { get; set; } - public string Facebook { get; set; } - public Guid Photo { get; set; } - public string Alias { get; set; } - public string DisplayName { get; set; } - public short? CountryOfBirthId { get; set; } - + [JsonPropertyName("name")] + public string Name { get; set; } + [JsonPropertyName("surname")] + public string Surname { get; set; } + [JsonPropertyName("country")] + public string CountryOfBirth { get; set; } + [JsonPropertyName("birthdate")] + public DateTime BirthDate { get; set; } + [JsonPropertyName("death_date")] + public DateTime? DeathDate { get; set; } + [JsonPropertyName("webpage")] + public string Webpage { get; set; } + [JsonPropertyName("twitter")] + public string Twitter { get; set; } + [JsonPropertyName("facebook")] + public string Facebook { get; set; } + [JsonPropertyName("photo")] + public Guid Photo { get; set; } + [JsonPropertyName("alias")] + public string Alias { get; set; } + [JsonPropertyName("display_name")] + public string DisplayName { get; set; } + [JsonPropertyName("country_id")] + public short? CountryOfBirthId { get; set; } + [JsonIgnore] public string FullName => DisplayName ?? Alias ?? $"{Name} {Surname}"; } \ No newline at end of file diff --git a/Marechai.Data/Dtos/ProcessorByMachineDto.cs b/Marechai.Data/Dtos/ProcessorByMachineDto.cs index 0f211149..73cda466 100644 --- a/Marechai.Data/Dtos/ProcessorByMachineDto.cs +++ b/Marechai.Data/Dtos/ProcessorByMachineDto.cs @@ -23,13 +23,20 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class ProcessorByMachineDto : BaseDto { - public int ProcessorId { get; set; } - public int MachineId { get; set; } + [JsonPropertyName("processor_id")] + public int ProcessorId { get; set; } + [JsonPropertyName("machine_id")] + public int MachineId { get; set; } + [JsonPropertyName("company")] public string CompanyName { get; set; } - public string Name { get; set; } - public float? Speed { get; set; } + [JsonPropertyName("name")] + public string Name { get; set; } + [JsonPropertyName("speed")] + public float? Speed { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/ProcessorDto.cs b/Marechai.Data/Dtos/ProcessorDto.cs index db585033..b2b03f39 100644 --- a/Marechai.Data/Dtos/ProcessorDto.cs +++ b/Marechai.Data/Dtos/ProcessorDto.cs @@ -23,38 +23,68 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class ProcessorDto : BaseDto { - public string Name { get; set; } - public string CompanyName { get; set; } - public string ModelCode { get; set; } - public DateTime? Introduced { get; set; } - public double? Speed { get; set; } - public string Package { get; set; } - public int? Gprs { get; set; } - public int? GprSize { get; set; } - public int? Fprs { get; set; } - public int? FprSize { get; set; } - public int? Cores { get; set; } - public int? ThreadsPerCore { get; set; } - public string Process { get; set; } - public float? ProcessNm { get; set; } - public float? DieSize { get; set; } - public long? Transistors { get; set; } - public int? DataBus { get; set; } - public int? AddrBus { get; set; } - public int? SimdRegisters { get; set; } - public int? SimdSize { get; set; } - public float? L1Instruction { get; set; } - public float? L1Data { get; set; } - public float? L2 { get; set; } - public float? L3 { get; set; } - public string InstructionSet { get; set; } + [JsonPropertyName("name")] + public string Name { get; set; } + [JsonPropertyName("company")] + public string CompanyName { get; set; } + [JsonPropertyName("model_code")] + public string ModelCode { get; set; } + [JsonPropertyName("introduced")] + public DateTime? Introduced { get; set; } + [JsonPropertyName("speed")] + public double? Speed { get; set; } + [JsonPropertyName("package")] + public string Package { get; set; } + [JsonPropertyName("gprs")] + public int? Gprs { get; set; } + [JsonPropertyName("gpr_size")] + public int? GprSize { get; set; } + [JsonPropertyName("fprs")] + public int? Fprs { get; set; } + [JsonPropertyName("fpr_size")] + public int? FprSize { get; set; } + [JsonPropertyName("cores")] + public int? Cores { get; set; } + [JsonPropertyName("threads_per_core")] + public int? ThreadsPerCore { get; set; } + [JsonPropertyName("process")] + public string Process { get; set; } + [JsonPropertyName("process_nm")] + public float? ProcessNm { get; set; } + [JsonPropertyName("die_size")] + public float? DieSize { get; set; } + [JsonPropertyName("transistors")] + public long? Transistors { get; set; } + [JsonPropertyName("data_bus")] + public int? DataBus { get; set; } + [JsonPropertyName("address_bus")] + public int? AddrBus { get; set; } + [JsonPropertyName("simd_registers")] + public int? SimdRegisters { get; set; } + [JsonPropertyName("simd_size")] + public int? SimdSize { get; set; } + [JsonPropertyName("l1_instruction")] + public float? L1Instruction { get; set; } + [JsonPropertyName("l1_data")] + public float? L1Data { get; set; } + [JsonPropertyName("l2")] + public float? L2 { get; set; } + [JsonPropertyName("l3")] + public float? L3 { get; set; } + [JsonPropertyName("instruction_set")] + public string InstructionSet { get; set; } + [JsonPropertyName("instruction_set_extensions")] public List InstructionSetExtensions { get; set; } - public int? CompanyId { get; set; } - public int? InstructionSetId { get; set; } - + [JsonPropertyName("company_id")] + public int? CompanyId { get; set; } + [JsonPropertyName("instruction_set_id")] + public int? InstructionSetId { get; set; } + [JsonIgnore] public string IntroducedView => Introduced?.ToShortDateString() ?? "Unknown"; } \ No newline at end of file diff --git a/Marechai.Data/Dtos/ResolutionByGpuDto.cs b/Marechai.Data/Dtos/ResolutionByGpuDto.cs index c4fccdef..4cb63dcb 100644 --- a/Marechai.Data/Dtos/ResolutionByGpuDto.cs +++ b/Marechai.Data/Dtos/ResolutionByGpuDto.cs @@ -23,11 +23,16 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class ResolutionByGpuDto : BaseDto { - public int ResolutionId { get; set; } - public int GpuId { get; set; } - public ResolutionDto Resolution { get; set; } + [JsonPropertyName("resolution_id")] + public int ResolutionId { get; set; } + [JsonPropertyName("gpu_id")] + public int GpuId { get; set; } + [JsonPropertyName("resolution")] + public ResolutionDto Resolution { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/ResolutionByScreenDto.cs b/Marechai.Data/Dtos/ResolutionByScreenDto.cs index a98ef613..9917fe3a 100644 --- a/Marechai.Data/Dtos/ResolutionByScreenDto.cs +++ b/Marechai.Data/Dtos/ResolutionByScreenDto.cs @@ -23,11 +23,16 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class ResolutionByScreenDto : BaseDto { - public int ResolutionId { get; set; } - public int ScreenId { get; set; } - public ResolutionDto Resolution { get; set; } + [JsonPropertyName("resolution_id")] + public int ResolutionId { get; set; } + [JsonPropertyName("screen_id")] + public int ScreenId { get; set; } + [JsonPropertyName("resolution")] + public ResolutionDto Resolution { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/ResolutionDto.cs b/Marechai.Data/Dtos/ResolutionDto.cs index 0ed8ed5f..e73fffa2 100644 --- a/Marechai.Data/Dtos/ResolutionDto.cs +++ b/Marechai.Data/Dtos/ResolutionDto.cs @@ -23,17 +23,25 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class ResolutionDto : BaseDto { - 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; } - + [JsonPropertyName("width")] + public int Width { get; set; } + [JsonPropertyName("height")] + public int Height { get; set; } + [JsonPropertyName("colors")] + public long? Colors { get; set; } + [JsonPropertyName("palette")] + public long? Palette { get; set; } + [JsonPropertyName("chars")] + public bool Chars { get; set; } + [JsonPropertyName("grayscale")] + public bool Grayscale { get; set; } + [JsonIgnore] public long? PaletteView => Palette ?? Colors; public override string ToString() diff --git a/Marechai.Data/Dtos/ScreenByMachineDto.cs b/Marechai.Data/Dtos/ScreenByMachineDto.cs index a75f3429..785e2605 100644 --- a/Marechai.Data/Dtos/ScreenByMachineDto.cs +++ b/Marechai.Data/Dtos/ScreenByMachineDto.cs @@ -23,11 +23,16 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class ScreenByMachineDto : BaseDto { - public int MachineId { get; set; } - public ScreenDto Screen { get; set; } - public int ScreenId { get; set; } + [JsonPropertyName("machine_id")] + public int MachineId { get; set; } + [JsonPropertyName("screen")] + public ScreenDto Screen { get; set; } + [JsonPropertyName("screen_id")] + public int ScreenId { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/ScreenDto.cs b/Marechai.Data/Dtos/ScreenDto.cs index d9353234..c40a7791 100644 --- a/Marechai.Data/Dtos/ScreenDto.cs +++ b/Marechai.Data/Dtos/ScreenDto.cs @@ -23,18 +23,27 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class ScreenDto : BaseDto { - public double? Width { get; set; } - public double? Height { get; set; } - public double Diagonal { get; set; } - public int NativeResolutionId { get; set; } - public ResolutionDto NativeResolution { get; set; } - public long? EffectiveColors { get; set; } - public string Type { get; set; } - + [JsonPropertyName("width")] + public double? Width { get; set; } + [JsonPropertyName("height")] + public double? Height { get; set; } + [JsonPropertyName("diagonal")] + public double Diagonal { get; set; } + [JsonPropertyName("native_resolution_id")] + public int NativeResolutionId { get; set; } + [JsonPropertyName("native_resolution")] + public ResolutionDto NativeResolution { get; set; } + [JsonPropertyName("effective_colors")] + public long? EffectiveColors { get; set; } + [JsonPropertyName("type")] + public string Type { get; set; } + [JsonIgnore] public long? Colors => EffectiveColors ?? NativeResolution.Colors; public string Size diff --git a/Marechai.Data/Dtos/SoftwareFamilyDto.cs b/Marechai.Data/Dtos/SoftwareFamilyDto.cs index c8bfc475..c96753ed 100644 --- a/Marechai.Data/Dtos/SoftwareFamilyDto.cs +++ b/Marechai.Data/Dtos/SoftwareFamilyDto.cs @@ -23,12 +23,18 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class SoftwareFamilyDto : BaseDto { - public string Name { get; set; } + [JsonPropertyName("name")] + public string Name { get; set; } + [JsonPropertyName("introduced")] public DateTime? Introduced { get; set; } - public string Parent { get; set; } - public ulong? ParentId { get; set; } + [JsonPropertyName("parent")] + public string Parent { get; set; } + [JsonPropertyName("parent_id")] + public ulong? ParentId { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/SoftwareVariantDto.cs b/Marechai.Data/Dtos/SoftwareVariantDto.cs index 33d22000..d0ef5109 100644 --- a/Marechai.Data/Dtos/SoftwareVariantDto.cs +++ b/Marechai.Data/Dtos/SoftwareVariantDto.cs @@ -23,26 +23,43 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; using Marechai.Database; namespace Marechai.Data.Dtos; public class SoftwareVariantDto : BaseDto { - public string Name { get; set; } - public string Version { get; set; } - public DateTime? Introduced { get; set; } - public ulong? ParentId { get; set; } - public string Parent { get; set; } - public ulong SoftwareVersionId { get; set; } - public string SoftwareVersion { get; set; } - public ulong? MinimumMemory { get; set; } - public ulong? RecommendedMemory { get; set; } - public ulong? RequiredStorage { get; set; } - public string PartNumber { get; set; } - public string SerialNumber { get; set; } - public string ProductCode { get; set; } - public string CatalogueNumber { get; set; } - public DistributionMode DistributionMode { get; set; } - public string Family { get; set; } + [JsonPropertyName("name")] + public string Name { get; set; } + [JsonPropertyName("version")] + public string Version { get; set; } + [JsonPropertyName("introduced")] + public DateTime? Introduced { get; set; } + [JsonPropertyName("parent_id")] + public ulong? ParentId { get; set; } + [JsonPropertyName("parent")] + public string Parent { get; set; } + [JsonPropertyName("version_id")] + public ulong SoftwareVersionId { get; set; } + [JsonPropertyName("version")] + public string SoftwareVersion { get; set; } + [JsonPropertyName("minimum_memory")] + public ulong? MinimumMemory { get; set; } + [JsonPropertyName("recommended_memory")] + public ulong? RecommendedMemory { get; set; } + [JsonPropertyName("required_storage")] + public ulong? RequiredStorage { get; set; } + [JsonPropertyName("part_number")] + public string PartNumber { get; set; } + [JsonPropertyName("serial_number")] + public string SerialNumber { get; set; } + [JsonPropertyName("product_code")] + public string ProductCode { get; set; } + [JsonPropertyName("catalogue_number")] + public string CatalogueNumber { get; set; } + [JsonPropertyName("distribution_mode")] + public DistributionMode DistributionMode { get; set; } + [JsonPropertyName("family")] + public string Family { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/SoftwareVersionDto.cs b/Marechai.Data/Dtos/SoftwareVersionDto.cs index 7bcce71f..872e71b2 100644 --- a/Marechai.Data/Dtos/SoftwareVersionDto.cs +++ b/Marechai.Data/Dtos/SoftwareVersionDto.cs @@ -23,18 +23,30 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class SoftwareVersionDto : BaseDto { - public string Family { get; set; } - public string Name { get; set; } - public string Codename { get; set; } - public string Version { get; set; } + [JsonPropertyName("family")] + public string Family { get; set; } + [JsonPropertyName("name")] + public string Name { get; set; } + [JsonPropertyName("codename")] + public string Codename { get; set; } + [JsonPropertyName("version")] + public string Version { get; set; } + [JsonPropertyName("introduced")] public DateTime? Introduced { get; set; } - public string Previous { get; set; } - public string License { get; set; } - public ulong FamilyId { get; set; } - public int? LicenseId { get; set; } - public ulong? PreviousId { get; set; } + [JsonPropertyName("previous")] + public string Previous { get; set; } + [JsonPropertyName("license")] + public string License { get; set; } + [JsonPropertyName("family_id")] + public ulong FamilyId { get; set; } + [JsonPropertyName("license_id")] + public int? LicenseId { get; set; } + [JsonPropertyName("previous_id")] + public ulong? PreviousId { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/SoundSynthByMachineDto.cs b/Marechai.Data/Dtos/SoundSynthByMachineDto.cs index f7f0e4fa..0826e1bb 100644 --- a/Marechai.Data/Dtos/SoundSynthByMachineDto.cs +++ b/Marechai.Data/Dtos/SoundSynthByMachineDto.cs @@ -23,12 +23,18 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class SoundSynthByMachineDto : BaseDto { - public int SoundSynthId { get; set; } - public int MachineId { get; set; } - public string CompanyName { get; set; } - public string Name { get; set; } + [JsonPropertyName("sound_synth_id")] + public int SoundSynthId { get; set; } + [JsonPropertyName("machine_id")] + public int MachineId { get; set; } + [JsonPropertyName("company")] + public string CompanyName { get; set; } + [JsonPropertyName("name")] + public string Name { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/SoundSynthDto.cs b/Marechai.Data/Dtos/SoundSynthDto.cs index ec8b5b81..38de1adf 100644 --- a/Marechai.Data/Dtos/SoundSynthDto.cs +++ b/Marechai.Data/Dtos/SoundSynthDto.cs @@ -23,21 +23,34 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; + namespace Marechai.Data.Dtos; public class SoundSynthDto : BaseDto { - public string Name { get; set; } - public string CompanyName { get; set; } - public int? CompanyId { get; set; } - public string ModelCode { get; set; } - public DateTime? Introduced { get; set; } - public int? Voices { get; set; } - public double? Frequency { get; set; } - public int? Depth { get; set; } - public int? SquareWave { get; set; } - public int? WhiteNoise { get; set; } - public int? Type { get; set; } - + [JsonPropertyName("name")] + public string Name { get; set; } + [JsonPropertyName("company")] + public string CompanyName { get; set; } + [JsonPropertyName("company_id")] + public int? CompanyId { get; set; } + [JsonPropertyName("model_code")] + public string ModelCode { get; set; } + [JsonPropertyName("introduced")] + public DateTime? Introduced { get; set; } + [JsonPropertyName("voices")] + public int? Voices { get; set; } + [JsonPropertyName("frequency")] + public double? Frequency { get; set; } + [JsonPropertyName("depth")] + public int? Depth { get; set; } + [JsonPropertyName("square_wave")] + public int? SquareWave { get; set; } + [JsonPropertyName("white_noise")] + public int? WhiteNoise { get; set; } + [JsonPropertyName("type")] + public int? Type { get; set; } + [JsonIgnore] public string IntroducedView => Introduced?.ToShortDateString() ?? "Unknown"; } \ No newline at end of file diff --git a/Marechai.Data/Dtos/StorageByMachineDto.cs b/Marechai.Data/Dtos/StorageByMachineDto.cs index 3311223d..3e8669b1 100644 --- a/Marechai.Data/Dtos/StorageByMachineDto.cs +++ b/Marechai.Data/Dtos/StorageByMachineDto.cs @@ -23,14 +23,19 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; using Marechai.Database; namespace Marechai.Data.Dtos; public class StorageByMachineDto : BaseDto { - public int MachineId { get; set; } - public StorageType Type { get; set; } + [JsonPropertyName("machine_id")] + public int MachineId { get; set; } + [JsonPropertyName("type")] + public StorageType Type { get; set; } + [JsonPropertyName("interface")] public StorageInterface Interface { get; set; } - public long? Capacity { get; set; } + [JsonPropertyName("capacity")] + public long? Capacity { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/StorageDto.cs b/Marechai.Data/Dtos/StorageDto.cs index 9ec0c800..1d5fb5e0 100644 --- a/Marechai.Data/Dtos/StorageDto.cs +++ b/Marechai.Data/Dtos/StorageDto.cs @@ -23,13 +23,17 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.Text.Json.Serialization; using Marechai.Database; namespace Marechai.Data.Dtos; public class StorageDto { - public StorageType Type { get; set; } + [JsonPropertyName("type")] + public StorageType Type { get; set; } + [JsonPropertyName("interface")] public StorageInterface Interface { get; set; } - public long? Capacity { get; set; } + [JsonPropertyName("capacity")] + public long? Capacity { get; set; } } \ No newline at end of file