From da352de481ab34d9053334ea1b369ff3310346cf Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Mon, 10 Feb 2020 22:44:18 +0000 Subject: [PATCH] Refactor and reorganize code. --- Marechai.Database/Enums.cs | 463 +- Marechai.Database/IDbCore.cs | 12 +- .../20180805214952_InitialMigration.cs | 1027 ++- ...180806202841_BrowserTestFieldsAsBoolean.cs | 12 +- .../20180811130603_CreateIdentitySchema.cs | 202 +- ...0190518145625_RemoveCompanyDescriptions.cs | 28 +- .../20190518150032_AddCompanyDescriptions.cs | 31 +- ...190518154700_AddCompanyDescriptionIndex.cs | 4 +- ...190518164341_AnnotateCompanyDescription.cs | 8 +- ...170817_AddPreRenderedCompanyDescription.cs | 8 +- .../20190518212800_NewsDateAsDateTime.cs | 8 +- .../20190519012635_DropOldAdminsTable.cs | 27 +- .../20190519144028_GrayscaleResolutions.cs | 8 +- .../20190519171846_DataAnnotations.cs | 29 +- .../20190527020604_MachinePhotos.cs | 101 +- .../Migrations/20190527160705_Licenses.cs | 3106 ++++---- .../20190528222110_MachinePhotoForeignKeys.cs | 8 +- ...angeMachinePhotoSharpnessTypeToExifType.cs | 8 +- ...20190528234633_AddMachinePhotoSourceUrl.cs | 8 +- .../20190529194436_AddOwnedMachines.cs | 437 +- .../Migrations/20190601122952_AddScreens.cs | 98 +- .../Migrations/20190602021943_AddPerson.cs | 43 +- .../Migrations/20190603165746_AddIso639.cs | 28 +- .../20190605142832_AddPeopleByCompany.cs | 80 +- .../Migrations/20190616210450_AddDocuments.cs | 41 +- .../20190616211045_AddDocumentRoles.cs | 990 ++- .../20190616232349_AddDocumentPeople.cs | 28 +- .../20190616233045_AddPeopleByDocument.cs | 45 +- .../20190616233807_AddDocumentCompany.cs | 22 +- .../20190616234431_AddCompaniesByDocument.cs | 45 +- .../20190616235255_AddDocumentsByMachine.cs | 37 +- ...90617010136_AddDocumentsByMachineFamily.cs | 38 +- .../Migrations/20190617012113_AddBooks.cs | 62 +- .../20190617014131_AddCompaniesByBook.cs | 43 +- .../20190617015011_AddPeopleByBook.cs | 44 +- .../20190617020655_AddBooksByMachine.cs | 35 +- .../20190617021725_AddBooksByMachineFamily.cs | 37 +- .../Migrations/20190617022849_AddMagazines.cs | 47 +- .../20190617024228_AddMagazineIssues.cs | 39 +- .../20190617025439_AddCompaniesByMagazine.cs | 45 +- .../20190617030141_AddPeopleByMagazine.cs | 45 +- .../20190617031250_AddMagazinesByMachine.cs | 37 +- ...90617031843_AddMagazinesByMachineFamily.cs | 39 +- .../MarechaiContextModelSnapshot.cs | 6917 +++++++---------- Marechai.Database/Models/BrowserTest.cs | 17 +- Marechai.Database/Models/CompaniesByBook.cs | 5 +- .../Models/CompaniesByDocument.cs | 3 +- .../Models/CompaniesByMagazine.cs | 3 +- Marechai.Database/Models/Company.cs | 34 +- .../Models/CompanyDescription.cs | 6 +- Marechai.Database/Models/CompanyLogo.cs | 4 +- Marechai.Database/Models/DocumentBase.cs | 3 +- Marechai.Database/Models/DocumentPerson.cs | 3 +- Marechai.Database/Models/DocumentRole.cs | 4 +- Marechai.Database/Models/Gpu.cs | 9 +- Marechai.Database/Models/InstructionSet.cs | 9 +- .../Models/InstructionSetExtension.cs | 9 +- Marechai.Database/Models/Iso31661Numeric.cs | 8 +- Marechai.Database/Models/Iso639.cs | 17 +- Marechai.Database/Models/License.cs | 16 +- Marechai.Database/Models/Machine.cs | 9 +- Marechai.Database/Models/MachineFamily.cs | 8 +- Marechai.Database/Models/Magazine.cs | 3 +- Marechai.Database/Models/MagazineIssue.cs | 3 +- Marechai.Database/Models/MarechaiContext.cs | 282 +- Marechai.Database/Models/MarechaiDb.cs | 4 +- Marechai.Database/Models/PeopleByBook.cs | 3 +- Marechai.Database/Models/PeopleByDocument.cs | 3 +- Marechai.Database/Models/PeopleByMagazine.cs | 3 +- Marechai.Database/Models/Person.cs | 9 +- Marechai.Database/Models/Processor.cs | 11 +- Marechai.Database/Models/Resolution.cs | 35 +- .../Models/ResolutionsByScreen.cs | 3 +- Marechai.Database/Models/Screen.cs | 18 +- Marechai.Database/Models/SoundSynth.cs | 26 +- Marechai.Database/Mysql.cs | 34 +- Marechai.Database/Operations/Update.cs | 318 +- Marechai.Database/Schemas/Sql/V10.cs | 12 +- Marechai.Database/Schemas/Sql/V11.cs | 12 +- Marechai.Database/Schemas/Sql/V12.cs | 12 +- Marechai.Database/Schemas/Sql/V13.cs | 12 +- Marechai.Database/Schemas/Sql/V14.cs | 12 +- Marechai.Database/Schemas/Sql/V15.cs | 12 +- Marechai.Database/Schemas/Sql/V16.cs | 12 +- Marechai.Database/Schemas/Sql/V17.cs | 12 +- Marechai.Database/Schemas/Sql/V18.cs | 12 +- Marechai.Database/Schemas/Sql/V19.cs | 12 +- Marechai.Database/Schemas/Sql/V20.cs | 12 +- Marechai.Database/Schemas/Sql/V21.cs | 12 +- Marechai.Database/Schemas/Sql/V22.cs | 12 +- Marechai.Database/Schemas/Sql/V6.cs | 12 +- Marechai.Database/Schemas/Sql/V7.cs | 12 +- Marechai.Database/Schemas/Sql/V8.cs | 12 +- Marechai.Database/Schemas/Sql/V9.cs | 12 +- Marechai.Database/Seeders/DocumentRoles.cs | 2104 ++--- Marechai.Database/Seeders/License.cs | 4818 ++++-------- .../Controllers/BrowserTestsController.cs | 59 +- .../Admin/Controllers/CompaniesController.cs | 88 +- .../CompanyDescriptionsController.cs | 79 +- .../Controllers/CompanyLogosController.cs | 229 +- .../DocumentCompaniesController.cs | 124 +- .../Controllers/DocumentPeopleController.cs | 96 +- .../Controllers/GpusByMachineController.cs | 86 +- .../GpusByOwnedMachineController.cs | 166 +- .../Areas/Admin/Controllers/GpusController.cs | 75 +- ...ctionSetExtensionsByProcessorController.cs | 103 +- .../InstructionSetExtensionsController.cs | 61 +- .../Controllers/InstructionSetsController.cs | 58 +- .../Admin/Controllers/LicensesController.cs | 61 +- .../Controllers/MachineFamiliesController.cs | 76 +- .../Controllers/MachinePhotosController.cs | 257 +- .../Admin/Controllers/MachinesController.cs | 114 +- .../Controllers/MemoryByMachinesController.cs | 76 +- .../MemoryByOwnedMachinesController.cs | 164 +- .../Areas/Admin/Controllers/NewsController.cs | 25 +- .../Controllers/OwnedMachineController.cs | 222 +- .../Admin/Controllers/PeopleController.cs | 67 +- .../ProcessorsByMachinesController.cs | 86 +- .../ProcessorsByOwnedMachinesController.cs | 145 +- .../Admin/Controllers/ProcessorsController.cs | 96 +- .../Controllers/ResolutionsByGpuController.cs | 183 +- .../ResolutionsByScreenController.cs | 156 +- .../Controllers/ResolutionsController.cs | 56 +- .../Controllers/ScreensByMachineController.cs | 197 +- .../Admin/Controllers/ScreensController.cs | 98 +- .../Controllers/SoundByMachineController.cs | 95 +- .../SoundByOwnedMachineController.cs | 183 +- .../Controllers/SoundSynthsController.cs | 75 +- .../StorageByMachinesController.cs | 77 +- .../StorageByOwnedMachinesController.cs | 191 +- .../Areas/Admin/Models/CompanyViewModel.cs | 28 +- Marechai/Areas/Admin/Models/GpuViewModel.cs | 3 +- .../Models/MachinePhotoDetailsViewModel.cs | 3 +- .../Admin/Models/MachinePhotoViewModel.cs | 4 +- .../Areas/Admin/Models/MachineViewModel.cs | 3 +- .../Admin/Models/OwnedMachineViewModel.cs | 3 +- .../Areas/Admin/Models/ProcessorViewModel.cs | 3 +- .../Areas/Admin/Models/SoundSynthViewModel.cs | 3 +- .../Admin/Views/BrowserTests/Delete.cshtml | 13 +- .../Admin/Views/BrowserTests/Details.cshtml | 4 +- .../Admin/Views/BrowserTests/Edit.cshtml | 60 +- .../Admin/Views/BrowserTests/Index.cshtml | 17 +- .../Areas/Admin/Views/Companies/Create.cshtml | 129 +- .../Areas/Admin/Views/Companies/Delete.cshtml | 13 +- .../Admin/Views/Companies/Details.cshtml | 4 +- .../Areas/Admin/Views/Companies/Edit.cshtml | 135 +- .../Areas/Admin/Views/Companies/Index.cshtml | 20 +- .../Views/CompanyDescriptions/Create.cshtml | 25 +- .../Views/CompanyDescriptions/Delete.cshtml | 13 +- .../Views/CompanyDescriptions/Details.cshtml | 9 +- .../Views/CompanyDescriptions/Edit.cshtml | 32 +- .../Views/CompanyDescriptions/Index.cshtml | 20 +- .../Admin/Views/CompanyLogos/Create.cshtml | 40 +- .../Admin/Views/CompanyLogos/Delete.cshtml | 19 +- .../Admin/Views/CompanyLogos/Details.cshtml | 8 +- .../Admin/Views/CompanyLogos/Edit.cshtml | 41 +- .../Admin/Views/CompanyLogos/Index.cshtml | 20 +- .../Views/DocumentCompanies/Create.cshtml | 31 +- .../Views/DocumentCompanies/Delete.cshtml | 17 +- .../Views/DocumentCompanies/Details.cshtml | 13 +- .../Admin/Views/DocumentCompanies/Edit.cshtml | 33 +- .../Views/DocumentCompanies/Index.cshtml | 24 +- .../Admin/Views/DocumentPeople/Create.cshtml | 58 +- .../Admin/Views/DocumentPeople/Delete.cshtml | 17 +- .../Admin/Views/DocumentPeople/Details.cshtml | 13 +- .../Admin/Views/DocumentPeople/Edit.cshtml | 61 +- .../Admin/Views/DocumentPeople/Index.cshtml | 24 +- Marechai/Areas/Admin/Views/Gpus/Create.cshtml | 91 +- Marechai/Areas/Admin/Views/Gpus/Delete.cshtml | 13 +- .../Areas/Admin/Views/Gpus/Details.cshtml | 9 +- Marechai/Areas/Admin/Views/Gpus/Edit.cshtml | 97 +- Marechai/Areas/Admin/Views/Gpus/Index.cshtml | 20 +- .../Admin/Views/GpusByMachine/Create.cshtml | 11 +- .../Admin/Views/GpusByMachine/Delete.cshtml | 15 +- .../Admin/Views/GpusByMachine/Details.cshtml | 12 +- .../Admin/Views/GpusByMachine/Edit.cshtml | 7 +- .../Admin/Views/GpusByMachine/Index.cshtml | 20 +- .../Views/GpusByOwnedMachine/Create.cshtml | 26 +- .../Views/GpusByOwnedMachine/Delete.cshtml | 13 +- .../Views/GpusByOwnedMachine/Details.cshtml | 9 +- .../Views/GpusByOwnedMachine/Edit.cshtml | 35 +- .../Views/GpusByOwnedMachine/Index.cshtml | 20 +- Marechai/Areas/Admin/Views/Home/Index.cshtml | 107 +- .../InstructionSetExtensions/Create.cshtml | 21 +- .../InstructionSetExtensions/Delete.cshtml | 13 +- .../InstructionSetExtensions/Details.cshtml | 13 +- .../InstructionSetExtensions/Edit.cshtml | 24 +- .../InstructionSetExtensions/Index.cshtml | 20 +- .../Create.cshtml | 32 +- .../Delete.cshtml | 19 +- .../Details.cshtml | 9 +- .../Edit.cshtml | 35 +- .../Index.cshtml | 20 +- .../Admin/Views/InstructionSets/Create.cshtml | 21 +- .../Admin/Views/InstructionSets/Delete.cshtml | 13 +- .../Views/InstructionSets/Details.cshtml | 4 +- .../Admin/Views/InstructionSets/Edit.cshtml | 24 +- .../Admin/Views/InstructionSets/Index.cshtml | 20 +- .../Areas/Admin/Views/Licenses/Create.cshtml | 51 +- .../Areas/Admin/Views/Licenses/Delete.cshtml | 13 +- .../Areas/Admin/Views/Licenses/Details.cshtml | 9 +- .../Areas/Admin/Views/Licenses/Edit.cshtml | 54 +- .../Areas/Admin/Views/Licenses/Index.cshtml | 25 +- .../Admin/Views/MachineFamilies/Create.cshtml | 28 +- .../Admin/Views/MachineFamilies/Delete.cshtml | 13 +- .../Views/MachineFamilies/Details.cshtml | 4 +- .../Admin/Views/MachineFamilies/Edit.cshtml | 34 +- .../Admin/Views/MachineFamilies/Index.cshtml | 20 +- .../Admin/Views/MachinePhotos/Create.cshtml | 57 +- .../Admin/Views/MachinePhotos/Delete.cshtml | 13 +- .../Admin/Views/MachinePhotos/Details.cshtml | 80 +- .../Admin/Views/MachinePhotos/Edit.cshtml | 335 +- .../Admin/Views/MachinePhotos/Index.cshtml | 30 +- .../Areas/Admin/Views/Machines/Create.cshtml | 63 +- .../Areas/Admin/Views/Machines/Delete.cshtml | 13 +- .../Areas/Admin/Views/Machines/Details.cshtml | 9 +- .../Areas/Admin/Views/Machines/Edit.cshtml | 66 +- .../Areas/Admin/Views/Machines/Index.cshtml | 20 +- .../Views/MemoryByMachines/Create.cshtml | 57 +- .../Views/MemoryByMachines/Delete.cshtml | 13 +- .../Views/MemoryByMachines/Details.cshtml | 9 +- .../Admin/Views/MemoryByMachines/Edit.cshtml | 60 +- .../Admin/Views/MemoryByMachines/Index.cshtml | 20 +- .../Views/MemoryByOwnedMachines/Create.cshtml | 57 +- .../Views/MemoryByOwnedMachines/Delete.cshtml | 13 +- .../MemoryByOwnedMachines/Details.cshtml | 9 +- .../Views/MemoryByOwnedMachines/Edit.cshtml | 60 +- .../Views/MemoryByOwnedMachines/Index.cshtml | 20 +- Marechai/Areas/Admin/Views/News/Delete.cshtml | 13 +- Marechai/Areas/Admin/Views/News/Index.cshtml | 9 +- .../Admin/Views/OwnedMachine/Create.cshtml | 85 +- .../Admin/Views/OwnedMachine/Delete.cshtml | 13 +- .../Admin/Views/OwnedMachine/Details.cshtml | 9 +- .../Admin/Views/OwnedMachine/Edit.cshtml | 89 +- .../Admin/Views/OwnedMachine/Index.cshtml | 7 +- .../Areas/Admin/Views/People/Create.cshtml | 100 +- .../Areas/Admin/Views/People/Delete.cshtml | 17 +- .../Areas/Admin/Views/People/Details.cshtml | 13 +- Marechai/Areas/Admin/Views/People/Edit.cshtml | 103 +- .../Areas/Admin/Views/People/Index.cshtml | 61 +- .../Admin/Views/Processors/Create.cshtml | 451 +- .../Admin/Views/Processors/Delete.cshtml | 13 +- .../Admin/Views/Processors/Details.cshtml | 9 +- .../Areas/Admin/Views/Processors/Edit.cshtml | 454 +- .../Areas/Admin/Views/Processors/Index.cshtml | 20 +- .../Views/ProcessorsByMachines/Create.cshtml | 35 +- .../Views/ProcessorsByMachines/Delete.cshtml | 13 +- .../Views/ProcessorsByMachines/Details.cshtml | 9 +- .../Views/ProcessorsByMachines/Edit.cshtml | 44 +- .../Views/ProcessorsByMachines/Index.cshtml | 20 +- .../ProcessorsByOwnedMachines/Create.cshtml | 35 +- .../ProcessorsByOwnedMachines/Delete.cshtml | 13 +- .../ProcessorsByOwnedMachines/Details.cshtml | 9 +- .../ProcessorsByOwnedMachines/Edit.cshtml | 44 +- .../ProcessorsByOwnedMachines/Index.cshtml | 20 +- .../Admin/Views/Resolutions/Create.cshtml | 48 +- .../Admin/Views/Resolutions/Delete.cshtml | 13 +- .../Admin/Views/Resolutions/Details.cshtml | 9 +- .../Areas/Admin/Views/Resolutions/Edit.cshtml | 51 +- .../Admin/Views/Resolutions/Index.cshtml | 20 +- .../Views/ResolutionsByGpu/Create.cshtml | 32 +- .../Views/ResolutionsByGpu/Delete.cshtml | 13 +- .../Views/ResolutionsByGpu/Details.cshtml | 9 +- .../Admin/Views/ResolutionsByGpu/Edit.cshtml | 35 +- .../Admin/Views/ResolutionsByGpu/Index.cshtml | 20 +- .../Views/ResolutionsByScreen/Create.cshtml | 32 +- .../Views/ResolutionsByScreen/Delete.cshtml | 22 +- .../Views/ResolutionsByScreen/Details.cshtml | 18 +- .../Views/ResolutionsByScreen/Edit.cshtml | 34 +- .../Views/ResolutionsByScreen/Index.cshtml | 29 +- .../Areas/Admin/Views/Screens/Create.cshtml | 67 +- .../Areas/Admin/Views/Screens/Delete.cshtml | 13 +- .../Areas/Admin/Views/Screens/Details.cshtml | 9 +- .../Areas/Admin/Views/Screens/Edit.cshtml | 71 +- .../Areas/Admin/Views/Screens/Index.cshtml | 20 +- .../Views/ScreensByMachine/Create.cshtml | 32 +- .../Views/ScreensByMachine/Delete.cshtml | 13 +- .../Views/ScreensByMachine/Details.cshtml | 9 +- .../Admin/Views/ScreensByMachine/Edit.cshtml | 35 +- .../Admin/Views/ScreensByMachine/Index.cshtml | 20 +- .../Admin/Views/SoundByMachine/Create.cshtml | 13 +- .../Admin/Views/SoundByMachine/Delete.cshtml | 15 +- .../Admin/Views/SoundByMachine/Details.cshtml | 12 +- .../Admin/Views/SoundByMachine/Edit.cshtml | 9 +- .../Admin/Views/SoundByMachine/Index.cshtml | 20 +- .../Views/SoundByOwnedMachine/Create.cshtml | 26 +- .../Views/SoundByOwnedMachine/Delete.cshtml | 13 +- .../Views/SoundByOwnedMachine/Details.cshtml | 9 +- .../Views/SoundByOwnedMachine/Edit.cshtml | 35 +- .../Views/SoundByOwnedMachine/Index.cshtml | 20 +- .../Admin/Views/SoundSynths/Create.cshtml | 100 +- .../Admin/Views/SoundSynths/Delete.cshtml | 13 +- .../Admin/Views/SoundSynths/Details.cshtml | 9 +- .../Areas/Admin/Views/SoundSynths/Edit.cshtml | 106 +- .../Admin/Views/SoundSynths/Index.cshtml | 20 +- .../Views/StorageByMachines/Create.cshtml | 48 +- .../Views/StorageByMachines/Delete.cshtml | 13 +- .../Views/StorageByMachines/Details.cshtml | 4 +- .../Admin/Views/StorageByMachines/Edit.cshtml | 54 +- .../Views/StorageByMachines/Index.cshtml | 20 +- .../StorageByOwnedMachines/Create.cshtml | 48 +- .../StorageByOwnedMachines/Delete.cshtml | 13 +- .../StorageByOwnedMachines/Details.cshtml | 9 +- .../Views/StorageByOwnedMachines/Edit.cshtml | 54 +- .../Views/StorageByOwnedMachines/Index.cshtml | 20 +- .../Api/Controllers/CompaniesController.cs | 19 +- .../Api/Controllers/MachinesController.cs | 19 +- .../Areas/Api/Controllers/NewsController.cs | 19 +- .../Areas/Identity/IdentityHostingStartup.cs | 12 +- .../Pages/_ValidationScriptsPartial.cshtml | 14 +- .../Areas/Identity/Pages/_ViewStart.cshtml | 2 +- Marechai/Controllers/CompanyController.cs | 38 +- Marechai/Controllers/ComputerController.cs | 36 +- Marechai/Controllers/ConsoleController.cs | 36 +- Marechai/Controllers/HomeController.cs | 19 +- Marechai/Controllers/MachineController.cs | 2 +- Marechai/Helpers/AddPhoto.cs | 123 +- Marechai/Helpers/Iso639.cs | 50 +- Marechai/Helpers/SvgRender.cs | 79 +- Marechai/Interop/DetectOS.cs | 292 +- Marechai/Interop/PlatformID.cs | 151 +- Marechai/Interop/Version.cs | 32 +- Marechai/Marechai.csproj | 2 +- Marechai/Models/NewsModel.cs | 21 +- Marechai/Program.cs | 37 +- Marechai/Startup.cs | 23 +- Marechai/Views/Company/ByCountry.cshtml | 43 +- Marechai/Views/Company/ByLetter.cshtml | 30 +- Marechai/Views/Company/Index.cshtml | 28 +- Marechai/Views/Company/View.cshtml | 521 +- Marechai/Views/Computer/ByLetter.cshtml | 15 +- Marechai/Views/Computer/ByYear.cshtml | 17 +- Marechai/Views/Computer/Index.cshtml | 235 +- Marechai/Views/Console/ByLetter.cshtml | 15 +- Marechai/Views/Console/ByYear.cshtml | 17 +- Marechai/Views/Console/Index.cshtml | 235 +- Marechai/Views/Home/About.cshtml | 33 +- Marechai/Views/Home/Contact.cshtml | 6 +- Marechai/Views/Home/Index.cshtml | 27 +- Marechai/Views/Machine/View.cshtml | 386 +- Marechai/Views/Shared/Error.cshtml | 19 +- .../Views/Shared/_CookieConsentPartial.cshtml | 12 +- Marechai/Views/Shared/_Layout.cshtml | 103 +- Marechai/Views/Shared/_LoginPartial.cshtml | 39 +- .../Shared/_ValidationScriptsPartial.cshtml | 20 +- 345 files changed, 15117 insertions(+), 20198 deletions(-) diff --git a/Marechai.Database/Enums.cs b/Marechai.Database/Enums.cs index a1371050..07117023 100644 --- a/Marechai.Database/Enums.cs +++ b/Marechai.Database/Enums.cs @@ -29,6 +29,7 @@ *******************************************************************************/ using System.ComponentModel.DataAnnotations; + // ReSharper disable UnusedMember.Global // ReSharper disable InconsistentNaming @@ -36,27 +37,18 @@ namespace Marechai.Database { public enum NewsType { - NewComputerInDb = 1, - NewConsoleInDb = 2, - NewComputerInCollection = 3, - NewConsoleInCollection = 4, - UpdatedComputerInDb = 5, - UpdatedConsoleInDb = 6, - UpdatedComputerInCollection = 7, - UpdatedConsoleInCollection = 8, - NewMoneyDonation = 9 + NewComputerInDb = 1, NewConsoleInDb = 2, NewComputerInCollection = 3, + NewConsoleInCollection = 4, UpdatedComputerInDb = 5, UpdatedConsoleInDb = 6, + UpdatedComputerInCollection = 7, UpdatedConsoleInCollection = 8, NewMoneyDonation = 9 } public enum StatusType { [Display(Name = "Unknown")] - Unknown = 0, - [Display(Name = "Tested good")] - TestedGood = 1, - [Display(Name = "Not tested")] - NotTested = 2, - [Display(Name = "Tested bad")] - TestedBad = 3 + Unknown = 0, [Display(Name = "Tested good")] + TestedGood = 1, [Display(Name = "Not tested")] + NotTested = 2, [Display(Name = "Tested bad")] + TestedBad = 3 } public enum CompanyStatus @@ -243,22 +235,15 @@ namespace Marechai.Database /// Pioneer LaserDisc LD = 21, /// Pioneer LaserDisc data - LDROM = 22, - LDROM2 = 23, - LVROM = 24, - MegaLD = 254, + LDROM = 22, LDROM2 = 23, LVROM = 24, MegaLD = 254, /// Sony Hi-MD HiMD = 26, /// Sony MiniDisc - MD = 27, - MDData = 28, - MDData2 = 29, + MD = 27, MDData = 28, MDData2 = 29, /// 5.25", Phase-Change, 1834348 sectors, 8192 bytes/sector, Ultra Density Optical, ECMA-350, ISO 17345 UDO = 30, /// 5.25", Phase-Change, 3669724 sectors, 8192 bytes/sector, Ultra Density Optical 2, ECMA-380, ISO 11976 - UDO2 = 31, - PlayStationMemoryCard = 32, - PlayStationMemoryCard2 = 33, + UDO2 = 31, PlayStationMemoryCard = 32, PlayStationMemoryCard2 = 33, /// Sony PlayStation game CD PS1CD = 34, /// Sony PlayStation 2 game CD @@ -286,8 +271,7 @@ namespace Marechai.Database /// Sega Saturn disc SATURNCD = 46, /// Sega/Yamaha Gigabyte Disc - GDROM = 47, - SegaCard = 48, + GDROM = 47, SegaCard = 48, /// PC-Engine / TurboGrafx cartridge HuCard = 49, /// PC-Engine / TurboGrafx CD @@ -307,383 +291,212 @@ namespace Marechai.Database /// 3.5" floppy Microfloppy = 57, /// 5.25", DS, ?D, ?? tracks, ?? spt, 512 bytes/sector, GCR, opposite side heads, aka Twiggy - AppleFileWare = 58, - Bernoulli = 59, - Bernoulli2 = 60, - Ditto = 61, - DittoMax = 62, - Jaz = 63, - Jaz2 = 64, - PocketZip = 65, - REV120 = 66, - REV35 = 67, - REV70 = 68, - ZIP100 = 69, - ZIP250 = 70, - ZIP750 = 71, - CompactCassette = 72, - Data8 = 73, - MiniDV = 74, - CFast = 75, - CompactFlash = 76, - CompactFlashType2 = 77, - EZ135 = 78, - EZ230 = 79, - Quest = 80, - SparQ = 81, - SQ100 = 82, - SQ200 = 83, - SQ300 = 84, - SQ310 = 85, - SQ327 = 86, - SQ400 = 87, - SQ800 = 88, - SQ1500 = 89, - SQ2000 = 90, - SyJet = 91, - FamicomGamePak = 92, - GameBoyAdvanceGamePak = 93, - GameBoyGamePak = 94, - GOD = 95, - N64DD = 96, - N64GamePak = 97, - NESGamePak = 98, - Nintendo3DSGameCard = 99, - NintendoDiskCard = 100, - NintendoDSGameCard = 101, - NintendoDSiGameCard = 102, - SNESGamePak = 103, - SNESGamePakUS = 104, - WOD = 105, - WUOD = 106, - SwitchGameCard = 107, - MemoryStick = 108, - MemoryStickDuo = 109, - MemoryStickMicro = 110, - MemoryStickPro = 111, - MemoryStickProDuo = 112, - microSD = 113, - miniSD = 114, - SecureDigital = 115, - MMC = 116, - MMCmicro = 117, - RSMMC = 118, - MMCplus = 118, - MMCmobile = 119, - eMMC = 120, - MO120 = 121, - MO90 = 122, - MO300 = 123, - MO356 = 124, - CompactFloppy = 125, - DemiDiskette = 126, + AppleFileWare = 58, Bernoulli = 59, Bernoulli2 = 60, Ditto = 61, + DittoMax = 62, Jaz = 63, Jaz2 = 64, + PocketZip = 65, REV120 = 66, REV35 = 67, + REV70 = 68, ZIP100 = 69, ZIP250 = 70, + ZIP750 = 71, CompactCassette = 72, Data8 = 73, + MiniDV = 74, CFast = 75, CompactFlash = 76, + CompactFlashType2 = 77, EZ135 = 78, EZ230 = 79, + Quest = 80, SparQ = 81, SQ100 = 82, + SQ200 = 83, SQ300 = 84, SQ310 = 85, + SQ327 = 86, SQ400 = 87, SQ800 = 88, + SQ1500 = 89, SQ2000 = 90, SyJet = 91, + FamicomGamePak = 92, GameBoyAdvanceGamePak = 93, GameBoyGamePak = 94, + GOD = 95, N64DD = 96, N64GamePak = 97, + NESGamePak = 98, Nintendo3DSGameCard = 99, NintendoDiskCard = 100, + NintendoDSGameCard = 101, NintendoDSiGameCard = 102, SNESGamePak = 103, + SNESGamePakUS = 104, WOD = 105, WUOD = 106, + SwitchGameCard = 107, MemoryStick = 108, MemoryStickDuo = 109, + MemoryStickMicro = 110, MemoryStickPro = 111, MemoryStickProDuo = 112, + microSD = 113, miniSD = 114, SecureDigital = 115, + MMC = 116, MMCmicro = 117, RSMMC = 118, + MMCplus = 118, MMCmobile = 119, eMMC = 120, + MO120 = 121, MO90 = 122, MO300 = 123, + MO356 = 124, CompactFloppy = 125, DemiDiskette = 126, /// 3.5", 652 tracks, 2 sides, 512 bytes/sector, Floptical, ECMA-207, ISO 14169 - Floptical = 127, - HiFD = 128, - QuickDisk = 129, - UHD144 = 130, - VideoFloppy = 131, - Wafer = 132, - ZXMicrodrive = 133, - BeeCard = 134, - Borsu = 135, - DataStore = 136, - MiniCard = 137, - Orb = 138, - Orb5 = 139, - SmartMedia = 140, - xD = 141, - XQD = 142, - DataPlay = 143, - LS120 = 144, - LS240 = 145, - FD32MB = 146, - RDX = 147, - PunchedCard = 148 + Floptical = 127, HiFD = 128, QuickDisk = 129, UHD144 = 130, + VideoFloppy = 131, Wafer = 132, ZXMicrodrive = 133, + BeeCard = 134, Borsu = 135, DataStore = 136, + MiniCard = 137, Orb = 138, Orb5 = 139, + SmartMedia = 140, xD = 141, XQD = 142, + DataPlay = 143, LS120 = 144, LS240 = 145, + FD32MB = 146, RDX = 147, PunchedCard = 148 } public enum StorageInterface { - Unknown = 0, - ACSI = 1, - ATA = 2, - XTA = 3, - ESDI = 4, - SCSI = 5, - USB = 6, - FireWire = 7, - SASI = 8, - ST506 = 9, - IPI = 10, - SMD = 11, - SATA = 12, - SSA = 13, - DSSI = 14, - HIPPI = 15, - SAS = 16, - FC = 17, - PCIe = 18, - M2 = 19, - SataExpress = 20 + Unknown = 0, ACSI = 1, ATA = 2, + XTA = 3, ESDI = 4, SCSI = 5, + USB = 6, FireWire = 7, SASI = 8, + ST506 = 9, IPI = 10, SMD = 11, + SATA = 12, SSA = 13, DSSI = 14, + HIPPI = 15, SAS = 16, FC = 17, + PCIe = 18, M2 = 19, SataExpress = 20 } public enum ColorSpace : ushort { [Display(Name = "sRGB")] - Srgb = 1, - [Display(Name = "Adobe RGB")] - AdobeRgb = 2, - [Display(Name = "Wide Gamut RGB")] - WideGamutRgb = 4093, - [Display(Name = "ICC Profile")] - IccProfile = 65534, - [Display(Name = "Uncalibrated")] + Srgb = 1, [Display(Name = "Adobe RGB")] + AdobeRgb = 2, [Display(Name = "Wide Gamut RGB")] + WideGamutRgb = 4093, [Display(Name = "ICC Profile")] + IccProfile = 65534, [Display(Name = "Uncalibrated")] Uncalibreated = 65535 } public enum Contrast : ushort { - Normal = 0, - Low = 1, - Hig = 2 + Normal = 0, Low = 1, Hig = 2 } public enum ExposureMode : ushort { - Auto = 0, - Manual = 1, - [Display(Name = "Auto bracket")] + Auto = 0, Manual = 1, [Display(Name = "Auto bracket")] AutoBracket = 2 } public enum ExposureProgram : ushort { [Display(Name = "Not Defined")] - Undefined = 0, - [Display(Name = "Manual")] - Manual = 1, - [Display(Name = "Program AE")] - ProgramAe = 2, - [Display(Name = "Aperture-priority AE")] - ApAe = 3, - [Display(Name = "Shutter speed priority AE")] - ShutterAe = 4, - [Display(Name = "Creative (Slow speed)")] - Creative = 5, - [Display(Name = "Action (High speed)")] - Action = 6, - [Display(Name = "Portrait")] - Portrait = 7, - [Display(Name = "Landscape")] - Landscape = 8, - [Display(Name = "Bulb")] + Undefined = 0, [Display(Name = "Manual")] + Manual = 1, [Display(Name = "Program AE")] + ProgramAe = 2, [Display(Name = "Aperture-priority AE")] + ApAe = 3, [Display(Name = "Shutter speed priority AE")] + ShutterAe = 4, [Display(Name = "Creative (Slow speed)")] + Creative = 5, [Display(Name = "Action (High speed)")] + Action = 6, [Display(Name = "Portrait")] + Portrait = 7, [Display(Name = "Landscape")] + Landscape = 8, [Display(Name = "Bulb")] Bulb = 9 } public enum Flash : ushort { [Display(Name = "No Flash")] - None = 0, - [Display(Name = "Fired")] - Fired = 1, - [Display(Name = "Fired, Return not detected")] - FiredNoReturn = 5, - [Display(Name = "Fired, Return detected")] - FiredReturn = 7, - [Display(Name = "On, Did not fire")] - OnDidNotFire = 8, - [Display(Name = "On, Fired")] - OnFired = 9, - [Display(Name = "On, Return not detected")] - OnNoReturn = 13, - [Display(Name = "On, Return detected")] - OnReturn = 15, - [Display(Name = "Off, Did not fire")] - OffDidNotFire = 16, - [Display(Name = "Off, Did not fire, Return not detected")] - OffDidNotFireNoReturn = 20, - [Display(Name = "Auto, Did not fire")] - AutoDidNotFire = 24, - [Display(Name = "Auto, Fired")] - AutoFired = 25, - [Display(Name = "Auto, Fired, Return not detected")] - AutoFiredNoReturn = 29, - [Display(Name = "Auto, Fired, Return detected")] - AutoFiredReturn = 31, - [Display(Name = "No flash function")] - NoFlash = 32, - [Display(Name = "Off, No flash function")] - OffNoFlash = 48, - [Display(Name = "Fired, Red-eye reduction")] - FiredRedEye = 65, - [Display(Name = "Fired, Red-eye reduction, Return not detected")] - FiredRedEyeNoReturn = 69, - [Display(Name = "Fired, Red-eye reduction, Return detected")] - FiredRedEyeReturn = 71, - [Display(Name = "On, Red-eye reduction")] - OnRedEye = 73, - [Display(Name = "On, Red-eye reduction, Return not detected")] - OnRedEyeNoReturn = 77, - [Display(Name = "On, Red-eye reduction, Return detected")] - OnRedEyeReturn = 79, - [Display(Name = "Off, Red-eye reduction")] - OffRedEye = 80, - [Display(Name = "Auto, Did not fire, Red-eye reduction")] - AutoNotFireRedEye = 88, - [Display(Name = "Auto, Fired, Red-eye reduction")] - AutoFiredRedEye = 89, - [Display(Name = "Auto, Fired, Red-eye reduction, Return not detected")] - AutoFiredRedEyeNoReturn = 93, - [Display(Name = "Auto, Fired, Red-eye reduction, Return detected")] + None = 0, [Display(Name = "Fired")] + Fired = 1, [Display(Name = "Fired, Return not detected")] + FiredNoReturn = 5, [Display(Name = "Fired, Return detected")] + FiredReturn = 7, [Display(Name = "On, Did not fire")] + OnDidNotFire = 8, [Display(Name = "On, Fired")] + OnFired = 9, [Display(Name = "On, Return not detected")] + OnNoReturn = 13, [Display(Name = "On, Return detected")] + OnReturn = 15, [Display(Name = "Off, Did not fire")] + OffDidNotFire = 16, [Display(Name = "Off, Did not fire, Return not detected")] + OffDidNotFireNoReturn = 20, [Display(Name = "Auto, Did not fire")] + AutoDidNotFire = 24, [Display(Name = "Auto, Fired")] + AutoFired = 25, [Display(Name = "Auto, Fired, Return not detected")] + AutoFiredNoReturn = 29, [Display(Name = "Auto, Fired, Return detected")] + AutoFiredReturn = 31, [Display(Name = "No flash function")] + NoFlash = 32, [Display(Name = "Off, No flash function")] + OffNoFlash = 48, [Display(Name = "Fired, Red-eye reduction")] + FiredRedEye = 65, [Display(Name = "Fired, Red-eye reduction, Return not detected")] + FiredRedEyeNoReturn = 69, [Display(Name = "Fired, Red-eye reduction, Return detected")] + FiredRedEyeReturn = 71, [Display(Name = "On, Red-eye reduction")] + OnRedEye = 73, [Display(Name = "On, Red-eye reduction, Return not detected")] + OnRedEyeNoReturn = 77, [Display(Name = "On, Red-eye reduction, Return detected")] + OnRedEyeReturn = 79, [Display(Name = "Off, Red-eye reduction")] + OffRedEye = 80, [Display(Name = "Auto, Did not fire, Red-eye reduction")] + AutoNotFireRedEye = 88, [Display(Name = "Auto, Fired, Red-eye reduction")] + AutoFiredRedEye = 89, [Display(Name = "Auto, Fired, Red-eye reduction, Return not detected")] + AutoFiredRedEyeNoReturn = 93, [Display(Name = "Auto, Fired, Red-eye reduction, Return detected")] AutoFiredRedEyeReturn = 95 } public enum LightSource : ushort { [Display(Name = "Unknown")] - Unknown = 0, - [Display(Name = "Daylight")] - Daylight = 1, - [Display(Name = "Fluorescent")] - Fluorescent = 2, - [Display(Name = "Tungsten (Incandescent)")] - Incandescent = 3, - [Display(Name = "Flash")] - Flash = 4, - [Display(Name = "Fine Weather")] - FineWeather = 9, - [Display(Name = "Cloudy")] - Cloudy = 10, - [Display(Name = "Shade")] - Shade = 11, - [Display(Name = "Daylight Fluorescent")] - DaylightFluorescent = 12, - [Display(Name = "Day White Fluorescent")] - DayWhiteFluorescent = 13, - [Display(Name = "Cool White Fluorescent")] - CoolWhiteFluorescent = 14, - [Display(Name = "White Fluorescent")] - WhiteFluorescent = 15, - [Display(Name = "Warm White Fluorescent")] - WarmWhiteFluorescent = 16, - [Display(Name = "Standard Light A")] - StandardLightA = 17, - [Display(Name = "Standard Light B")] - StandardLightB = 18, - [Display(Name = "Standard Light C")] - StandardLightC = 19, - [Display(Name = "D55")] - D55 = 20, - [Display(Name = "D65")] - D65 = 21, - [Display(Name = "D75")] - D75 = 22, - [Display(Name = "D50")] - D50 = 23, - [Display(Name = "ISO Studio Tungsten")] - ISOStudioTungsten = 24, - [Display(Name = "Other")] + Unknown = 0, [Display(Name = "Daylight")] + Daylight = 1, [Display(Name = "Fluorescent")] + Fluorescent = 2, [Display(Name = "Tungsten (Incandescent)")] + Incandescent = 3, [Display(Name = "Flash")] + Flash = 4, [Display(Name = "Fine Weather")] + FineWeather = 9, [Display(Name = "Cloudy")] + Cloudy = 10, [Display(Name = "Shade")] + Shade = 11, [Display(Name = "Daylight Fluorescent")] + DaylightFluorescent = 12, [Display(Name = "Day White Fluorescent")] + DayWhiteFluorescent = 13, [Display(Name = "Cool White Fluorescent")] + CoolWhiteFluorescent = 14, [Display(Name = "White Fluorescent")] + WhiteFluorescent = 15, [Display(Name = "Warm White Fluorescent")] + WarmWhiteFluorescent = 16, [Display(Name = "Standard Light A")] + StandardLightA = 17, [Display(Name = "Standard Light B")] + StandardLightB = 18, [Display(Name = "Standard Light C")] + StandardLightC = 19, [Display(Name = "D55")] + D55 = 20, [Display(Name = "D65")] + D65 = 21, [Display(Name = "D75")] + D75 = 22, [Display(Name = "D50")] + D50 = 23, [Display(Name = "ISO Studio Tungsten")] + ISOStudioTungsten = 24, [Display(Name = "Other")] Other = 255 } public enum MeteringMode : ushort { [Display(Name = "Unknown")] - Unknown = 0, - [Display(Name = "Average")] - Average = 1, - [Display(Name = "Center-weighted average")] - CenterWeightedAverage = 2, - [Display(Name = "Spot")] - Spot = 3, - [Display(Name = "Multi-spot")] - MultiSpot = 4, - [Display(Name = "Multi-segment")] - MultiSegment = 5, - [Display(Name = "Partial")] - Partial = 6, - [Display(Name = "Other")] + Unknown = 0, [Display(Name = "Average")] + Average = 1, [Display(Name = "Center-weighted average")] + CenterWeightedAverage = 2, [Display(Name = "Spot")] + Spot = 3, [Display(Name = "Multi-spot")] + MultiSpot = 4, [Display(Name = "Multi-segment")] + MultiSegment = 5, [Display(Name = "Partial")] + Partial = 6, [Display(Name = "Other")] Other = 255 } public enum Orientation : ushort { [Display(Name = "Horizontal (normal)")] - Horizontal = 1, - [Display(Name = "Mirror horizontal")] - MirrorHorizontal = 2, - [Display(Name = "Rotate 180")] - Rotate180 = 3, - [Display(Name = "Mirror vertical")] - MirrorVertical = 4, - [Display(Name = "Mirror horizontal and rotate 270 CW")] - MirrorHorizontalAndRotate270CW = 5, - [Display(Name = "Rotate 90 CW")] - Rotate90CW = 6, - [Display(Name = "Mirror horizontal and rotate 90 CW")] - MirrorHorizontalAndRotate90CW = 7, - [Display(Name = "Rotate 270 CW")] + Horizontal = 1, [Display(Name = "Mirror horizontal")] + MirrorHorizontal = 2, [Display(Name = "Rotate 180")] + Rotate180 = 3, [Display(Name = "Mirror vertical")] + MirrorVertical = 4, [Display(Name = "Mirror horizontal and rotate 270 CW")] + MirrorHorizontalAndRotate270CW = 5, [Display(Name = "Rotate 90 CW")] + Rotate90CW = 6, [Display(Name = "Mirror horizontal and rotate 90 CW")] + MirrorHorizontalAndRotate90CW = 7, [Display(Name = "Rotate 270 CW")] Rotate270CW = 8 } public enum ResolutionUnit : ushort { - None = 1, - Inches = 2, - Centimeters = 3 + None = 1, Inches = 2, Centimeters = 3 } public enum Saturation : ushort { - Normal = 0, - Low = 1, - Hig = 2 + Normal = 0, Low = 1, Hig = 2 } public enum SceneCaptureType : ushort { - Standard = 0, - Landscape = 1, - Portrait = 2, - Night = 3 + Standard = 0, Landscape = 1, Portrait = 2, + Night = 3 } public enum SensingMethod : ushort { [Display(Name = "Not defined")] - Undefined = 1, - [Display(Name = "One-chip color area")] - OneChipColorArea = 2, - [Display(Name = "Two-chip color area")] - TwoChipColorArea = 3, - [Display(Name = "Three-chip color area")] - ThreeChipColorArea = 4, - [Display(Name = "Color sequential area")] - ColorSequentialArea = 5, - [Display(Name = "Trilinear")] - Trilinear = 7, - [Display(Name = "Color sequential linear")] + Undefined = 1, [Display(Name = "One-chip color area")] + OneChipColorArea = 2, [Display(Name = "Two-chip color area")] + TwoChipColorArea = 3, [Display(Name = "Three-chip color area")] + ThreeChipColorArea = 4, [Display(Name = "Color sequential area")] + ColorSequentialArea = 5, [Display(Name = "Trilinear")] + Trilinear = 7, [Display(Name = "Color sequential linear")] ColorSequentialLinear = 8 } public enum SubjectDistanceRange : ushort { - Unknown = 0, - Macro = 1, - Close = 2, + Unknown = 0, Macro = 1, Close = 2, Distant = 3 } public enum WhiteBalance : ushort { - Auto = 0, - Manual = 1 + Auto = 0, Manual = 1 } public enum Sharpness : ushort { - Normal = 0, - Low = 1, - Hig = 2 + Normal = 0, Low = 1, Hig = 2 } } \ No newline at end of file diff --git a/Marechai.Database/IDbCore.cs b/Marechai.Database/IDbCore.cs index cab322a6..b8f89611 100644 --- a/Marechai.Database/IDbCore.cs +++ b/Marechai.Database/IDbCore.cs @@ -41,9 +41,7 @@ namespace Marechai.Database /// Last inserted row's ID long LastInsertRowId { get; } - /// - /// Opens an existing database - /// + /// Opens an existing database /// Server /// User /// Database name @@ -52,14 +50,10 @@ namespace Marechai.Database /// true if database opened correctly, false otherwise bool OpenDb(string server, string user, string database, string password, ushort port); - /// - /// Closes the database - /// + /// Closes the database void CloseDb(); - /// - /// Gets a data adapter for the opened database - /// + /// Gets a data adapter for the opened database /// Data adapter IDbDataAdapter GetNewDataAdapter(); diff --git a/Marechai.Database/Migrations/20180805214952_InitialMigration.cs b/Marechai.Database/Migrations/20180805214952_InitialMigration.cs index e6aa9c01..c1905a40 100644 --- a/Marechai.Database/Migrations/20180805214952_InitialMigration.cs +++ b/Marechai.Database/Migrations/20180805214952_InitialMigration.cs @@ -38,603 +38,473 @@ namespace Marechai.Database.Migrations { protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.CreateTable("admins", - table => new - { - id = table.Column("int(11)", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - user = - table.Column("char(50)", nullable: false, - defaultValueSql: "''"), - password = table.Column("char(50)", nullable: false, - defaultValueSql: "''") - }, constraints: table => { table.PrimaryKey("PK_admins", x => x.id); }); + migrationBuilder.CreateTable("admins", table => new + { + id = table.Column("int(11)"). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + user = table.Column("char(50)", nullable: false, defaultValueSql: "''"), + password = table.Column("char(50)", nullable: false, defaultValueSql: "''") + }, constraints: table => + { + table.PrimaryKey("PK_admins", x => x.id); + }); - migrationBuilder.CreateTable("browser_tests", - table => new - { - id = - table.Column("int(11)", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - user_agent = - table.Column("varchar(128)", nullable: false, - defaultValueSql: "''"), - browser = - table.Column("varchar(64)", nullable: false, - defaultValueSql: "''"), - version = - table.Column("varchar(16)", nullable: false, - defaultValueSql: "''"), - os = - table.Column("varchar(32)", nullable: false, - defaultValueSql: "''"), - platform = - table.Column("varchar(8)", nullable: false, - defaultValueSql: "''"), - gif87 = - table.Column("tinyint(1)", nullable: false, - defaultValueSql: "'0'"), - gif89 = - table.Column("tinyint(1)", nullable: false, - defaultValueSql: "'0'"), - jpeg = - table.Column("tinyint(1)", nullable: false, - defaultValueSql: "'0'"), - png = - table.Column("tinyint(1)", nullable: false, - defaultValueSql: "'0'"), - pngt = - table.Column("tinyint(1)", nullable: false, - defaultValueSql: "'0'"), - agif = - table.Column("tinyint(1)", nullable: false, - defaultValueSql: "'0'"), - table = - table.Column("tinyint(1)", nullable: false, - defaultValueSql: "'0'"), - colors = - table.Column("tinyint(1)", nullable: false, - defaultValueSql: "'0'"), - js = - table.Column("tinyint(1)", nullable: false, - defaultValueSql: "'0'"), - frames = - table.Column("tinyint(1)", nullable: false, - defaultValueSql: "'0'"), - flash = table.Column("tinyint(1)", nullable: false, - defaultValueSql: "'0'") - }, constraints: table => { table.PrimaryKey("PK_browser_tests", x => x.id); }); + migrationBuilder.CreateTable("browser_tests", table => new + { + id = table.Column("int(11)"). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + user_agent = table.Column("varchar(128)", nullable: false, defaultValueSql: "''"), + browser = table.Column("varchar(64)", nullable: false, defaultValueSql: "''"), + version = table.Column("varchar(16)", nullable: false, defaultValueSql: "''"), + os = table.Column("varchar(32)", nullable: false, defaultValueSql: "''"), + platform = table.Column("varchar(8)", nullable: false, defaultValueSql: "''"), + gif87 = table.Column("tinyint(1)", nullable: false, defaultValueSql: "'0'"), + gif89 = table.Column("tinyint(1)", nullable: false, defaultValueSql: "'0'"), + jpeg = table.Column("tinyint(1)", nullable: false, defaultValueSql: "'0'"), + png = table.Column("tinyint(1)", nullable: false, defaultValueSql: "'0'"), + pngt = table.Column("tinyint(1)", nullable: false, defaultValueSql: "'0'"), + agif = table.Column("tinyint(1)", nullable: false, defaultValueSql: "'0'"), + table = table.Column("tinyint(1)", nullable: false, defaultValueSql: "'0'"), + colors = table.Column("tinyint(1)", nullable: false, defaultValueSql: "'0'"), + js = table.Column("tinyint(1)", nullable: false, defaultValueSql: "'0'"), + frames = table.Column("tinyint(1)", nullable: false, defaultValueSql: "'0'"), + flash = table.Column("tinyint(1)", nullable: false, defaultValueSql: "'0'") + }, constraints: table => + { + table.PrimaryKey("PK_browser_tests", x => x.id); + }); - migrationBuilder.CreateTable("marechai_db", - table => new - { - id = table.Column("int(11)", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - version = table.Column("int(11)", nullable: false), - updated = table.Column("timestamp", nullable: true, - defaultValueSql: "CURRENT_TIMESTAMP") - }, constraints: table => { table.PrimaryKey("PK_marechai_db", x => x.id); }); + migrationBuilder.CreateTable("marechai_db", table => new + { + id = table.Column("int(11)"). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + version = table.Column("int(11)"), + updated = table.Column("timestamp", nullable: true, + defaultValueSql: "CURRENT_TIMESTAMP") + }, constraints: table => + { + table.PrimaryKey("PK_marechai_db", x => x.id); + }); - migrationBuilder.CreateTable("forbidden", - table => new - { - id = - table.Column("int(11)", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - browser = - table.Column("char(128)", nullable: false, - defaultValueSql: "''"), - date = - table.Column("char(20)", nullable: false, - defaultValueSql: "''"), - ip = table.Column("char(16)", nullable: false, - defaultValueSql: "''"), - referer = table.Column("char(255)", nullable: false, - defaultValueSql: "''") - }, constraints: table => { table.PrimaryKey("PK_forbidden", x => x.id); }); + migrationBuilder.CreateTable("forbidden", table => new + { + id = table.Column("int(11)"). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + browser = table.Column("char(128)", nullable: false, defaultValueSql: "''"), + date = table.Column("char(20)", nullable: false, defaultValueSql: "''"), + ip = table.Column("char(16)", nullable: false, defaultValueSql: "''"), + referer = table.Column("char(255)", nullable: false, defaultValueSql: "''") + }, constraints: table => + { + table.PrimaryKey("PK_forbidden", x => x.id); + }); - migrationBuilder.CreateTable("instruction_set_extensions", - table => new - { - id = table.Column("int(11)", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - extension = table.Column("varchar(45)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_instruction_set_extensions", x => x.id); - }); + migrationBuilder.CreateTable("instruction_set_extensions", table => new + { + id = table.Column("int(11)"). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + extension = table.Column("varchar(45)") + }, constraints: table => + { + table.PrimaryKey("PK_instruction_set_extensions", x => x.id); + }); - migrationBuilder.CreateTable("instruction_sets", - table => new - { - id = table.Column("int(11)", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - instruction_set = table.Column("varchar(45)", nullable: false) - }, - constraints: table => { table.PrimaryKey("PK_instruction_sets", x => x.id); }); + migrationBuilder.CreateTable("instruction_sets", table => new + { + id = table.Column("int(11)"). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + instruction_set = table.Column("varchar(45)") + }, constraints: table => + { + table.PrimaryKey("PK_instruction_sets", x => x.id); + }); - migrationBuilder.CreateTable("iso3166_1_numeric", - table => new - { - id = table.Column("smallint(3)", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - name = table.Column("varchar(64)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_iso3166_1_numeric", x => x.id); - }); + migrationBuilder.CreateTable("iso3166_1_numeric", table => new + { + id = table.Column("smallint(3)"). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + name = table.Column("varchar(64)") + }, constraints: table => + { + table.PrimaryKey("PK_iso3166_1_numeric", x => x.id); + }); - migrationBuilder.CreateTable("log", - table => new - { - id = - table.Column("int(11)", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - browser = - table.Column("char(128)", nullable: false, - defaultValueSql: "''"), - ip = - table.Column("char(16)", nullable: false, - defaultValueSql: "''"), - date = - table.Column("char(20)", nullable: false, - defaultValueSql: "''"), - referer = table.Column("char(255)", nullable: false, - defaultValueSql: "''") - }, constraints: table => { table.PrimaryKey("PK_log", x => x.id); }); + migrationBuilder.CreateTable("log", table => new + { + id = table.Column("int(11)"). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + browser = table.Column("char(128)", nullable: false, defaultValueSql: "''"), + ip = table.Column("char(16)", nullable: false, defaultValueSql: "''"), + date = table.Column("char(20)", nullable: false, defaultValueSql: "''"), + referer = table.Column("char(255)", nullable: false, defaultValueSql: "''") + }, constraints: table => + { + table.PrimaryKey("PK_log", x => x.id); + }); - migrationBuilder.CreateTable("money_donations", - table => new - { - id = table.Column("int(11)", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - donator = - table.Column("char(128)", nullable: false, - defaultValueSql: "''"), - quantity = table.Column("decimal(11,2)", nullable: false, - defaultValueSql: "'0.00'") - }, - constraints: table => { table.PrimaryKey("PK_money_donations", x => x.id); }); + migrationBuilder.CreateTable("money_donations", table => new + { + id = table.Column("int(11)"). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + donator = table.Column("char(128)", nullable: false, defaultValueSql: "''"), + quantity = table.Column("decimal(11,2)", nullable: false, defaultValueSql: "'0.00'") + }, constraints: table => + { + table.PrimaryKey("PK_money_donations", x => x.id); + }); - migrationBuilder.CreateTable("news", - table => new - { - id = table.Column("int(11)", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - date = - table.Column("char(20)", nullable: false, - defaultValueSql: "''"), - type = - table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), - added_id = table.Column("int(11)", nullable: false, - defaultValueSql: "'0'") - }, constraints: table => { table.PrimaryKey("PK_news", x => x.id); }); + migrationBuilder.CreateTable("news", table => new + { + id = table.Column("int(11)"). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + date = table.Column("char(20)", nullable: false, defaultValueSql: "''"), + type = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + added_id = table.Column("int(11)", nullable: false, defaultValueSql: "'0'") + }, constraints: table => + { + table.PrimaryKey("PK_news", x => x.id); + }); - migrationBuilder.CreateTable("owned_computers", - table => new - { - id = - table.Column("int(11)", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - db_id = - table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), - date = - table.Column("varchar(20)", nullable: false, - defaultValueSql: "''"), - status = - table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), - trade = - table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), - boxed = - table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), - manuals = - table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), - cpu1 = - table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), - mhz1 = - table.Column("decimal(10,0)", nullable: false, - defaultValueSql: "'0'"), - cpu2 = - table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), - mhz2 = - table.Column("decimal(10,0)", nullable: false, - defaultValueSql: "'0'"), - ram = - table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), - vram = - table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), - rigid = - table.Column("varchar(64)", nullable: false, - defaultValueSql: "''"), - disk1 = - table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), - cap1 = - table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), - disk2 = - table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), - cap2 = table.Column("int(11)", nullable: false, - defaultValueSql: "'0'") - }, - constraints: table => { table.PrimaryKey("PK_owned_computers", x => x.id); }); + migrationBuilder.CreateTable("owned_computers", table => new + { + id = table.Column("int(11)"). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + db_id = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + date = table.Column("varchar(20)", nullable: false, defaultValueSql: "''"), + status = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + trade = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + boxed = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + manuals = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + cpu1 = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + mhz1 = table.Column("decimal(10,0)", nullable: false, defaultValueSql: "'0'"), + cpu2 = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + mhz2 = table.Column("decimal(10,0)", nullable: false, defaultValueSql: "'0'"), + ram = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + vram = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + rigid = table.Column("varchar(64)", nullable: false, defaultValueSql: "''"), + disk1 = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + cap1 = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + disk2 = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + cap2 = table.Column("int(11)", nullable: false, defaultValueSql: "'0'") + }, constraints: table => + { + table.PrimaryKey("PK_owned_computers", x => x.id); + }); - migrationBuilder.CreateTable("owned_consoles", - table => new - { - id = - table.Column("int(11)", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - db_id = - table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), - date = - table.Column("char(20)", nullable: false, - defaultValueSql: "''"), - status = - table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), - trade = - table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), - boxed = - table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), - manuals = table.Column("int(11)", nullable: false, - defaultValueSql: "'0'") - }, constraints: table => { table.PrimaryKey("PK_owned_consoles", x => x.id); }); + migrationBuilder.CreateTable("owned_consoles", table => new + { + id = table.Column("int(11)"). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + db_id = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + date = table.Column("char(20)", nullable: false, defaultValueSql: "''"), + status = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + trade = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + boxed = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + manuals = table.Column("int(11)", nullable: false, defaultValueSql: "'0'") + }, constraints: table => + { + table.PrimaryKey("PK_owned_consoles", x => x.id); + }); - migrationBuilder.CreateTable("resolutions", - table => new - { - id = - table.Column("int(11)", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - width = - table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), - height = - table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), - colors = table.Column("bigint(20)", nullable: true), - palette = table.Column("bigint(20)", nullable: true), - chars = table.Column("tinyint(1)", nullable: false, - defaultValueSql: "'0'") - }, constraints: table => { table.PrimaryKey("PK_resolutions", x => x.id); }); + migrationBuilder.CreateTable("resolutions", table => new + { + id = table.Column("int(11)"). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + width = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + height = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + colors = table.Column("bigint(20)", nullable: true), + palette = table.Column("bigint(20)", nullable: true), + chars = table.Column("tinyint(1)", nullable: false, defaultValueSql: "'0'") + }, constraints: table => + { + table.PrimaryKey("PK_resolutions", x => x.id); + }); - migrationBuilder.CreateTable("companies", - table => new - { - id = - table.Column("int(11)", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - name = - table.Column("varchar(128)", nullable: false, - defaultValueSql: "''"), - founded = table.Column("datetime", nullable: true), - website = table.Column("varchar(255)", nullable: true), - twitter = table.Column("varchar(45)", nullable: true), - facebook = table.Column("varchar(45)", nullable: true), - sold = table.Column("datetime", nullable: true), - sold_to = table.Column("int(11)", nullable: true), - address = table.Column("varchar(80)", nullable: true), - city = table.Column("varchar(80)", nullable: true), - province = table.Column("varchar(80)", nullable: true), - postal_code = table.Column("varchar(25)", nullable: true), - country = table.Column("smallint(3)", nullable: true), - status = table.Column("int(11)", nullable: false) - }, constraints: table => - { - table.PrimaryKey("PK_companies", x => x.id); - table.ForeignKey("fk_companies_country", x => x.country, - "iso3166_1_numeric", "id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey("fk_companies_sold_to", x => x.sold_to, "companies", "id", - onDelete: ReferentialAction.Restrict); - }); + migrationBuilder.CreateTable("companies", table => new + { + id = table.Column("int(11)"). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + name = table.Column("varchar(128)", nullable: false, defaultValueSql: "''"), + founded = table.Column("datetime", nullable: true), + website = table.Column("varchar(255)", nullable: true), + twitter = table.Column("varchar(45)", nullable: true), + facebook = table.Column("varchar(45)", nullable: true), + sold = table.Column("datetime", nullable: true), + sold_to = table.Column("int(11)", nullable: true), + address = table.Column("varchar(80)", nullable: true), + city = table.Column("varchar(80)", nullable: true), + province = table.Column("varchar(80)", nullable: true), + postal_code = table.Column("varchar(25)", nullable: true), + country = table.Column("smallint(3)", nullable: true), status = table.Column("int(11)") + }, constraints: table => + { + table.PrimaryKey("PK_companies", x => x.id); - migrationBuilder.CreateTable("company_descriptions", - table => new - { - id = table.Column("int(11)", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - company_id = table.Column("int(11)", nullable: false), - text = table.Column("text", nullable: true) - }, constraints: table => - { - table.PrimaryKey("PK_company_descriptions", x => x.id); - table.ForeignKey("fk_company_id", x => x.id, "companies", "id", - onDelete: ReferentialAction.Cascade); - }); + table.ForeignKey("fk_companies_country", x => x.country, "iso3166_1_numeric", "id", + onDelete: ReferentialAction.Restrict); - migrationBuilder.CreateTable("company_logos", - table => new - { - id = table.Column("int(11)", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - company_id = table.Column("int(11)", nullable: false), - year = table.Column("int(4)", nullable: true), - logo_guid = table.Column("char(36)", nullable: false) - }, constraints: table => - { - table.PrimaryKey("PK_company_logos", - x => new {x.id, x.company_id, x.logo_guid}); - table.ForeignKey("fk_company_logos_company1", x => x.company_id, - "companies", "id", onDelete: ReferentialAction.Restrict); - }); + table.ForeignKey("fk_companies_sold_to", x => x.sold_to, "companies", "id", + onDelete: ReferentialAction.Restrict); + }); - migrationBuilder.CreateTable("gpus", - table => new - { - id = - table.Column("int(11)", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - name = - table.Column("char(128)", nullable: false, - defaultValueSql: "''"), - company = table.Column("int(11)", nullable: true), - model_code = table.Column("varchar(45)", nullable: true), - introduced = table.Column("datetime", nullable: true), - package = table.Column("varchar(45)", nullable: true), - process = table.Column("varchar(45)", nullable: true), - process_nm = table.Column(nullable: true), - die_size = table.Column(nullable: true), - transistors = table.Column("bigint(20)", nullable: true) - }, constraints: table => - { - table.PrimaryKey("PK_gpus", x => x.id); - table.ForeignKey("fk_gpus_company", x => x.company, "companies", "id", - onDelete: ReferentialAction.Restrict); - }); + migrationBuilder.CreateTable("company_descriptions", table => new + { + id = table.Column("int(11)"). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + company_id = table.Column("int(11)"), text = table.Column("text", nullable: true) + }, constraints: table => + { + table.PrimaryKey("PK_company_descriptions", x => x.id); + table.ForeignKey("fk_company_id", x => x.id, "companies", "id", onDelete: ReferentialAction.Cascade); + }); - migrationBuilder.CreateTable("machine_families", - table => new - { - id = table.Column("int(11)", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - company = table.Column("int(11)", nullable: false), - name = table.Column("varchar(255)", nullable: false) - }, constraints: table => - { - table.PrimaryKey("PK_machine_families", x => x.id); - table.ForeignKey("fk_machine_families_company", x => x.company, - "companies", "id", onDelete: ReferentialAction.Cascade); - }); + migrationBuilder.CreateTable("company_logos", table => new + { + id = table.Column("int(11)"). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + company_id = table.Column("int(11)"), year = table.Column("int(4)", nullable: true), + logo_guid = table.Column("char(36)") + }, constraints: table => + { + table.PrimaryKey("PK_company_logos", x => new + { + x.id, x.company_id, x.logo_guid + }); - migrationBuilder.CreateTable("processors", - table => new - { - id = - table.Column("int(11)", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - name = - table.Column("char(50)", nullable: false, - defaultValueSql: "''"), - company = table.Column("int(11)", nullable: true), - model_code = table.Column("varchar(45)", nullable: true), - introduced = table.Column("datetime", nullable: true), - instruction_set = table.Column("int(11)", nullable: true), - speed = table.Column(nullable: true), - package = table.Column("varchar(45)", nullable: true), - GPRs = table.Column("int(11)", nullable: true), - GPR_size = table.Column("int(11)", nullable: true), - FPRs = table.Column("int(11)", nullable: true), - FPR_size = table.Column("int(11)", nullable: true), - cores = table.Column("int(11)", nullable: true), - threads_per_core = table.Column("int(11)", nullable: true), - process = table.Column("varchar(45)", nullable: true), - process_nm = table.Column(nullable: true), - die_size = table.Column(nullable: true), - transistors = table.Column("bigint(20)", nullable: true), - data_bus = table.Column("int(11)", nullable: true), - addr_bus = table.Column("int(11)", nullable: true), - SIMD_registers = table.Column("int(11)", nullable: true), - SIMD_size = table.Column("int(11)", nullable: true), - L1_instruction = table.Column(nullable: true), - L1_data = table.Column(nullable: true), - L2 = table.Column(nullable: true), - L3 = table.Column(nullable: true) - }, constraints: table => - { - table.PrimaryKey("PK_processors", x => x.id); - table.ForeignKey("fk_processors_company", x => x.company, "companies", - "id", onDelete: ReferentialAction.Restrict); - table.ForeignKey("fk_processors_instruction_set", x => x.instruction_set, - "instruction_sets", "id", - onDelete: ReferentialAction.Restrict); - }); + table.ForeignKey("fk_company_logos_company1", x => x.company_id, "companies", "id", + onDelete: ReferentialAction.Restrict); + }); - migrationBuilder.CreateTable("sound_synths", - table => new - { - id = - table.Column("int(11)", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - name = - table.Column("char(50)", nullable: false, - defaultValueSql: "''"), - company = table.Column("int(11)", nullable: true), - model_code = table.Column("varchar(45)", nullable: true), - introduced = table.Column("datetime", nullable: true), - voices = table.Column("int(11)", nullable: true), - frequency = table.Column(nullable: true), - depth = table.Column("int(11)", nullable: true), - square_wave = table.Column("int(11)", nullable: true), - white_noise = table.Column("int(11)", nullable: true), - type = table.Column("int(11)", nullable: true) - }, constraints: table => - { - table.PrimaryKey("PK_sound_synths", x => x.id); - table.ForeignKey("fk_sound_synths_company", x => x.company, "companies", - "id", onDelete: ReferentialAction.Restrict); - }); + migrationBuilder.CreateTable("gpus", table => new + { + id = table.Column("int(11)"). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + name = table.Column("char(128)", nullable: false, defaultValueSql: "''"), + company = table.Column("int(11)", nullable: true), + model_code = table.Column("varchar(45)", nullable: true), + introduced = table.Column("datetime", nullable: true), + package = table.Column("varchar(45)", nullable: true), + process = table.Column("varchar(45)", nullable: true), + process_nm = table.Column(nullable: true), die_size = table.Column(nullable: true), + transistors = table.Column("bigint(20)", nullable: true) + }, constraints: table => + { + table.PrimaryKey("PK_gpus", x => x.id); - migrationBuilder.CreateTable("resolutions_by_gpu", - table => new - { - gpu = table.Column("int(11)", nullable: false), - resolution = table.Column("int(11)", nullable: false), - id = table.Column("bigint(20)", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn) - }, constraints: table => - { - table.PrimaryKey("PK_resolutions_by_gpu", x => x.id); - table.ForeignKey("fk_resolutions_by_gpu_gpu", x => x.gpu, "gpus", "id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey("fk_resolutions_by_gpu_resolution", x => x.resolution, - "resolutions", "id", onDelete: ReferentialAction.Cascade); - }); + table.ForeignKey("fk_gpus_company", x => x.company, "companies", "id", + onDelete: ReferentialAction.Restrict); + }); - migrationBuilder.CreateTable("machines", - table => new - { - id = - table.Column("int(11)", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - company = - table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), - name = table.Column("varchar(255)", nullable: false), - type = - table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), - introduced = table.Column("datetime", nullable: true), - family = table.Column("int(11)", nullable: true), - model = table.Column("varchar(50)", nullable: true) - }, constraints: table => - { - table.PrimaryKey("PK_machines", x => x.id); - table.ForeignKey("fk_machines_company", x => x.company, "companies", "id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey("fk_machines_family", x => x.family, "machine_families", - "id", onDelete: ReferentialAction.Restrict); - }); + migrationBuilder.CreateTable("machine_families", table => new + { + id = table.Column("int(11)"). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + company = table.Column("int(11)"), name = table.Column("varchar(255)") + }, constraints: table => + { + table.PrimaryKey("PK_machine_families", x => x.id); - migrationBuilder.CreateTable("instruction_set_extensions_by_processor", - table => new - { - id = table.Column("int(11)", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - processor_id = table.Column("int(11)", nullable: false), - extension_id = table.Column("int(11)", nullable: false) - }, constraints: table => - { - table.PrimaryKey("PK_instruction_set_extensions_by_processor", - x => new {x.id, x.processor_id, x.extension_id}); - table.ForeignKey("fk_extension_extension_id", x => x.extension_id, - "instruction_set_extensions", "id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey("fk_extension_processor_id", x => x.processor_id, - "processors", "id", onDelete: ReferentialAction.Restrict); - }); + table.ForeignKey("fk_machine_families_company", x => x.company, "companies", "id", + onDelete: ReferentialAction.Cascade); + }); - migrationBuilder.CreateTable("gpus_by_machine", - table => new - { - gpu = table.Column("int(11)", nullable: false), - machine = table.Column("int(11)", nullable: false), - id = table.Column("bigint(20)", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn) - }, constraints: table => - { - table.PrimaryKey("PK_gpus_by_machine", x => x.id); - table.ForeignKey("fk_gpus_by_machine_gpu", x => x.gpu, "gpus", "id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey("fk_gpus_by_machine_machine", x => x.machine, "machines", - "id", onDelete: ReferentialAction.Cascade); - }); + migrationBuilder.CreateTable("processors", table => new + { + id = table.Column("int(11)"). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + name = table.Column("char(50)", nullable: false, defaultValueSql: "''"), + company = table.Column("int(11)", nullable: true), + model_code = table.Column("varchar(45)", nullable: true), + introduced = table.Column("datetime", nullable: true), + instruction_set = table.Column("int(11)", nullable: true), + speed = table.Column(nullable: true), + package = table.Column("varchar(45)", nullable: true), + GPRs = table.Column("int(11)", nullable: true), + GPR_size = table.Column("int(11)", nullable: true), + FPRs = table.Column("int(11)", nullable: true), + FPR_size = table.Column("int(11)", nullable: true), + cores = table.Column("int(11)", nullable: true), + threads_per_core = table.Column("int(11)", nullable: true), + process = table.Column("varchar(45)", nullable: true), + process_nm = table.Column(nullable: true), die_size = table.Column(nullable: true), + transistors = table.Column("bigint(20)", nullable: true), + data_bus = table.Column("int(11)", nullable: true), + addr_bus = table.Column("int(11)", nullable: true), + SIMD_registers = table.Column("int(11)", nullable: true), + SIMD_size = table.Column("int(11)", nullable: true), + L1_instruction = table.Column(nullable: true), L1_data = table.Column(nullable: true), + L2 = table.Column(nullable: true), L3 = table.Column(nullable: true) + }, constraints: table => + { + table.PrimaryKey("PK_processors", x => x.id); - migrationBuilder.CreateTable("memory_by_machine", - table => new - { - machine = table.Column("int(11)", nullable: false), - type = - table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), - usage = - table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), - size = table.Column("bigint(20)", nullable: true), - speed = table.Column(nullable: true), - id = table.Column("bigint(20)", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn) - }, constraints: table => - { - table.PrimaryKey("PK_memory_by_machine", x => x.id); - table.ForeignKey("fk_memory_by_machine_machine", x => x.machine, - "machines", "id", onDelete: ReferentialAction.Cascade); - }); + table.ForeignKey("fk_processors_company", x => x.company, "companies", "id", + onDelete: ReferentialAction.Restrict); - migrationBuilder.CreateTable("processors_by_machine", - table => new - { - processor = table.Column("int(11)", nullable: false), - machine = table.Column("int(11)", nullable: false), - speed = table.Column(nullable: true), - id = table.Column("bigint(20)", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn) - }, constraints: table => - { - table.PrimaryKey("PK_processors_by_machine", x => x.id); - table.ForeignKey("fk_processors_by_machine_machine", x => x.machine, - "machines", "id", onDelete: ReferentialAction.Cascade); - table.ForeignKey("fk_processors_by_machine_processor", x => x.processor, - "processors", "id", onDelete: ReferentialAction.Cascade); - }); + table.ForeignKey("fk_processors_instruction_set", x => x.instruction_set, "instruction_sets", "id", + onDelete: ReferentialAction.Restrict); + }); - migrationBuilder.CreateTable("sound_by_machine", - table => new - { - sound_synth = table.Column("int(11)", nullable: false), - machine = table.Column("int(11)", nullable: false), - id = table.Column("bigint(20)", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn) - }, constraints: table => - { - table.PrimaryKey("PK_sound_by_machine", x => x.id); - table.ForeignKey("fk_sound_by_machine_machine", x => x.machine, "machines", - "id", onDelete: ReferentialAction.Cascade); - table.ForeignKey("fk_sound_by_machine_sound_synth", x => x.sound_synth, - "sound_synths", "id", - onDelete: ReferentialAction.Cascade); - }); + migrationBuilder.CreateTable("sound_synths", table => new + { + id = table.Column("int(11)"). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + name = table.Column("char(50)", nullable: false, defaultValueSql: "''"), + company = table.Column("int(11)", nullable: true), + model_code = table.Column("varchar(45)", nullable: true), + introduced = table.Column("datetime", nullable: true), + voices = table.Column("int(11)", nullable: true), + frequency = table.Column(nullable: true), + depth = table.Column("int(11)", nullable: true), + square_wave = table.Column("int(11)", nullable: true), + white_noise = table.Column("int(11)", nullable: true), + type = table.Column("int(11)", nullable: true) + }, constraints: table => + { + table.PrimaryKey("PK_sound_synths", x => x.id); - migrationBuilder.CreateTable("storage_by_machine", - table => new - { - machine = table.Column("int(11)", nullable: false), - type = - table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), - @interface = - table.Column(name: "interface", type: "int(11)", nullable: false, - defaultValueSql: "'0'"), - capacity = table.Column("bigint(20)", nullable: true), - id = table.Column("bigint(20)", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn) - }, constraints: table => - { - table.PrimaryKey("PK_storage_by_machine", x => x.id); - table.ForeignKey("fk_storage_by_machine_machine", x => x.machine, - "machines", "id", onDelete: ReferentialAction.Cascade); - }); + table.ForeignKey("fk_sound_synths_company", x => x.company, "companies", "id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable("resolutions_by_gpu", table => new + { + gpu = table.Column("int(11)"), resolution = table.Column("int(11)"), + id = table.Column("bigint(20)"). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn) + }, constraints: table => + { + table.PrimaryKey("PK_resolutions_by_gpu", x => x.id); + + table.ForeignKey("fk_resolutions_by_gpu_gpu", x => x.gpu, "gpus", "id", + onDelete: ReferentialAction.Cascade); + + table.ForeignKey("fk_resolutions_by_gpu_resolution", x => x.resolution, "resolutions", "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable("machines", table => new + { + id = table.Column("int(11)"). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + company = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + name = table.Column("varchar(255)"), + type = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + introduced = table.Column("datetime", nullable: true), + family = table.Column("int(11)", nullable: true), + model = table.Column("varchar(50)", nullable: true) + }, constraints: table => + { + table.PrimaryKey("PK_machines", x => x.id); + + table.ForeignKey("fk_machines_company", x => x.company, "companies", "id", + onDelete: ReferentialAction.Restrict); + + table.ForeignKey("fk_machines_family", x => x.family, "machine_families", "id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable("instruction_set_extensions_by_processor", table => new + { + id = table.Column("int(11)"). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + processor_id = table.Column("int(11)"), extension_id = table.Column("int(11)") + }, constraints: table => + { + table.PrimaryKey("PK_instruction_set_extensions_by_processor", x => new + { + x.id, x.processor_id, x.extension_id + }); + + table.ForeignKey("fk_extension_extension_id", x => x.extension_id, "instruction_set_extensions", "id", + onDelete: ReferentialAction.Restrict); + + table.ForeignKey("fk_extension_processor_id", x => x.processor_id, "processors", "id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable("gpus_by_machine", table => new + { + gpu = table.Column("int(11)"), machine = table.Column("int(11)"), + id = table.Column("bigint(20)"). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn) + }, constraints: table => + { + table.PrimaryKey("PK_gpus_by_machine", x => x.id); + + table.ForeignKey("fk_gpus_by_machine_gpu", x => x.gpu, "gpus", "id", + onDelete: ReferentialAction.Cascade); + + table.ForeignKey("fk_gpus_by_machine_machine", x => x.machine, "machines", "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable("memory_by_machine", table => new + { + machine = table.Column("int(11)"), + type = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + usage = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + size = table.Column("bigint(20)", nullable: true), + speed = table.Column(nullable: true), + id = table.Column("bigint(20)"). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn) + }, constraints: table => + { + table.PrimaryKey("PK_memory_by_machine", x => x.id); + + table.ForeignKey("fk_memory_by_machine_machine", x => x.machine, "machines", "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable("processors_by_machine", table => new + { + processor = table.Column("int(11)"), machine = table.Column("int(11)"), + speed = table.Column(nullable: true), + id = table.Column("bigint(20)"). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn) + }, constraints: table => + { + table.PrimaryKey("PK_processors_by_machine", x => x.id); + + table.ForeignKey("fk_processors_by_machine_machine", x => x.machine, "machines", "id", + onDelete: ReferentialAction.Cascade); + + table.ForeignKey("fk_processors_by_machine_processor", x => x.processor, "processors", "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable("sound_by_machine", table => new + { + sound_synth = table.Column("int(11)"), machine = table.Column("int(11)"), + id = table.Column("bigint(20)"). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn) + }, constraints: table => + { + table.PrimaryKey("PK_sound_by_machine", x => x.id); + + table.ForeignKey("fk_sound_by_machine_machine", x => x.machine, "machines", "id", + onDelete: ReferentialAction.Cascade); + + table.ForeignKey("fk_sound_by_machine_sound_synth", x => x.sound_synth, "sound_synths", "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable("storage_by_machine", table => new + { + machine = table.Column("int(11)"), + type = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + @interface = table.Column(name: "interface", type: "int(11)", nullable: false, + defaultValueSql: "'0'"), + capacity = table.Column("bigint(20)", nullable: true), + id = table.Column("bigint(20)"). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn) + }, constraints: table => + { + table.PrimaryKey("PK_storage_by_machine", x => x.id); + + table.ForeignKey("fk_storage_by_machine_machine", x => x.machine, "machines", "id", + onDelete: ReferentialAction.Cascade); + }); migrationBuilder.CreateIndex("idx_admins_user", "admins", "user"); @@ -876,13 +746,20 @@ namespace Marechai.Database.Migrations migrationBuilder.CreateIndex("idx_resolutions_width", "resolutions", "width"); - migrationBuilder.CreateIndex("idx_resolutions_resolution", "resolutions", new[] {"width", "height"}); + migrationBuilder.CreateIndex("idx_resolutions_resolution", "resolutions", new[] + { + "width", "height" + }); - migrationBuilder.CreateIndex("idx_resolutions_resolution_with_color", "resolutions", - new[] {"width", "height", "colors"}); + migrationBuilder.CreateIndex("idx_resolutions_resolution_with_color", "resolutions", new[] + { + "width", "height", "colors" + }); - migrationBuilder.CreateIndex("idx_resolutions_resolution_with_color_and_palette", "resolutions", - new[] {"width", "height", "colors", "palette"}); + migrationBuilder.CreateIndex("idx_resolutions_resolution_with_color_and_palette", "resolutions", new[] + { + "width", "height", "colors", "palette" + }); migrationBuilder.CreateIndex("idx_resolutions_by_gpu_gpu", "resolutions_by_gpu", "gpu"); diff --git a/Marechai.Database/Migrations/20180806202841_BrowserTestFieldsAsBoolean.cs b/Marechai.Database/Migrations/20180806202841_BrowserTestFieldsAsBoolean.cs index 1acab14e..d2c1a8d4 100644 --- a/Marechai.Database/Migrations/20180806202841_BrowserTestFieldsAsBoolean.cs +++ b/Marechai.Database/Migrations/20180806202841_BrowserTestFieldsAsBoolean.cs @@ -4,14 +4,8 @@ namespace Marechai.Database.Migrations { public partial class BrowserTestFieldsAsBoolean : Migration { - protected override void Up(MigrationBuilder migrationBuilder) - { + protected override void Up(MigrationBuilder migrationBuilder) { } - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - - } + protected override void Down(MigrationBuilder migrationBuilder) { } } -} +} \ No newline at end of file diff --git a/Marechai.Database/Migrations/20180811130603_CreateIdentitySchema.cs b/Marechai.Database/Migrations/20180811130603_CreateIdentitySchema.cs index cce6fa57..4898ade5 100644 --- a/Marechai.Database/Migrations/20180811130603_CreateIdentitySchema.cs +++ b/Marechai.Database/Migrations/20180811130603_CreateIdentitySchema.cs @@ -38,116 +38,110 @@ namespace Marechai.Database.Migrations { protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.CreateTable("AspNetRoles", - table => new - { - Id = table.Column(nullable: false), - Name = table.Column(maxLength: 256, nullable: true), - NormalizedName = table.Column(maxLength: 256, nullable: true), - ConcurrencyStamp = table.Column(nullable: true) - }, constraints: table => { table.PrimaryKey("PK_AspNetRoles", x => x.Id); }); + migrationBuilder.CreateTable("AspNetRoles", table => new + { + Id = table.Column(), Name = table.Column(maxLength: 256, nullable: true), + NormalizedName = table.Column(maxLength: 256, nullable: true), + ConcurrencyStamp = table.Column(nullable: true) + }, constraints: table => + { + table.PrimaryKey("PK_AspNetRoles", x => x.Id); + }); - migrationBuilder.CreateTable("AspNetUsers", - table => new - { - Id = table.Column(nullable: false), - UserName = - table.Column(maxLength: 256, nullable: true), - NormalizedUserName = - table.Column(maxLength: 256, nullable: true), - Email = - table.Column(maxLength: 256, nullable: true), - NormalizedEmail = - table.Column(maxLength: 256, nullable: true), - EmailConfirmed = table.Column(nullable: false), - PasswordHash = table.Column(nullable: true), - SecurityStamp = table.Column(nullable: true), - ConcurrencyStamp = table.Column(nullable: true), - PhoneNumber = table.Column(nullable: true), - PhoneNumberConfirmed = table.Column(nullable: false), - TwoFactorEnabled = table.Column(nullable: false), - LockoutEnd = table.Column(nullable: true), - LockoutEnabled = table.Column(nullable: false), - AccessFailedCount = table.Column(nullable: false) - }, constraints: table => { table.PrimaryKey("PK_AspNetUsers", x => x.Id); }); + migrationBuilder.CreateTable("AspNetUsers", table => new + { + Id = table.Column(), + UserName = table.Column(maxLength: 256, nullable: true), + NormalizedUserName = table.Column(maxLength: 256, nullable: true), + Email = table.Column(maxLength: 256, nullable: true), + NormalizedEmail = table.Column(maxLength: 256, nullable: true), + EmailConfirmed = table.Column(), PasswordHash = table.Column(nullable: true), + SecurityStamp = table.Column(nullable: true), + ConcurrencyStamp = table.Column(nullable: true), + PhoneNumber = table.Column(nullable: true), PhoneNumberConfirmed = table.Column(), + TwoFactorEnabled = table.Column(), + LockoutEnd = table.Column(nullable: true), + LockoutEnabled = table.Column(), AccessFailedCount = table.Column() + }, constraints: table => + { + table.PrimaryKey("PK_AspNetUsers", x => x.Id); + }); - migrationBuilder.CreateTable("AspNetRoleClaims", - table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - RoleId = table.Column(nullable: false), - ClaimType = table.Column(nullable: true), - ClaimValue = table.Column(nullable: true) - }, constraints: table => - { - table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id); - table.ForeignKey("FK_AspNetRoleClaims_AspNetRoles_RoleId", x => x.RoleId, - "AspNetRoles", "Id", onDelete: ReferentialAction.Cascade); - }); + migrationBuilder.CreateTable("AspNetRoleClaims", table => new + { + Id = table.Column(). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + RoleId = table.Column(), ClaimType = table.Column(nullable: true), + ClaimValue = table.Column(nullable: true) + }, constraints: table => + { + table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id); - migrationBuilder.CreateTable("AspNetUserClaims", - table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - UserId = table.Column(nullable: false), - ClaimType = table.Column(nullable: true), - ClaimValue = table.Column(nullable: true) - }, constraints: table => - { - table.PrimaryKey("PK_AspNetUserClaims", x => x.Id); - table.ForeignKey("FK_AspNetUserClaims_AspNetUsers_UserId", x => x.UserId, - "AspNetUsers", "Id", onDelete: ReferentialAction.Cascade); - }); + table.ForeignKey("FK_AspNetRoleClaims_AspNetRoles_RoleId", x => x.RoleId, "AspNetRoles", "Id", + onDelete: ReferentialAction.Cascade); + }); - migrationBuilder.CreateTable("AspNetUserLogins", - table => new - { - LoginProvider = - table.Column(maxLength: 128, nullable: false), - ProviderKey = - table.Column(maxLength: 128, nullable: false), - ProviderDisplayName = table.Column(nullable: true), - UserId = table.Column(nullable: false) - }, constraints: table => - { - table.PrimaryKey("PK_AspNetUserLogins", - x => new {x.LoginProvider, x.ProviderKey}); - table.ForeignKey("FK_AspNetUserLogins_AspNetUsers_UserId", x => x.UserId, - "AspNetUsers", "Id", onDelete: ReferentialAction.Cascade); - }); + migrationBuilder.CreateTable("AspNetUserClaims", table => new + { + Id = table.Column(). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + UserId = table.Column(), ClaimType = table.Column(nullable: true), + ClaimValue = table.Column(nullable: true) + }, constraints: table => + { + table.PrimaryKey("PK_AspNetUserClaims", x => x.Id); - migrationBuilder.CreateTable("AspNetUserRoles", - table => new - { - UserId = table.Column(nullable: false), - RoleId = table.Column(nullable: false) - }, constraints: table => - { - table.PrimaryKey("PK_AspNetUserRoles", x => new {x.UserId, x.RoleId}); - table.ForeignKey("FK_AspNetUserRoles_AspNetRoles_RoleId", x => x.RoleId, - "AspNetRoles", "Id", onDelete: ReferentialAction.Cascade); - table.ForeignKey("FK_AspNetUserRoles_AspNetUsers_UserId", x => x.UserId, - "AspNetUsers", "Id", onDelete: ReferentialAction.Cascade); - }); + table.ForeignKey("FK_AspNetUserClaims_AspNetUsers_UserId", x => x.UserId, "AspNetUsers", "Id", + onDelete: ReferentialAction.Cascade); + }); - migrationBuilder.CreateTable("AspNetUserTokens", - table => new - { - UserId = table.Column(nullable: false), - LoginProvider = table.Column(maxLength: 128, nullable: false), - Name = table.Column(maxLength: 128, nullable: false), - Value = table.Column(nullable: true) - }, constraints: table => - { - table.PrimaryKey("PK_AspNetUserTokens", - x => new {x.UserId, x.LoginProvider, x.Name}); - table.ForeignKey("FK_AspNetUserTokens_AspNetUsers_UserId", x => x.UserId, - "AspNetUsers", "Id", onDelete: ReferentialAction.Cascade); - }); + migrationBuilder.CreateTable("AspNetUserLogins", table => new + { + LoginProvider = table.Column(maxLength: 128), + ProviderKey = table.Column(maxLength: 128), + ProviderDisplayName = table.Column(nullable: true), UserId = table.Column() + }, constraints: table => + { + table.PrimaryKey("PK_AspNetUserLogins", x => new + { + x.LoginProvider, x.ProviderKey + }); + + table.ForeignKey("FK_AspNetUserLogins_AspNetUsers_UserId", x => x.UserId, "AspNetUsers", "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable("AspNetUserRoles", table => new + { + UserId = table.Column(), RoleId = table.Column() + }, constraints: table => + { + table.PrimaryKey("PK_AspNetUserRoles", x => new + { + x.UserId, x.RoleId + }); + + table.ForeignKey("FK_AspNetUserRoles_AspNetRoles_RoleId", x => x.RoleId, "AspNetRoles", "Id", + onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_AspNetUserRoles_AspNetUsers_UserId", x => x.UserId, "AspNetUsers", "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable("AspNetUserTokens", table => new + { + UserId = table.Column(), LoginProvider = table.Column(maxLength: 128), + Name = table.Column(maxLength: 128), Value = table.Column(nullable: true) + }, constraints: table => + { + table.PrimaryKey("PK_AspNetUserTokens", x => new + { + x.UserId, x.LoginProvider, x.Name + }); + + table.ForeignKey("FK_AspNetUserTokens_AspNetUsers_UserId", x => x.UserId, "AspNetUsers", "Id", + onDelete: ReferentialAction.Cascade); + }); migrationBuilder.CreateIndex("IX_AspNetRoleClaims_RoleId", "AspNetRoleClaims", "RoleId"); diff --git a/Marechai.Database/Migrations/20190518145625_RemoveCompanyDescriptions.cs b/Marechai.Database/Migrations/20190518145625_RemoveCompanyDescriptions.cs index a55c19b7..95cb5178 100644 --- a/Marechai.Database/Migrations/20190518145625_RemoveCompanyDescriptions.cs +++ b/Marechai.Database/Migrations/20190518145625_RemoveCompanyDescriptions.cs @@ -5,27 +5,21 @@ namespace Marechai.Database.Migrations { public partial class RemoveCompanyDescriptions : Migration { - protected override void Up(MigrationBuilder migrationBuilder) - { + protected override void Up(MigrationBuilder migrationBuilder) => migrationBuilder.DropTable("company_descriptions"); - } protected override void Down(MigrationBuilder migrationBuilder) { - migrationBuilder.CreateTable("company_descriptions", - table => new - { - id = table.Column("int(11)") - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - company_id = table.Column("int(11)"), - text = table.Column("text", nullable: true) - }, constraints: table => - { - table.PrimaryKey("PK_company_descriptions", x => x.id); - table.ForeignKey("fk_company_id", x => x.id, "companies", "id", - onDelete: ReferentialAction.Cascade); - }); + migrationBuilder.CreateTable("company_descriptions", table => new + { + id = table.Column("int(11)"). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + company_id = table.Column("int(11)"), text = table.Column("text", nullable: true) + }, constraints: table => + { + table.PrimaryKey("PK_company_descriptions", x => x.id); + table.ForeignKey("fk_company_id", x => x.id, "companies", "id", onDelete: ReferentialAction.Cascade); + }); migrationBuilder.CreateIndex("idx_company_id", "company_descriptions", "company_id", unique: true); diff --git a/Marechai.Database/Migrations/20190518150032_AddCompanyDescriptions.cs b/Marechai.Database/Migrations/20190518150032_AddCompanyDescriptions.cs index a578397e..fa8c1216 100644 --- a/Marechai.Database/Migrations/20190518150032_AddCompanyDescriptions.cs +++ b/Marechai.Database/Migrations/20190518150032_AddCompanyDescriptions.cs @@ -7,28 +7,23 @@ namespace Marechai.Database.Migrations { protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.CreateTable("CompanyDescriptions", - table => new - { - Id = table.Column() - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - CompanyId = table.Column(), - Text = table.Column(nullable: true) - }, constraints: table => - { - table.PrimaryKey("PK_CompanyDescriptions", x => x.Id); - table.ForeignKey("FK_CompanyDescriptions_companies_CompanyId", - x => x.CompanyId, "companies", "id", - onDelete: ReferentialAction.Cascade); - }); + migrationBuilder.CreateTable("CompanyDescriptions", table => new + { + Id = table.Column(). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + CompanyId = table.Column(), Text = table.Column(nullable: true) + }, constraints: table => + { + table.PrimaryKey("PK_CompanyDescriptions", x => x.Id); + + table.ForeignKey("FK_CompanyDescriptions_companies_CompanyId", x => x.CompanyId, "companies", "id", + onDelete: ReferentialAction.Cascade); + }); migrationBuilder.CreateIndex("IX_CompanyDescriptions_CompanyId", "CompanyDescriptions", "CompanyId"); } - protected override void Down(MigrationBuilder migrationBuilder) - { + protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.DropTable("CompanyDescriptions"); - } } } \ No newline at end of file diff --git a/Marechai.Database/Migrations/20190518154700_AddCompanyDescriptionIndex.cs b/Marechai.Database/Migrations/20190518154700_AddCompanyDescriptionIndex.cs index aabe8062..2264c00c 100644 --- a/Marechai.Database/Migrations/20190518154700_AddCompanyDescriptionIndex.cs +++ b/Marechai.Database/Migrations/20190518154700_AddCompanyDescriptionIndex.cs @@ -9,8 +9,8 @@ namespace Marechai.Database.Migrations migrationBuilder.AlterColumn("Text", "CompanyDescriptions", nullable: true, oldClrType: typeof(string), oldNullable: true); - migrationBuilder.CreateIndex("IX_CompanyDescriptions_Text", "CompanyDescriptions", "Text") - .Annotation("MySql:FullTextIndex", true); + migrationBuilder.CreateIndex("IX_CompanyDescriptions_Text", "CompanyDescriptions", "Text"). + Annotation("MySql:FullTextIndex", true); } protected override void Down(MigrationBuilder migrationBuilder) diff --git a/Marechai.Database/Migrations/20190518164341_AnnotateCompanyDescription.cs b/Marechai.Database/Migrations/20190518164341_AnnotateCompanyDescription.cs index 9bfe9964..7439725f 100644 --- a/Marechai.Database/Migrations/20190518164341_AnnotateCompanyDescription.cs +++ b/Marechai.Database/Migrations/20190518164341_AnnotateCompanyDescription.cs @@ -4,16 +4,12 @@ namespace Marechai.Database.Migrations { public partial class AnnotateCompanyDescription : Migration { - protected override void Up(MigrationBuilder migrationBuilder) - { + protected override void Up(MigrationBuilder migrationBuilder) => migrationBuilder.AlterColumn("Text", "CompanyDescriptions", maxLength: 262144, nullable: true, oldClrType: typeof(string), oldNullable: true); - } - protected override void Down(MigrationBuilder migrationBuilder) - { + protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.AlterColumn("Text", "CompanyDescriptions", nullable: true, oldClrType: typeof(string), oldMaxLength: 262144, oldNullable: true); - } } } \ No newline at end of file diff --git a/Marechai.Database/Migrations/20190518170817_AddPreRenderedCompanyDescription.cs b/Marechai.Database/Migrations/20190518170817_AddPreRenderedCompanyDescription.cs index 43e82a9a..e23fb3bd 100644 --- a/Marechai.Database/Migrations/20190518170817_AddPreRenderedCompanyDescription.cs +++ b/Marechai.Database/Migrations/20190518170817_AddPreRenderedCompanyDescription.cs @@ -4,14 +4,10 @@ namespace Marechai.Database.Migrations { public partial class AddPreRenderedCompanyDescription : Migration { - protected override void Up(MigrationBuilder migrationBuilder) - { + protected override void Up(MigrationBuilder migrationBuilder) => migrationBuilder.AddColumn("Html", "CompanyDescriptions", maxLength: 262144, nullable: true); - } - protected override void Down(MigrationBuilder migrationBuilder) - { + protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.DropColumn("Html", "CompanyDescriptions"); - } } } \ No newline at end of file diff --git a/Marechai.Database/Migrations/20190518212800_NewsDateAsDateTime.cs b/Marechai.Database/Migrations/20190518212800_NewsDateAsDateTime.cs index fff7f7bd..dbc549f5 100644 --- a/Marechai.Database/Migrations/20190518212800_NewsDateAsDateTime.cs +++ b/Marechai.Database/Migrations/20190518212800_NewsDateAsDateTime.cs @@ -5,17 +5,13 @@ namespace Marechai.Database.Migrations { public partial class NewsDateAsDateTime : Migration { - protected override void Up(MigrationBuilder migrationBuilder) - { + protected override void Up(MigrationBuilder migrationBuilder) => migrationBuilder.AlterColumn("date", "news", "datetime", nullable: false, oldClrType: typeof(string), oldType: "char(20)", oldDefaultValueSql: "''"); - } - protected override void Down(MigrationBuilder migrationBuilder) - { + protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.AlterColumn("date", "news", "char(20)", nullable: false, defaultValueSql: "''", oldClrType: typeof(DateTime), oldType: "datetime"); - } } } \ No newline at end of file diff --git a/Marechai.Database/Migrations/20190519012635_DropOldAdminsTable.cs b/Marechai.Database/Migrations/20190519012635_DropOldAdminsTable.cs index 544c20bb..c95f482f 100644 --- a/Marechai.Database/Migrations/20190519012635_DropOldAdminsTable.cs +++ b/Marechai.Database/Migrations/20190519012635_DropOldAdminsTable.cs @@ -5,25 +5,20 @@ namespace Marechai.Database.Migrations { public partial class DropOldAdminsTable : Migration { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable("admins"); - } + protected override void Up(MigrationBuilder migrationBuilder) => migrationBuilder.DropTable("admins"); protected override void Down(MigrationBuilder migrationBuilder) { - migrationBuilder.CreateTable("admins", - table => new - { - id = table.Column("int(11)") - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - password = - table.Column("char(50)", nullable: false, - defaultValueSql: "''"), - user = table.Column("char(50)", nullable: false, - defaultValueSql: "''") - }, constraints: table => { table.PrimaryKey("PK_admins", x => x.id); }); + migrationBuilder.CreateTable("admins", table => new + { + id = table.Column("int(11)"). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + password = table.Column("char(50)", nullable: false, defaultValueSql: "''"), + user = table.Column("char(50)", nullable: false, defaultValueSql: "''") + }, constraints: table => + { + table.PrimaryKey("PK_admins", x => x.id); + }); migrationBuilder.CreateIndex("idx_admins_user", "admins", "user"); } diff --git a/Marechai.Database/Migrations/20190519144028_GrayscaleResolutions.cs b/Marechai.Database/Migrations/20190519144028_GrayscaleResolutions.cs index c3eb3d05..65b5ae2a 100644 --- a/Marechai.Database/Migrations/20190519144028_GrayscaleResolutions.cs +++ b/Marechai.Database/Migrations/20190519144028_GrayscaleResolutions.cs @@ -4,14 +4,10 @@ namespace Marechai.Database.Migrations { public partial class GrayscaleResolutions : Migration { - protected override void Up(MigrationBuilder migrationBuilder) - { + protected override void Up(MigrationBuilder migrationBuilder) => migrationBuilder.AddColumn("Grayscale", "resolutions", nullable: false, defaultValue: false); - } - protected override void Down(MigrationBuilder migrationBuilder) - { + protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.DropColumn("Grayscale", "resolutions"); - } } } \ No newline at end of file diff --git a/Marechai.Database/Migrations/20190519171846_DataAnnotations.cs b/Marechai.Database/Migrations/20190519171846_DataAnnotations.cs index 06563d83..4fe016e7 100644 --- a/Marechai.Database/Migrations/20190519171846_DataAnnotations.cs +++ b/Marechai.Database/Migrations/20190519171846_DataAnnotations.cs @@ -4,27 +4,12 @@ namespace Marechai.Database.Migrations { public partial class DataAnnotations : Migration { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "Text", - table: "CompanyDescriptions", - maxLength: 262144, - nullable: false, - oldClrType: typeof(string), - oldMaxLength: 262144, - oldNullable: true); - } + protected override void Up(MigrationBuilder migrationBuilder) => + migrationBuilder.AlterColumn("Text", "CompanyDescriptions", maxLength: 262144, nullable: false, + oldClrType: typeof(string), oldMaxLength: 262144, oldNullable: true); - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "Text", - table: "CompanyDescriptions", - maxLength: 262144, - nullable: true, - oldClrType: typeof(string), - oldMaxLength: 262144); - } + protected override void Down(MigrationBuilder migrationBuilder) => + migrationBuilder.AlterColumn("Text", "CompanyDescriptions", maxLength: 262144, nullable: true, + oldClrType: typeof(string), oldMaxLength: 262144); } -} +} \ No newline at end of file diff --git a/Marechai.Database/Migrations/20190527020604_MachinePhotos.cs b/Marechai.Database/Migrations/20190527020604_MachinePhotos.cs index 3e1f5565..25084396 100644 --- a/Marechai.Database/Migrations/20190527020604_MachinePhotos.cs +++ b/Marechai.Database/Migrations/20190527020604_MachinePhotos.cs @@ -10,57 +10,56 @@ namespace Marechai.Database.Migrations { migrationBuilder.AddColumn("Discriminator", "AspNetUsers", nullable: false, defaultValue: ""); - migrationBuilder.CreateTable("MachinePhotos", - table => new - { - Id = table.Column(), - Author = table.Column(nullable: true), - CameraManufacturer = table.Column(nullable: true), - CameraModel = table.Column(nullable: true), - ColorSpace = table.Column(nullable: true), - Comments = table.Column(nullable: true), - Contrast = table.Column(nullable: true), - CreationDate = table.Column(nullable: true), - DigitalZoomRatio = table.Column(nullable: true), - ExifVersion = table.Column(nullable: true), - Exposure = table.Column(nullable: true), - ExposureMethod = table.Column(nullable: true), - ExposureProgram = table.Column(nullable: true), - Flash = table.Column(nullable: true), - Focal = table.Column(nullable: true), - FocalLength = table.Column(nullable: true), - FocalLengthEquivalent = table.Column(nullable: true), - HorizontalResolution = table.Column(nullable: true), - IsoRating = table.Column(nullable: true), - Lens = table.Column(nullable: true), - License = table.Column(nullable: true), - LightSource = table.Column(nullable: true), - MeteringMode = table.Column(nullable: true), - Orientation = table.Column(nullable: true), - PixelComposition = table.Column(nullable: true), - Saturation = table.Column(nullable: true), - SceneCaptureType = table.Column(nullable: true), - SceneControl = table.Column(nullable: true), - SensingMethod = table.Column(nullable: true), - Sharpness = table.Column(nullable: true), - SoftwareUsed = table.Column(nullable: true), - SubjectDistanceRange = table.Column(nullable: true), - UploadDate = - table.Column() - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.ComputedColumn), - VerticalResolution = table.Column(nullable: true), - WhiteBalance = table.Column(nullable: true), - UserId = table.Column(nullable: true), - MachineId = table.Column(nullable: true) - }, constraints: table => - { - table.PrimaryKey("PK_MachinePhotos", x => x.Id); - table.ForeignKey("FK_MachinePhotos_machines_MachineId", x => x.MachineId, - "machines", "id", onDelete: ReferentialAction.Cascade); - table.ForeignKey("FK_MachinePhotos_AspNetUsers_UserId", x => x.UserId, - "AspNetUsers", "Id", onDelete: ReferentialAction.SetNull); - }); + migrationBuilder.CreateTable("MachinePhotos", table => new + { + Id = table.Column(), Author = table.Column(nullable: true), + CameraManufacturer = table.Column(nullable: true), + CameraModel = table.Column(nullable: true), + ColorSpace = table.Column(nullable: true), + Comments = table.Column(nullable: true), + Contrast = table.Column(nullable: true), + CreationDate = table.Column(nullable: true), + DigitalZoomRatio = table.Column(nullable: true), + ExifVersion = table.Column(nullable: true), + Exposure = table.Column(nullable: true), + ExposureMethod = table.Column(nullable: true), + ExposureProgram = table.Column(nullable: true), + Flash = table.Column(nullable: true), + Focal = table.Column(nullable: true), + FocalLength = table.Column(nullable: true), + FocalLengthEquivalent = table.Column(nullable: true), + HorizontalResolution = table.Column(nullable: true), + IsoRating = table.Column(nullable: true), + Lens = table.Column(nullable: true), + License = table.Column(nullable: true), + LightSource = table.Column(nullable: true), + MeteringMode = table.Column(nullable: true), + Orientation = table.Column(nullable: true), + PixelComposition = table.Column(nullable: true), + Saturation = table.Column(nullable: true), + SceneCaptureType = table.Column(nullable: true), + SceneControl = table.Column(nullable: true), + SensingMethod = table.Column(nullable: true), + Sharpness = table.Column(nullable: true), + SoftwareUsed = table.Column(nullable: true), + SubjectDistanceRange = table.Column(nullable: true), + UploadDate = table.Column(). + Annotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.ComputedColumn), + VerticalResolution = table.Column(nullable: true), + WhiteBalance = table.Column(nullable: true), + UserId = table.Column(nullable: true), + MachineId = table.Column(nullable: true) + }, constraints: table => + { + table.PrimaryKey("PK_MachinePhotos", x => x.Id); + + table.ForeignKey("FK_MachinePhotos_machines_MachineId", x => x.MachineId, "machines", "id", + onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_MachinePhotos_AspNetUsers_UserId", x => x.UserId, "AspNetUsers", "Id", + onDelete: ReferentialAction.SetNull); + }); migrationBuilder.CreateIndex("IX_MachinePhotos_Author", "MachinePhotos", "Author"); diff --git a/Marechai.Database/Migrations/20190527160705_Licenses.cs b/Marechai.Database/Migrations/20190527160705_Licenses.cs index e4d50579..9e390dfb 100644 --- a/Marechai.Database/Migrations/20190527160705_Licenses.cs +++ b/Marechai.Database/Migrations/20190527160705_Licenses.cs @@ -7,1649 +7,1468 @@ namespace Marechai.Database.Migrations { protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.CreateTable("Licenses", - table => new - { - Id = table.Column() - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - Name = table.Column(), - SPDX = table.Column(nullable: true), - FsfApproved = table.Column(), - OsiApproved = table.Column(), - Link = table.Column(maxLength: 512, nullable: true), - Text = table.Column("longtext", maxLength: 131072, - nullable: true) - }, constraints: table => { table.PrimaryKey("PK_Licenses", x => x.Id); }); + migrationBuilder.CreateTable("Licenses", table => new + { + Id = table.Column(). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Name = table.Column(), SPDX = table.Column(nullable: true), + FsfApproved = table.Column(), OsiApproved = table.Column(), + Link = table.Column(maxLength: 512, nullable: true), + Text = table.Column("longtext", maxLength: 131072, nullable: true) + }, constraints: table => + { + table.PrimaryKey("PK_Licenses", x => x.Id); + }); - migrationBuilder.InsertData("Licenses", - new[] {"Id", "FsfApproved", "Link", "Name", "OsiApproved", "SPDX", "Text"}, - new object[,] - { - {1, false, null, "Fair use", false, null, null}, - { - 247, false, "https://spdx.org/licenses/NPOSL-3.0.html#licenseText", - "Non-Profit Open Software License 3.0", true, "NPOSL-3.0", null - }, - { - 246, true, "https://spdx.org/licenses/NPL-1.1.html#licenseText", - "Netscape Public License v1.1", false, "NPL-1.1", null - }, - { - 245, true, "https://spdx.org/licenses/NPL-1.0.html#licenseText", - "Netscape Public License v1.0", false, "NPL-1.0", null - }, - { - 244, false, "https://spdx.org/licenses/Noweb.html#licenseText", - "Noweb License", false, "Noweb", null - }, - { - 243, true, "https://spdx.org/licenses/NOSL.html#licenseText", - "Netizen Open Source License", false, "NOSL", null - }, - { - 242, true, "https://spdx.org/licenses/Nokia.html#licenseText", - "Nokia Open Source License", true, "Nokia", null - }, - { - 241, false, "https://spdx.org/licenses/NLPL.html#licenseText", - "No Limit Public License", false, "NLPL", null - }, - { - 240, false, "https://spdx.org/licenses/NLOD-1.0.html#licenseText", - "Norwegian Licence for Open Government Data", false, "NLOD-1.0", - null - }, - { - 248, false, "https://spdx.org/licenses/NRL.html#licenseText", - "NRL License", false, "NRL", null - }, - { - 239, false, "https://spdx.org/licenses/NGPL.html#licenseText", - "Nethack General Public License", true, "NGPL", null - }, - { - 237, false, "https://spdx.org/licenses/NetCDF.html#licenseText", - "NetCDF license", false, "NetCDF", null - }, - { - 236, false, "https://spdx.org/licenses/Net-SNMP.html#licenseText", - "Net-SNMP License", false, "Net-SNMP", null - }, - { - 235, true, "https://spdx.org/licenses/NCSA.html#licenseText", - "University of Illinois/NCSA Open Source License", true, "NCSA", - null - }, - { - 234, false, "https://spdx.org/licenses/NBPL-1.0.html#licenseText", - "Net Boolean Public License v1", false, "NBPL-1.0", null - }, - { - 233, false, "https://spdx.org/licenses/Naumen.html#licenseText", - "Naumen Public License", true, "Naumen", null - }, - { - 232, false, "https://spdx.org/licenses/NASA-1.3.html#licenseText", - "NASA Open Source Agreement 1.3", true, "NASA-1.3", null - }, - { - 231, false, "https://spdx.org/licenses/Mup.html#licenseText", - "Mup License", false, "Mup", null - }, - { - 230, false, "https://spdx.org/licenses/Multics.html#licenseText", - "Multics License", true, "Multics", null - }, - { - 238, false, "https://spdx.org/licenses/Newsletr.html#licenseText", - "Newsletr License", false, "Newsletr", null - }, - { - 249, false, "https://spdx.org/licenses/NTP.html#licenseText", - "NTP License", true, "NTP", null - }, - { - 250, false, "https://spdx.org/licenses/OCCT-PL.html#licenseText", - "Open CASCADE Technology Public License", false, "OCCT-PL", null - }, - { - 251, false, "https://spdx.org/licenses/OCLC-2.0.html#licenseText", - "OCLC Research Public License 2.0", true, "OCLC-2.0", null - }, - { - 270, true, "https://spdx.org/licenses/OLDAP-2.3.html#licenseText", - "Open LDAP Public License v2.3", false, "OLDAP-2.3", null - }, - { - 269, false, - "https://spdx.org/licenses/OLDAP-2.2.2.html#licenseText", - "Open LDAP Public License 2.2.2", false, "OLDAP-2.2.2", null - }, - { - 268, false, - "https://spdx.org/licenses/OLDAP-2.2.1.html#licenseText", - "Open LDAP Public License v2.2.1", false, "OLDAP-2.2.1", null - }, - { - 267, false, "https://spdx.org/licenses/OLDAP-2.2.html#licenseText", - "Open LDAP Public License v2.2", false, "OLDAP-2.2", null - }, - { - 266, false, "https://spdx.org/licenses/OLDAP-2.1.html#licenseText", - "Open LDAP Public License v2.1", false, "OLDAP-2.1", null - }, - { - 265, false, - "https://spdx.org/licenses/OLDAP-2.0.1.html#licenseText", - "Open LDAP Public License v2.0.1", false, "OLDAP-2.0.1", null - }, - { - 264, false, "https://spdx.org/licenses/OLDAP-2.0.html#licenseText", - "Open LDAP Public License v2.0 (or possibly 2.0A and 2.0B)", false, - "OLDAP-2.0", null - }, - { - 263, false, "https://spdx.org/licenses/OLDAP-1.4.html#licenseText", - "Open LDAP Public License v1.4", false, "OLDAP-1.4", null - }, - { - 262, false, "https://spdx.org/licenses/OLDAP-1.3.html#licenseText", - "Open LDAP Public License v1.3", false, "OLDAP-1.3", null - }, - { - 261, false, "https://spdx.org/licenses/OLDAP-1.2.html#licenseText", - "Open LDAP Public License v1.2", false, "OLDAP-1.2", null - }, - { - 260, false, "https://spdx.org/licenses/OLDAP-1.1.html#licenseText", - "Open LDAP Public License v1.1", false, "OLDAP-1.1", null - }, - { - 259, false, "https://spdx.org/licenses/OGTSL.html#licenseText", - "Open Group Test Suite License", true, "OGTSL", null - }, - { - 258, false, "https://spdx.org/licenses/OGL-UK-3.0.html#licenseText", - "Open Government Licence v3.0", false, "OGL-UK-3.0", null - }, - { - 257, false, "https://spdx.org/licenses/OGL-UK-2.0.html#licenseText", - "Open Government Licence v2.0", false, "OGL-UK-2.0", null - }, - { - 256, false, "https://spdx.org/licenses/OGL-UK-1.0.html#licenseText", - "Open Government Licence v1.0", false, "OGL-UK-1.0", null - }, - { - 255, true, "https://spdx.org/licenses/OFL-1.1.html#licenseText", - "SIL Open Font License 1.1", true, "OFL-1.1", null - }, - { - 254, true, "https://spdx.org/licenses/OFL-1.0.html#licenseText", - "SIL Open Font License 1.0", false, "OFL-1.0", null - }, - { - 253, false, "https://spdx.org/licenses/ODC-By-1.0.html#licenseText", - "Open Data Commons Attribution License v1.0", false, "ODC-By-1.0", - null - }, - { - 252, true, "https://spdx.org/licenses/ODbL-1.0.html#licenseText", - "ODC Open Database License v1.0", false, "ODbL-1.0", null - }, - { - 229, false, "https://spdx.org/licenses/MTLL.html#licenseText", - "Matrix Template Library License", false, "MTLL", null - }, - { - 228, true, "https://spdx.org/licenses/MS-RL.html#licenseText", - "Microsoft Reciprocal License", true, "MS-RL", null - }, - { - 227, true, "https://spdx.org/licenses/MS-PL.html#licenseText", - "Microsoft Public License", true, "MS-PL", null - }, - { - 226, false, - "https://spdx.org/licenses/MPL-2.0-no-copyleft-exception.html#licenseText", - "Mozilla Public License 2.0 (no copyleft exception)", true, - "MPL-2.0-no-copyleft-exception", null - }, - { - 202, false, - "https://spdx.org/licenses/LiLiQ-R-1.1.html#licenseText", - "Licence Libre du Québec – Réciprocité version 1.1", true, - "LiLiQ-R-1.1", null - }, - { - 201, false, - "https://spdx.org/licenses/LiLiQ-P-1.1.html#licenseText", - "Licence Libre du Québec – Permissive version 1.1", true, - "LiLiQ-P-1.1", null - }, - { - 200, false, "https://spdx.org/licenses/libtiff.html#licenseText", - "libtiff License", false, "libtiff", null - }, - { - 199, false, "https://spdx.org/licenses/libpng-2.0.html#licenseText", - "PNG Reference Library version 2", false, "libpng-2.0", null - }, - { - 198, false, "https://spdx.org/licenses/Libpng.html#licenseText", - "libpng License", false, "Libpng", null - }, - { - 197, false, "https://spdx.org/licenses/LGPLLR.html#licenseText", - "Lesser General Public License For Linguistic Resources", false, - "LGPLLR", null - }, - { - 196, true, - "https://spdx.org/licenses/LGPL-3.0-or-later.html#licenseText", - "GNU Lesser General Public License v3.0 or later", true, - "LGPL-3.0-or-later", null - }, - { - 195, true, - "https://spdx.org/licenses/LGPL-3.0-only.html#licenseText", - "GNU Lesser General Public License v3.0 only", true, - "LGPL-3.0-only", null - }, - { - 194, true, - "https://spdx.org/licenses/LGPL-2.1-or-later.html#licenseText", - "GNU Lesser General Public License v2.1 or later", true, - "LGPL-2.1-or-later", null - }, - { - 193, true, - "https://spdx.org/licenses/LGPL-2.1-only.html#licenseText", - "GNU Lesser General Public License v2.1 only", true, - "LGPL-2.1-only", null - }, - { - 192, false, - "https://spdx.org/licenses/LGPL-2.0-or-later.html#licenseText", - "GNU Library General Public License v2 or later", true, - "LGPL-2.0-or-later", null - }, - { - 191, false, - "https://spdx.org/licenses/LGPL-2.0-only.html#licenseText", - "GNU Library General Public License v2 only", true, "LGPL-2.0-only", - null - }, - { - 190, false, "https://spdx.org/licenses/Leptonica.html#licenseText", - "Leptonica License", false, "Leptonica", null - }, - { - 189, false, "https://spdx.org/licenses/Latex2e.html#licenseText", - "Latex2e License", false, "Latex2e", null - }, - { - 188, false, "https://spdx.org/licenses/LAL-1.3.html#licenseText", - "Licence Art Libre 1.3", false, "LAL-1.3", null - }, - { - 187, false, "https://spdx.org/licenses/LAL-1.2.html#licenseText", - "Licence Art Libre 1.2", false, "LAL-1.2", null - }, - { - 186, false, "https://spdx.org/licenses/JSON.html#licenseText", - "JSON License", false, "JSON", null - }, - { - 185, false, "https://spdx.org/licenses/JPNIC.html#licenseText", - "Japan Network Information Center License", false, "JPNIC", null - }, - { - 184, false, "https://spdx.org/licenses/JasPer-2.0.html#licenseText", - "JasPer License", false, "JasPer-2.0", null - }, - { - 203, false, - "https://spdx.org/licenses/LiLiQ-Rplus-1.1.html#licenseText", - "Licence Libre du Québec – Réciprocité forte version 1.1", true, - "LiLiQ-Rplus-1.1", null - }, - { - 271, false, "https://spdx.org/licenses/OLDAP-2.4.html#licenseText", - "Open LDAP Public License v2.4", false, "OLDAP-2.4", null - }, - { - 204, false, - "https://spdx.org/licenses/Linux-OpenIB.html#licenseText", - "Linux Kernel Variant of OpenIB.org license", false, "Linux-OpenIB", - null - }, - { - 206, true, "https://spdx.org/licenses/LPL-1.02.html#licenseText", - "Lucent Public License v1.02", true, "LPL-1.02", null - }, - { - 225, true, "https://spdx.org/licenses/MPL-2.0.html#licenseText", - "Mozilla Public License 2.0", true, "MPL-2.0", null - }, - { - 224, true, "https://spdx.org/licenses/MPL-1.1.html#licenseText", - "Mozilla Public License 1.1", true, "MPL-1.1", null - }, - { - 223, false, "https://spdx.org/licenses/MPL-1.0.html#licenseText", - "Mozilla Public License 1.0", true, "MPL-1.0", null - }, - { - 222, false, "https://spdx.org/licenses/mpich2.html#licenseText", - "mpich2 License", false, "mpich2", null - }, - { - 221, false, "https://spdx.org/licenses/Motosoto.html#licenseText", - "Motosoto License", true, "Motosoto", null - }, - { - 220, false, "https://spdx.org/licenses/MITNFA.html#licenseText", - "MIT +no-false-attribs license", false, "MITNFA", null - }, - { - 219, false, "https://spdx.org/licenses/MIT-feh.html#licenseText", - "feh License", false, "MIT-feh", null - }, - { - 218, false, "https://spdx.org/licenses/MIT-enna.html#licenseText", - "enna License", false, "MIT-enna", null - }, - { - 217, false, "https://spdx.org/licenses/MIT-CMU.html#licenseText", - "CMU License", false, "MIT-CMU", null - }, - { - 216, false, - "https://spdx.org/licenses/MIT-advertising.html#licenseText", - "Enlightenment License (e16)", false, "MIT-advertising", null - }, - { - 215, false, "https://spdx.org/licenses/MIT-0.html#licenseText", - "MIT No Attribution", true, "MIT-0", null - }, - { - 214, true, "https://spdx.org/licenses/MIT.html#licenseText", - "MIT License", true, "MIT", null - }, - { - 213, false, "https://spdx.org/licenses/MirOS.html#licenseText", - "MirOS License", true, "MirOS", null - }, - { - 212, false, "https://spdx.org/licenses/MakeIndex.html#licenseText", - "MakeIndex License", false, "MakeIndex", null - }, - { - 211, false, "https://spdx.org/licenses/LPPL-1.3c.html#licenseText", - "LaTeX Project Public License v1.3c", true, "LPPL-1.3c", null - }, - { - 210, true, "https://spdx.org/licenses/LPPL-1.3a.html#licenseText", - "LaTeX Project Public License v1.3a", false, "LPPL-1.3a", null - }, - { - 209, true, "https://spdx.org/licenses/LPPL-1.2.html#licenseText", - "LaTeX Project Public License v1.2", false, "LPPL-1.2", null - }, - { - 208, false, "https://spdx.org/licenses/LPPL-1.1.html#licenseText", - "LaTeX Project Public License v1.1", false, "LPPL-1.1", null - }, - { - 207, false, "https://spdx.org/licenses/LPPL-1.0.html#licenseText", - "LaTeX Project Public License v1.0", false, "LPPL-1.0", null - }, - { - 205, false, "https://spdx.org/licenses/LPL-1.0.html#licenseText", - "Lucent Public License Version 1.0", true, "LPL-1.0", null - }, - { - 183, true, "https://spdx.org/licenses/ISC.html#licenseText", - "ISC License", true, "ISC", null - }, - { - 272, false, "https://spdx.org/licenses/OLDAP-2.5.html#licenseText", - "Open LDAP Public License v2.5", false, "OLDAP-2.5", null - }, - { - 274, true, "https://spdx.org/licenses/OLDAP-2.7.html#licenseText", - "Open LDAP Public License v2.7", false, "OLDAP-2.7", null - }, - { - 338, false, "https://spdx.org/licenses/VOSTROM.html#licenseText", - "VOSTROM Public License for Open Source", false, "VOSTROM", null - }, - { - 337, true, "https://spdx.org/licenses/Vim.html#licenseText", - "Vim License", false, "Vim", null - }, - { - 336, true, "https://spdx.org/licenses/UPL-1.0.html#licenseText", - "Universal Permissive License v1.0", true, "UPL-1.0", null - }, - { - 335, true, "https://spdx.org/licenses/Unlicense.html#licenseText", - "The Unlicense", false, "Unlicense", null - }, - { - 334, false, - "https://spdx.org/licenses/Unicode-TOU.html#licenseText", - "Unicode Terms of Use", false, "Unicode-TOU", null - }, - { - 333, false, - "https://spdx.org/licenses/Unicode-DFS-2016.html#licenseText", - "Unicode License Agreement - Data Files and Software (2016)", false, - "Unicode-DFS-2016", null - }, - { - 332, false, - "https://spdx.org/licenses/Unicode-DFS-2015.html#licenseText", - "Unicode License Agreement - Data Files and Software (2015)", false, - "Unicode-DFS-2015", null - }, - { - 331, false, - "https://spdx.org/licenses/TU-Berlin-2.0.html#licenseText", - "Technische Universitaet Berlin License 2.0", false, - "TU-Berlin-2.0", null - }, - { - 339, false, "https://spdx.org/licenses/VSL-1.0.html#licenseText", - "Vovida Software License v1.0", true, "VSL-1.0", null - }, - { - 330, false, - "https://spdx.org/licenses/TU-Berlin-1.0.html#licenseText", - "Technische Universitaet Berlin License 1.0", false, - "TU-Berlin-1.0", null - }, - { - 328, false, "https://spdx.org/licenses/TORQUE-1.1.html#licenseText", - "TORQUE v2.5+ Software License v1.1", false, "TORQUE-1.1", null - }, - { - 327, false, "https://spdx.org/licenses/TMate.html#licenseText", - "TMate Open Source License", false, "TMate", null - }, - { - 326, false, - "https://spdx.org/licenses/TCP-wrappers.html#licenseText", - "TCP Wrappers License", false, "TCP-wrappers", null - }, - { - 325, false, "https://spdx.org/licenses/TCL.html#licenseText", - "TCL/TK License", false, "TCL", null - }, - { - 324, false, - "https://spdx.org/licenses/TAPR-OHL-1.0.html#licenseText", - "TAPR Open Hardware License v1.0", false, "TAPR-OHL-1.0", null - }, - { - 323, false, "https://spdx.org/licenses/SWL.html#licenseText", - "Scheme Widget Library (SWL) Software License Agreement", false, - "SWL", null - }, - { - 322, false, - "https://spdx.org/licenses/SugarCRM-1.1.3.html#licenseText", - "SugarCRM Public License v1.1.3", false, "SugarCRM-1.1.3", null - }, - { - 321, true, "https://spdx.org/licenses/SPL-1.0.html#licenseText", - "Sun Public License v1.0", true, "SPL-1.0", null - }, - { - 329, false, "https://spdx.org/licenses/TOSL.html#licenseText", - "Trusster Open Source License", false, "TOSL", null - }, - { - 340, true, "https://spdx.org/licenses/W3C.html#licenseText", - "W3C Software Notice and License (2002-12-31)", true, "W3C", null - }, - { - 341, false, - "https://spdx.org/licenses/W3C-19980720.html#licenseText", - "W3C Software Notice and License (1998-07-20)", false, - "W3C-19980720", null - }, - { - 342, false, - "https://spdx.org/licenses/W3C-20150513.html#licenseText", - "W3C Software Notice and Document License (2015-05-13)", false, - "W3C-20150513", null - }, - { - 361, false, "https://spdx.org/licenses/ZPL-1.1.html#licenseText", - "Zope Public License 1.1", false, "ZPL-1.1", null - }, - { - 360, false, - "https://spdx.org/licenses/zlib-acknowledgement.html#licenseText", - "zlib/libpng License with Acknowledgement", false, - "zlib-acknowledgement", null - }, - { - 359, true, "https://spdx.org/licenses/Zlib.html#licenseText", - "zlib License", true, "Zlib", null - }, - { - 358, false, "https://spdx.org/licenses/Zimbra-1.4.html#licenseText", - "Zimbra Public License v1.4", false, "Zimbra-1.4", null - }, - { - 357, true, "https://spdx.org/licenses/Zimbra-1.3.html#licenseText", - "Zimbra Public License v1.3", false, "Zimbra-1.3", null - }, - { - 356, true, "https://spdx.org/licenses/Zend-2.0.html#licenseText", - "Zend License v2.0", false, "Zend-2.0", null - }, - { - 355, false, "https://spdx.org/licenses/Zed.html#licenseText", - "Zed License", false, "Zed", null - }, - { - 354, true, "https://spdx.org/licenses/YPL-1.1.html#licenseText", - "Yahoo! Public License v1.1", false, "YPL-1.1", null - }, - { - 353, false, "https://spdx.org/licenses/YPL-1.0.html#licenseText", - "Yahoo! Public License v1.0", false, "YPL-1.0", null - }, - { - 352, false, "https://spdx.org/licenses/XSkat.html#licenseText", - "XSkat License", false, "XSkat", null - }, - { - 351, false, "https://spdx.org/licenses/xpp.html#licenseText", - "XPP License", false, "xpp", null - }, - { - 350, false, "https://spdx.org/licenses/Xnet.html#licenseText", - "X.Net License", true, "Xnet", null - }, - { - 349, true, "https://spdx.org/licenses/xinetd.html#licenseText", - "xinetd License", false, "xinetd", null - }, - { - 348, true, "https://spdx.org/licenses/XFree86-1.1.html#licenseText", - "XFree86 License 1.1", false, "XFree86-1.1", null - }, - { - 347, false, "https://spdx.org/licenses/Xerox.html#licenseText", - "Xerox License", false, "Xerox", null - }, - { - 346, true, "https://spdx.org/licenses/X11.html#licenseText", - "X11 License", false, "X11", null - }, - { - 345, true, "https://spdx.org/licenses/WTFPL.html#licenseText", - "Do What The F*ck You Want To Public License", false, "WTFPL", null - }, - { - 344, false, "https://spdx.org/licenses/Wsuipa.html#licenseText", - "Wsuipa License", false, "Wsuipa", null - }, - { - 343, false, "https://spdx.org/licenses/Watcom-1.0.html#licenseText", - "Sybase Open Watcom Public License 1.0", true, "Watcom-1.0", null - }, - { - 320, false, "https://spdx.org/licenses/Spencer-99.html#licenseText", - "Spencer License 99", false, "Spencer-99", null - }, - { - 319, false, "https://spdx.org/licenses/Spencer-94.html#licenseText", - "Spencer License 94", false, "Spencer-94", null - }, - { - 318, false, "https://spdx.org/licenses/Spencer-86.html#licenseText", - "Spencer License 86", false, "Spencer-86", null - }, - { - 317, false, "https://spdx.org/licenses/SNIA.html#licenseText", - "SNIA Public License 1.1", false, "SNIA", null - }, - { - 293, false, "https://spdx.org/licenses/Qhull.html#licenseText", - "Qhull License", false, "Qhull", null - }, - { - 292, true, "https://spdx.org/licenses/Python-2.0.html#licenseText", - "Python License 2.0", true, "Python-2.0", null - }, - { - 291, false, "https://spdx.org/licenses/psutils.html#licenseText", - "psutils License", false, "psutils", null - }, - { - 290, false, "https://spdx.org/licenses/psfrag.html#licenseText", - "psfrag License", false, "psfrag", null - }, - { - 289, false, "https://spdx.org/licenses/PostgreSQL.html#licenseText", - "PostgreSQL License", true, "PostgreSQL", null - }, - { - 288, false, "https://spdx.org/licenses/Plexus.html#licenseText", - "Plexus Classworlds License", false, "Plexus", null - }, - { - 287, true, "https://spdx.org/licenses/PHP-3.01.html#licenseText", - "PHP License v3.01", false, "PHP-3.01", null - }, - { - 286, false, "https://spdx.org/licenses/PHP-3.0.html#licenseText", - "PHP License v3.0", true, "PHP-3.0", null - }, - { - 285, false, "https://spdx.org/licenses/PDDL-1.0.html#licenseText", - "ODC Public Domain Dedication & License 1.0", false, "PDDL-1.0", - null - }, - { - 284, true, "https://spdx.org/licenses/OSL-3.0.html#licenseText", - "Open Software License 3.0", true, "OSL-3.0", null - }, - { - 283, true, "https://spdx.org/licenses/OSL-2.1.html#licenseText", - "Open Software License 2.1", true, "OSL-2.1", null - }, - { - 282, true, "https://spdx.org/licenses/OSL-2.0.html#licenseText", - "Open Software License 2.0", true, "OSL-2.0", null - }, - { - 281, true, "https://spdx.org/licenses/OSL-1.1.html#licenseText", - "Open Software License 1.1", false, "OSL-1.1", null - }, - { - 280, true, "https://spdx.org/licenses/OSL-1.0.html#licenseText", - "Open Software License 1.0", true, "OSL-1.0", null - }, - { - 279, false, - "https://spdx.org/licenses/OSET-PL-2.1.html#licenseText", - "OSET Public License version 2.1", true, "OSET-PL-2.1", null - }, - { - 278, false, "https://spdx.org/licenses/OPL-1.0.html#licenseText", - "Open Public License v1.0", false, "OPL-1.0", null - }, - { - 277, true, "https://spdx.org/licenses/OpenSSL.html#licenseText", - "OpenSSL License", false, "OpenSSL", null - }, - { - 276, false, "https://spdx.org/licenses/OML.html#licenseText", - "Open Market License", false, "OML", null - }, - { - 275, false, "https://spdx.org/licenses/OLDAP-2.8.html#licenseText", - "Open LDAP Public License v2.8", false, "OLDAP-2.8", null - }, - { - 294, true, "https://spdx.org/licenses/QPL-1.0.html#licenseText", - "Q Public License 1.0", true, "QPL-1.0", null - }, - { - 273, false, "https://spdx.org/licenses/OLDAP-2.6.html#licenseText", - "Open LDAP Public License v2.6", false, "OLDAP-2.6", null - }, - { - 295, false, "https://spdx.org/licenses/Rdisc.html#licenseText", - "Rdisc License", false, "Rdisc", null - }, - { - 297, false, "https://spdx.org/licenses/RPL-1.1.html#licenseText", - "Reciprocal Public License 1.1", true, "RPL-1.1", null - }, - { - 316, false, "https://spdx.org/licenses/SMPPL.html#licenseText", - "Secure Messaging Protocol Public License", false, "SMPPL", null - }, - { - 315, true, "https://spdx.org/licenses/SMLNJ.html#licenseText", - "Standard ML of New Jersey License", false, "SMLNJ", null - }, - { - 314, true, "https://spdx.org/licenses/Sleepycat.html#licenseText", - "Sleepycat License", true, "Sleepycat", null - }, - { - 313, false, "https://spdx.org/licenses/SISSL-1.2.html#licenseText", - "Sun Industry Standards Source License v1.2", false, "SISSL-1.2", - null - }, - { - 312, true, "https://spdx.org/licenses/SISSL.html#licenseText", - "Sun Industry Standards Source License v1.1", true, "SISSL", null - }, - { - 311, false, "https://spdx.org/licenses/SimPL-2.0.html#licenseText", - "Simple Public License 2.0", true, "SimPL-2.0", null - }, - { - 310, true, "https://spdx.org/licenses/SGI-B-2.0.html#licenseText", - "SGI Free Software License B v2.0", false, "SGI-B-2.0", null - }, - { - 309, false, "https://spdx.org/licenses/SGI-B-1.1.html#licenseText", - "SGI Free Software License B v1.1", false, "SGI-B-1.1", null - }, - { - 308, false, "https://spdx.org/licenses/SGI-B-1.0.html#licenseText", - "SGI Free Software License B v1.0", false, "SGI-B-1.0", null - }, - { - 307, false, - "https://spdx.org/licenses/Sendmail-8.23.html#licenseText", - "Sendmail License 8.23", false, "Sendmail-8.23", null - }, - { - 306, false, "https://spdx.org/licenses/Sendmail.html#licenseText", - "Sendmail License", false, "Sendmail", null - }, - { - 305, false, "https://spdx.org/licenses/SCEA.html#licenseText", - "SCEA Shared Source License", false, "SCEA", null - }, - { - 304, false, "https://spdx.org/licenses/Saxpath.html#licenseText", - "Saxpath License", false, "Saxpath", null - }, - { - 303, false, "https://spdx.org/licenses/SAX-PD.html#licenseText", - "Sax Public Domain Notice", false, "SAX-PD", null - }, - { - 302, true, "https://spdx.org/licenses/Ruby.html#licenseText", - "Ruby License", false, "Ruby", null - }, - { - 301, false, "https://spdx.org/licenses/RSCPL.html#licenseText", - "Ricoh Source Code Public License", true, "RSCPL", null - }, - { - 300, false, "https://spdx.org/licenses/RSA-MD.html#licenseText", - "RSA Message-Digest License", false, "RSA-MD", null - }, - { - 299, true, "https://spdx.org/licenses/RPSL-1.0.html#licenseText", - "RealNetworks Public Source License v1.0", true, "RPSL-1.0", null - }, - { - 298, false, "https://spdx.org/licenses/RPL-1.5.html#licenseText", - "Reciprocal Public License 1.5", true, "RPL-1.5", null - }, - { - 296, false, "https://spdx.org/licenses/RHeCos-1.1.html#licenseText", - "Red Hat eCos Public License v1.1", false, "RHeCos-1.1", null - }, - { - 362, true, "https://spdx.org/licenses/ZPL-2.0.html#licenseText", - "Zope Public License 2.0", true, "ZPL-2.0", null - }, - { - 182, true, "https://spdx.org/licenses/IPL-1.0.html#licenseText", - "IBM Public License v1.0", true, "IPL-1.0", null - }, - { - 180, false, - "https://spdx.org/licenses/Interbase-1.0.html#licenseText", - "Interbase Public License v1.0", false, "Interbase-1.0", null - }, - { - 65, false, "https://spdx.org/licenses/CC-BY-1.0.html#licenseText", - "Creative Commons Attribution 1.0 Generic", false, "CC-BY-1.0", null - }, - { - 64, false, "https://spdx.org/licenses/CATOSL-1.1.html#licenseText", - "Computer Associates Trusted Open Source License 1.1", true, - "CATOSL-1.1", null - }, - { - 63, false, "https://spdx.org/licenses/Caldera.html#licenseText", - "Caldera License", false, "Caldera", null - }, - { - 62, false, "https://spdx.org/licenses/bzip2-1.0.6.html#licenseText", - "bzip2 and libbzip2 License v1.0.6", false, "bzip2-1.0.6", null - }, - { - 61, false, "https://spdx.org/licenses/bzip2-1.0.5.html#licenseText", - "bzip2 and libbzip2 License v1.0.5", false, "bzip2-1.0.5", null - }, - { - 60, true, "https://spdx.org/licenses/BSL-1.0.html#licenseText", - "Boost Software License 1.0", true, "BSL-1.0", null - }, - { - 59, false, - "https://spdx.org/licenses/BSD-Source-Code.html#licenseText", - "BSD Source Code Attribution", false, "BSD-Source-Code", null - }, - { - 58, false, - "https://spdx.org/licenses/BSD-Protection.html#licenseText", - "BSD Protection License", false, "BSD-Protection", null - }, - { - 66, false, "https://spdx.org/licenses/CC-BY-2.0.html#licenseText", - "Creative Commons Attribution 2.0 Generic", false, "CC-BY-2.0", null - }, - { - 57, false, - "https://spdx.org/licenses/BSD-4-Clause-UC.html#licenseText", - "BSD-4-Clause (University of California-Specific)", false, - "BSD-4-Clause-UC", null - }, - { - 55, false, - "https://spdx.org/licenses/BSD-3-Clause-No-Nuclear-Warranty.html#licenseText", - "BSD 3-Clause No Nuclear Warranty", false, - "BSD-3-Clause-No-Nuclear-Warranty", null - }, - { - 54, false, - "https://spdx.org/licenses/BSD-3-Clause-No-Nuclear-License-2014.html#licenseText", - "BSD 3-Clause No Nuclear License 2014", false, - "BSD-3-Clause-No-Nuclear-License-2014", null - }, - { - 53, false, - "https://spdx.org/licenses/BSD-3-Clause-No-Nuclear-License.html#licenseText", - "BSD 3-Clause No Nuclear License", false, - "BSD-3-Clause-No-Nuclear-License", null - }, - { - 52, false, - "https://spdx.org/licenses/BSD-3-Clause-LBNL.html#licenseText", - "Lawrence Berkeley National Labs BSD variant license", false, - "BSD-3-Clause-LBNL", null - }, - { - 51, true, - "https://spdx.org/licenses/BSD-3-Clause-Clear.html#licenseText", - "BSD 3-Clause Clear License", false, "BSD-3-Clause-Clear", null - }, - { - 50, false, - "https://spdx.org/licenses/BSD-3-Clause-Attribution.html#licenseText", - "BSD with attribution", false, "BSD-3-Clause-Attribution", null - }, - { - 49, true, "https://spdx.org/licenses/BSD-3-Clause.html#licenseText", - "BSD 3-Clause \"New\" or \"Revised\" License", true, "BSD-3-Clause", - null - }, - { - 48, false, - "https://spdx.org/licenses/BSD-2-Clause-Patent.html#licenseText", - "BSD-2-Clause Plus Patent License", true, "BSD-2-Clause-Patent", - null - }, - { - 56, true, "https://spdx.org/licenses/BSD-4-Clause.html#licenseText", - "BSD 4-Clause \"Original\" or \"Old\" License", false, - "BSD-4-Clause", null - }, - { - 67, false, "https://spdx.org/licenses/CC-BY-2.5.html#licenseText", - "Creative Commons Attribution 2.5 Generic", false, "CC-BY-2.5", null - }, - { - 68, false, "https://spdx.org/licenses/CC-BY-3.0.html#licenseText", - "Creative Commons Attribution 3.0 Unported", false, "CC-BY-3.0", - null - }, - { - 69, true, "https://spdx.org/licenses/CC-BY-4.0.html#licenseText", - "Creative Commons Attribution 4.0 International", false, - "CC-BY-4.0", null - }, - { - 88, false, - "https://spdx.org/licenses/CC-BY-ND-3.0.html#licenseText", - "Creative Commons Attribution No Derivatives 3.0 Unported", false, - "CC-BY-ND-3.0", null - }, - { - 87, false, - "https://spdx.org/licenses/CC-BY-ND-2.5.html#licenseText", - "Creative Commons Attribution No Derivatives 2.5 Generic", false, - "CC-BY-ND-2.5", null - }, - { - 86, false, - "https://spdx.org/licenses/CC-BY-ND-2.0.html#licenseText", - "Creative Commons Attribution No Derivatives 2.0 Generic", false, - "CC-BY-ND-2.0", null - }, - { - 85, false, - "https://spdx.org/licenses/CC-BY-ND-1.0.html#licenseText", - "Creative Commons Attribution No Derivatives 1.0 Generic", false, - "CC-BY-ND-1.0", null - }, - { - 84, false, - "https://spdx.org/licenses/CC-BY-NC-SA-4.0.html#licenseText", - "Creative Commons Attribution Non Commercial Share Alike 4.0 International", - false, "CC-BY-NC-SA-4.0", null - }, - { - 83, false, - "https://spdx.org/licenses/CC-BY-NC-SA-3.0.html#licenseText", - "Creative Commons Attribution Non Commercial Share Alike 3.0 Unported", - false, "CC-BY-NC-SA-3.0", null - }, - { - 82, false, - "https://spdx.org/licenses/CC-BY-NC-SA-2.5.html#licenseText", - "Creative Commons Attribution Non Commercial Share Alike 2.5 Generic", - false, "CC-BY-NC-SA-2.5", null - }, - { - 81, false, - "https://spdx.org/licenses/CC-BY-NC-SA-2.0.html#licenseText", - "Creative Commons Attribution Non Commercial Share Alike 2.0 Generic", - false, "CC-BY-NC-SA-2.0", null - }, - { - 80, false, - "https://spdx.org/licenses/CC-BY-NC-SA-1.0.html#licenseText", - "Creative Commons Attribution Non Commercial Share Alike 1.0 Generic", - false, "CC-BY-NC-SA-1.0", null - }, - { - 79, false, - "https://spdx.org/licenses/CC-BY-NC-ND-4.0.html#licenseText", - "Creative Commons Attribution Non Commercial No Derivatives 4.0 International", - false, "CC-BY-NC-ND-4.0", null - }, - { - 78, false, - "https://spdx.org/licenses/CC-BY-NC-ND-3.0.html#licenseText", - "Creative Commons Attribution Non Commercial No Derivatives 3.0 Unported", - false, "CC-BY-NC-ND-3.0", null - }, - { - 77, false, - "https://spdx.org/licenses/CC-BY-NC-ND-2.5.html#licenseText", - "Creative Commons Attribution Non Commercial No Derivatives 2.5 Generic", - false, "CC-BY-NC-ND-2.5", null - }, - { - 76, false, - "https://spdx.org/licenses/CC-BY-NC-ND-2.0.html#licenseText", - "Creative Commons Attribution Non Commercial No Derivatives 2.0 Generic", - false, "CC-BY-NC-ND-2.0", null - }, - { - 75, false, - "https://spdx.org/licenses/CC-BY-NC-ND-1.0.html#licenseText", - "Creative Commons Attribution Non Commercial No Derivatives 1.0 Generic", - false, "CC-BY-NC-ND-1.0", null - }, - { - 74, false, - "https://spdx.org/licenses/CC-BY-NC-4.0.html#licenseText", - "Creative Commons Attribution Non Commercial 4.0 International", - false, "CC-BY-NC-4.0", null - }, - { - 73, false, - "https://spdx.org/licenses/CC-BY-NC-3.0.html#licenseText", - "Creative Commons Attribution Non Commercial 3.0 Unported", false, - "CC-BY-NC-3.0", null - }, - { - 72, false, - "https://spdx.org/licenses/CC-BY-NC-2.5.html#licenseText", - "Creative Commons Attribution Non Commercial 2.5 Generic", false, - "CC-BY-NC-2.5", null - }, - { - 71, false, - "https://spdx.org/licenses/CC-BY-NC-2.0.html#licenseText", - "Creative Commons Attribution Non Commercial 2.0 Generic", false, - "CC-BY-NC-2.0", null - }, - { - 70, false, - "https://spdx.org/licenses/CC-BY-NC-1.0.html#licenseText", - "Creative Commons Attribution Non Commercial 1.0 Generic", false, - "CC-BY-NC-1.0", null - }, - { - 47, false, - "https://spdx.org/licenses/BSD-2-Clause-NetBSD.html#licenseText", - "BSD 2-Clause NetBSD License", false, "BSD-2-Clause-NetBSD", null - }, - { - 46, true, - "https://spdx.org/licenses/BSD-2-Clause-FreeBSD.html#licenseText", - "BSD 2-Clause FreeBSD License", false, "BSD-2-Clause-FreeBSD", null - }, - { - 45, false, - "https://spdx.org/licenses/BSD-2-Clause.html#licenseText", - "BSD 2-Clause \"Simplified\" License", true, "BSD-2-Clause", null - }, - { - 44, false, - "https://spdx.org/licenses/BSD-1-Clause.html#licenseText", - "BSD 1-Clause License", false, "BSD-1-Clause", null - }, - { - 20, false, "https://spdx.org/licenses/Aladdin.html#licenseText", - "Aladdin Free Public License", false, "Aladdin", null - }, - { - 19, true, - "https://spdx.org/licenses/AGPL-3.0-or-later.html#licenseText", - "GNU Affero General Public License v3.0 or later", true, - "AGPL-3.0-or-later", null - }, - { - 18, true, - "https://spdx.org/licenses/AGPL-3.0-only.html#licenseText", - "GNU Affero General Public License v3.0 only", true, - "AGPL-3.0-only", null - }, - { - 17, false, - "https://spdx.org/licenses/AGPL-1.0-or-later.html#licenseText", - "Affero General Public License v1.0 or later", false, - "AGPL-1.0-or-later", null - }, - { - 16, false, - "https://spdx.org/licenses/AGPL-1.0-only.html#licenseText", - "Affero General Public License v1.0 only", false, "AGPL-1.0-only", - null - }, - { - 15, false, "https://spdx.org/licenses/Afmparse.html#licenseText", - "Afmparse License", false, "Afmparse", null - }, - { - 14, true, "https://spdx.org/licenses/AFL-3.0.html#licenseText", - "Academic Free License v3.0", true, "AFL-3.0", null - }, - { - 13, true, "https://spdx.org/licenses/AFL-2.1.html#licenseText", - "Academic Free License v2.1", true, "AFL-2.1", null - }, - { - 12, true, "https://spdx.org/licenses/AFL-2.0.html#licenseText", - "Academic Free License v2.0", true, "AFL-2.0", null - }, - { - 11, true, "https://spdx.org/licenses/AFL-1.2.html#licenseText", - "Academic Free License v1.2", true, "AFL-1.2", null - }, - { - 10, true, "https://spdx.org/licenses/AFL-1.1.html#licenseText", - "Academic Free License v1.1", true, "AFL-1.1", null - }, - { - 9, false, "https://spdx.org/licenses/ADSL.html#licenseText", - "Amazon Digital Services License", false, "ADSL", null - }, - { - 8, false, "https://spdx.org/licenses/Adobe-Glyph.html#licenseText", - "Adobe Glyph List License", false, "Adobe-Glyph", null - }, - { - 7, false, "https://spdx.org/licenses/Adobe-2006.html#licenseText", - "Adobe Systems Incorporated Source Code License Agreement", false, - "Adobe-2006", null - }, - { - 6, false, "https://spdx.org/licenses/Abstyles.html#licenseText", - "Abstyles License", false, "Abstyles", null - }, - { - 5, false, "https://spdx.org/licenses/AAL.html#licenseText", - "Attribution Assurance License", true, "AAL", null - }, - { - 4, false, "https://spdx.org/licenses/0BSD.html#licenseText", - "BSD Zero Clause License", true, "0BSD", null - }, - {3, false, null, "All rights reserved", false, null, null}, - {2, false, null, "Advertisement use", false, null, null}, - { - 21, false, "https://spdx.org/licenses/AMDPLPA.html#licenseText", - "AMD's plpa_map.c License", false, "AMDPLPA", null - }, - { - 89, false, - "https://spdx.org/licenses/CC-BY-ND-4.0.html#licenseText", - "Creative Commons Attribution No Derivatives 4.0 International", - false, "CC-BY-ND-4.0", null - }, - { - 22, false, "https://spdx.org/licenses/AML.html#licenseText", - "Apple MIT License", false, "AML", null - }, - { - 24, false, "https://spdx.org/licenses/ANTLR-PD.html#licenseText", - "ANTLR Software Rights Notice", false, "ANTLR-PD", null - }, - { - 43, false, "https://spdx.org/licenses/Borceux.html#licenseText", - "Borceux license", false, "Borceux", null - }, - { - 42, true, - "https://spdx.org/licenses/BitTorrent-1.1.html#licenseText", - "BitTorrent Open Source License v1.1", false, "BitTorrent-1.1", null - }, - { - 41, false, - "https://spdx.org/licenses/BitTorrent-1.0.html#licenseText", - "BitTorrent Open Source License v1.0", false, "BitTorrent-1.0", null - }, - { - 40, false, "https://spdx.org/licenses/Beerware.html#licenseText", - "Beerware License", false, "Beerware", null - }, - { - 39, false, "https://spdx.org/licenses/Barr.html#licenseText", - "Barr License", false, "Barr", null - }, - { - 38, false, "https://spdx.org/licenses/Bahyph.html#licenseText", - "Bahyph License", false, "Bahyph", null - }, - { - 37, true, "https://spdx.org/licenses/Artistic-2.0.html#licenseText", - "Artistic License 2.0", true, "Artistic-2.0", null - }, - { - 36, false, - "https://spdx.org/licenses/Artistic-1.0-Perl.html#licenseText", - "Artistic License 1.0 (Perl)", true, "Artistic-1.0-Perl", null - }, - { - 35, false, - "https://spdx.org/licenses/Artistic-1.0-cl8.html#licenseText", - "Artistic License 1.0 w/clause 8", true, "Artistic-1.0-cl8", null - }, - { - 34, false, - "https://spdx.org/licenses/Artistic-1.0.html#licenseText", - "Artistic License 1.0", true, "Artistic-1.0", null - }, - { - 33, true, "https://spdx.org/licenses/APSL-2.0.html#licenseText", - "Apple Public Source License 2.0", true, "APSL-2.0", null - }, - { - 32, false, "https://spdx.org/licenses/APSL-1.2.html#licenseText", - "Apple Public Source License 1.2", true, "APSL-1.2", null - }, - { - 31, false, "https://spdx.org/licenses/APSL-1.1.html#licenseText", - "Apple Public Source License 1.1", true, "APSL-1.1", null - }, - { - 30, false, "https://spdx.org/licenses/APSL-1.0.html#licenseText", - "Apple Public Source License 1.0", true, "APSL-1.0", null - }, - { - 29, false, "https://spdx.org/licenses/APL-1.0.html#licenseText", - "Adaptive Public License 1.0", true, "APL-1.0", null - }, - { - 28, false, "https://spdx.org/licenses/APAFML.html#licenseText", - "Adobe Postscript AFM License", false, "APAFML", null - }, - { - 27, true, "https://spdx.org/licenses/Apache-2.0.html#licenseText", - "Apache License 2.0", true, "Apache-2.0", null - }, - { - 26, true, "https://spdx.org/licenses/Apache-1.1.html#licenseText", - "Apache License 1.1", true, "Apache-1.1", null - }, - { - 25, true, "https://spdx.org/licenses/Apache-1.0.html#licenseText", - "Apache License 1.0", false, "Apache-1.0", null - }, - { - 23, false, "https://spdx.org/licenses/AMPAS.html#licenseText", - "Academy of Motion Picture Arts and Sciences BSD", false, "AMPAS", - null - }, - { - 181, true, "https://spdx.org/licenses/IPA.html#licenseText", - "IPA Font License", true, "IPA", null - }, - { - 90, false, - "https://spdx.org/licenses/CC-BY-SA-1.0.html#licenseText", - "Creative Commons Attribution Share Alike 1.0 Generic", false, - "CC-BY-SA-1.0", null - }, - { - 92, false, - "https://spdx.org/licenses/CC-BY-SA-2.5.html#licenseText", - "Creative Commons Attribution Share Alike 2.5 Generic", false, - "CC-BY-SA-2.5", null - }, - { - 156, false, "https://spdx.org/licenses/Giftware.html#licenseText", - "Giftware License", false, "Giftware", null - }, - { - 155, true, - "https://spdx.org/licenses/GFDL-1.3-or-later.html#licenseText", - "GNU Free Documentation License v1.3 or later", false, - "GFDL-1.3-or-later", null - }, - { - 154, true, - "https://spdx.org/licenses/GFDL-1.3-only.html#licenseText", - "GNU Free Documentation License v1.3 only", false, "GFDL-1.3-only", - null - }, - { - 153, true, - "https://spdx.org/licenses/GFDL-1.2-or-later.html#licenseText", - "GNU Free Documentation License v1.2 or later", false, - "GFDL-1.2-or-later", null - }, - { - 152, true, - "https://spdx.org/licenses/GFDL-1.2-only.html#licenseText", - "GNU Free Documentation License v1.2 only", false, "GFDL-1.2-only", - null - }, - { - 151, true, - "https://spdx.org/licenses/GFDL-1.1-or-later.html#licenseText", - "GNU Free Documentation License v1.1 or later", false, - "GFDL-1.1-or-later", null - }, - { - 150, true, - "https://spdx.org/licenses/GFDL-1.1-only.html#licenseText", - "GNU Free Documentation License v1.1 only", false, "GFDL-1.1-only", - null - }, - { - 149, true, "https://spdx.org/licenses/FTL.html#licenseText", - "Freetype Project License", false, "FTL", null - }, - { - 157, false, "https://spdx.org/licenses/GL2PS.html#licenseText", - "GL2PS License", false, "GL2PS", null - }, - { - 148, false, "https://spdx.org/licenses/FSFULLR.html#licenseText", - "FSF Unlimited License (with License Retention)", false, "FSFULLR", - null - }, - { - 146, true, "https://spdx.org/licenses/FSFAP.html#licenseText", - "FSF All Permissive License", false, "FSFAP", null - }, - { - 145, false, "https://spdx.org/licenses/FreeImage.html#licenseText", - "FreeImage Public License v1.0", false, "FreeImage", null - }, - { - 144, false, - "https://spdx.org/licenses/Frameworx-1.0.html#licenseText", - "Frameworx Open License 1.0", true, "Frameworx-1.0", null - }, - { - 143, false, "https://spdx.org/licenses/Fair.html#licenseText", - "Fair License", true, "Fair", null - }, - { - 142, false, "https://spdx.org/licenses/Eurosym.html#licenseText", - "Eurosym License", false, "Eurosym", null - }, - { - 141, true, "https://spdx.org/licenses/EUPL-1.2.html#licenseText", - "European Union Public License 1.2", true, "EUPL-1.2", null - }, - { - 140, true, "https://spdx.org/licenses/EUPL-1.1.html#licenseText", - "European Union Public License 1.1", true, "EUPL-1.1", null - }, - { - 139, false, "https://spdx.org/licenses/EUPL-1.0.html#licenseText", - "European Union Public License 1.0", false, "EUPL-1.0", null - }, - { - 147, false, "https://spdx.org/licenses/FSFUL.html#licenseText", - "FSF Unlimited License", false, "FSFUL", null - }, - { - 158, false, "https://spdx.org/licenses/Glide.html#licenseText", - "3dfx Glide License", false, "Glide", null - }, - { - 159, false, "https://spdx.org/licenses/Glulxe.html#licenseText", - "Glulxe License", false, "Glulxe", null - }, - { - 160, true, "https://spdx.org/licenses/gnuplot.html#licenseText", - "gnuplot License", false, "gnuplot", null - }, - { - 179, false, "https://spdx.org/licenses/Intel-ACPI.html#licenseText", - "Intel ACPI Software License Agreement", false, "Intel-ACPI", null - }, - { - 178, true, "https://spdx.org/licenses/Intel.html#licenseText", - "Intel Open Source License", true, "Intel", null - }, - { - 177, false, "https://spdx.org/licenses/Info-ZIP.html#licenseText", - "Info-ZIP License", false, "Info-ZIP", null - } - }); + migrationBuilder.InsertData("Licenses", new[] + { + "Id", "FsfApproved", "Link", "Name", "OsiApproved", "SPDX", "Text" + }, new object[,] + { + { + 1, false, null, "Fair use", false, null, null + }, + { + 247, false, "https://spdx.org/licenses/NPOSL-3.0.html#licenseText", + "Non-Profit Open Software License 3.0", true, "NPOSL-3.0", null + }, + { + 246, true, "https://spdx.org/licenses/NPL-1.1.html#licenseText", "Netscape Public License v1.1", + false, "NPL-1.1", null + }, + { + 245, true, "https://spdx.org/licenses/NPL-1.0.html#licenseText", "Netscape Public License v1.0", + false, "NPL-1.0", null + }, + { + 244, false, "https://spdx.org/licenses/Noweb.html#licenseText", "Noweb License", false, "Noweb", + null + }, + { + 243, true, "https://spdx.org/licenses/NOSL.html#licenseText", "Netizen Open Source License", false, + "NOSL", null + }, + { + 242, true, "https://spdx.org/licenses/Nokia.html#licenseText", "Nokia Open Source License", true, + "Nokia", null + }, + { + 241, false, "https://spdx.org/licenses/NLPL.html#licenseText", "No Limit Public License", false, + "NLPL", null + }, + { + 240, false, "https://spdx.org/licenses/NLOD-1.0.html#licenseText", + "Norwegian Licence for Open Government Data", false, "NLOD-1.0", null + }, + { + 248, false, "https://spdx.org/licenses/NRL.html#licenseText", "NRL License", false, "NRL", null + }, + { + 239, false, "https://spdx.org/licenses/NGPL.html#licenseText", "Nethack General Public License", + true, "NGPL", null + }, + { + 237, false, "https://spdx.org/licenses/NetCDF.html#licenseText", "NetCDF license", false, "NetCDF", + null + }, + { + 236, false, "https://spdx.org/licenses/Net-SNMP.html#licenseText", "Net-SNMP License", false, + "Net-SNMP", null + }, + { + 235, true, "https://spdx.org/licenses/NCSA.html#licenseText", + "University of Illinois/NCSA Open Source License", true, "NCSA", null + }, + { + 234, false, "https://spdx.org/licenses/NBPL-1.0.html#licenseText", "Net Boolean Public License v1", + false, "NBPL-1.0", null + }, + { + 233, false, "https://spdx.org/licenses/Naumen.html#licenseText", "Naumen Public License", true, + "Naumen", null + }, + { + 232, false, "https://spdx.org/licenses/NASA-1.3.html#licenseText", "NASA Open Source Agreement 1.3", + true, "NASA-1.3", null + }, + { + 231, false, "https://spdx.org/licenses/Mup.html#licenseText", "Mup License", false, "Mup", null + }, + { + 230, false, "https://spdx.org/licenses/Multics.html#licenseText", "Multics License", true, + "Multics", null + }, + { + 238, false, "https://spdx.org/licenses/Newsletr.html#licenseText", "Newsletr License", false, + "Newsletr", null + }, + { + 249, false, "https://spdx.org/licenses/NTP.html#licenseText", "NTP License", true, "NTP", null + }, + { + 250, false, "https://spdx.org/licenses/OCCT-PL.html#licenseText", + "Open CASCADE Technology Public License", false, "OCCT-PL", null + }, + { + 251, false, "https://spdx.org/licenses/OCLC-2.0.html#licenseText", + "OCLC Research Public License 2.0", true, "OCLC-2.0", null + }, + { + 270, true, "https://spdx.org/licenses/OLDAP-2.3.html#licenseText", "Open LDAP Public License v2.3", + false, "OLDAP-2.3", null + }, + { + 269, false, "https://spdx.org/licenses/OLDAP-2.2.2.html#licenseText", + "Open LDAP Public License 2.2.2", false, "OLDAP-2.2.2", null + }, + { + 268, false, "https://spdx.org/licenses/OLDAP-2.2.1.html#licenseText", + "Open LDAP Public License v2.2.1", false, "OLDAP-2.2.1", null + }, + { + 267, false, "https://spdx.org/licenses/OLDAP-2.2.html#licenseText", "Open LDAP Public License v2.2", + false, "OLDAP-2.2", null + }, + { + 266, false, "https://spdx.org/licenses/OLDAP-2.1.html#licenseText", "Open LDAP Public License v2.1", + false, "OLDAP-2.1", null + }, + { + 265, false, "https://spdx.org/licenses/OLDAP-2.0.1.html#licenseText", + "Open LDAP Public License v2.0.1", false, "OLDAP-2.0.1", null + }, + { + 264, false, "https://spdx.org/licenses/OLDAP-2.0.html#licenseText", + "Open LDAP Public License v2.0 (or possibly 2.0A and 2.0B)", false, "OLDAP-2.0", null + }, + { + 263, false, "https://spdx.org/licenses/OLDAP-1.4.html#licenseText", "Open LDAP Public License v1.4", + false, "OLDAP-1.4", null + }, + { + 262, false, "https://spdx.org/licenses/OLDAP-1.3.html#licenseText", "Open LDAP Public License v1.3", + false, "OLDAP-1.3", null + }, + { + 261, false, "https://spdx.org/licenses/OLDAP-1.2.html#licenseText", "Open LDAP Public License v1.2", + false, "OLDAP-1.2", null + }, + { + 260, false, "https://spdx.org/licenses/OLDAP-1.1.html#licenseText", "Open LDAP Public License v1.1", + false, "OLDAP-1.1", null + }, + { + 259, false, "https://spdx.org/licenses/OGTSL.html#licenseText", "Open Group Test Suite License", + true, "OGTSL", null + }, + { + 258, false, "https://spdx.org/licenses/OGL-UK-3.0.html#licenseText", "Open Government Licence v3.0", + false, "OGL-UK-3.0", null + }, + { + 257, false, "https://spdx.org/licenses/OGL-UK-2.0.html#licenseText", "Open Government Licence v2.0", + false, "OGL-UK-2.0", null + }, + { + 256, false, "https://spdx.org/licenses/OGL-UK-1.0.html#licenseText", "Open Government Licence v1.0", + false, "OGL-UK-1.0", null + }, + { + 255, true, "https://spdx.org/licenses/OFL-1.1.html#licenseText", "SIL Open Font License 1.1", true, + "OFL-1.1", null + }, + { + 254, true, "https://spdx.org/licenses/OFL-1.0.html#licenseText", "SIL Open Font License 1.0", false, + "OFL-1.0", null + }, + { + 253, false, "https://spdx.org/licenses/ODC-By-1.0.html#licenseText", + "Open Data Commons Attribution License v1.0", false, "ODC-By-1.0", null + }, + { + 252, true, "https://spdx.org/licenses/ODbL-1.0.html#licenseText", "ODC Open Database License v1.0", + false, "ODbL-1.0", null + }, + { + 229, false, "https://spdx.org/licenses/MTLL.html#licenseText", "Matrix Template Library License", + false, "MTLL", null + }, + { + 228, true, "https://spdx.org/licenses/MS-RL.html#licenseText", "Microsoft Reciprocal License", true, + "MS-RL", null + }, + { + 227, true, "https://spdx.org/licenses/MS-PL.html#licenseText", "Microsoft Public License", true, + "MS-PL", null + }, + { + 226, false, "https://spdx.org/licenses/MPL-2.0-no-copyleft-exception.html#licenseText", + "Mozilla Public License 2.0 (no copyleft exception)", true, "MPL-2.0-no-copyleft-exception", null + }, + { + 202, false, "https://spdx.org/licenses/LiLiQ-R-1.1.html#licenseText", + "Licence Libre du Québec – Réciprocité version 1.1", true, "LiLiQ-R-1.1", null + }, + { + 201, false, "https://spdx.org/licenses/LiLiQ-P-1.1.html#licenseText", + "Licence Libre du Québec – Permissive version 1.1", true, "LiLiQ-P-1.1", null + }, + { + 200, false, "https://spdx.org/licenses/libtiff.html#licenseText", "libtiff License", false, + "libtiff", null + }, + { + 199, false, "https://spdx.org/licenses/libpng-2.0.html#licenseText", + "PNG Reference Library version 2", false, "libpng-2.0", null + }, + { + 198, false, "https://spdx.org/licenses/Libpng.html#licenseText", "libpng License", false, "Libpng", + null + }, + { + 197, false, "https://spdx.org/licenses/LGPLLR.html#licenseText", + "Lesser General Public License For Linguistic Resources", false, "LGPLLR", null + }, + { + 196, true, "https://spdx.org/licenses/LGPL-3.0-or-later.html#licenseText", + "GNU Lesser General Public License v3.0 or later", true, "LGPL-3.0-or-later", null + }, + { + 195, true, "https://spdx.org/licenses/LGPL-3.0-only.html#licenseText", + "GNU Lesser General Public License v3.0 only", true, "LGPL-3.0-only", null + }, + { + 194, true, "https://spdx.org/licenses/LGPL-2.1-or-later.html#licenseText", + "GNU Lesser General Public License v2.1 or later", true, "LGPL-2.1-or-later", null + }, + { + 193, true, "https://spdx.org/licenses/LGPL-2.1-only.html#licenseText", + "GNU Lesser General Public License v2.1 only", true, "LGPL-2.1-only", null + }, + { + 192, false, "https://spdx.org/licenses/LGPL-2.0-or-later.html#licenseText", + "GNU Library General Public License v2 or later", true, "LGPL-2.0-or-later", null + }, + { + 191, false, "https://spdx.org/licenses/LGPL-2.0-only.html#licenseText", + "GNU Library General Public License v2 only", true, "LGPL-2.0-only", null + }, + { + 190, false, "https://spdx.org/licenses/Leptonica.html#licenseText", "Leptonica License", false, + "Leptonica", null + }, + { + 189, false, "https://spdx.org/licenses/Latex2e.html#licenseText", "Latex2e License", false, + "Latex2e", null + }, + { + 188, false, "https://spdx.org/licenses/LAL-1.3.html#licenseText", "Licence Art Libre 1.3", false, + "LAL-1.3", null + }, + { + 187, false, "https://spdx.org/licenses/LAL-1.2.html#licenseText", "Licence Art Libre 1.2", false, + "LAL-1.2", null + }, + { + 186, false, "https://spdx.org/licenses/JSON.html#licenseText", "JSON License", false, "JSON", null + }, + { + 185, false, "https://spdx.org/licenses/JPNIC.html#licenseText", + "Japan Network Information Center License", false, "JPNIC", null + }, + { + 184, false, "https://spdx.org/licenses/JasPer-2.0.html#licenseText", "JasPer License", false, + "JasPer-2.0", null + }, + { + 203, false, "https://spdx.org/licenses/LiLiQ-Rplus-1.1.html#licenseText", + "Licence Libre du Québec – Réciprocité forte version 1.1", true, "LiLiQ-Rplus-1.1", null + }, + { + 271, false, "https://spdx.org/licenses/OLDAP-2.4.html#licenseText", "Open LDAP Public License v2.4", + false, "OLDAP-2.4", null + }, + { + 204, false, "https://spdx.org/licenses/Linux-OpenIB.html#licenseText", + "Linux Kernel Variant of OpenIB.org license", false, "Linux-OpenIB", null + }, + { + 206, true, "https://spdx.org/licenses/LPL-1.02.html#licenseText", "Lucent Public License v1.02", + true, "LPL-1.02", null + }, + { + 225, true, "https://spdx.org/licenses/MPL-2.0.html#licenseText", "Mozilla Public License 2.0", true, + "MPL-2.0", null + }, + { + 224, true, "https://spdx.org/licenses/MPL-1.1.html#licenseText", "Mozilla Public License 1.1", true, + "MPL-1.1", null + }, + { + 223, false, "https://spdx.org/licenses/MPL-1.0.html#licenseText", "Mozilla Public License 1.0", + true, "MPL-1.0", null + }, + { + 222, false, "https://spdx.org/licenses/mpich2.html#licenseText", "mpich2 License", false, "mpich2", + null + }, + { + 221, false, "https://spdx.org/licenses/Motosoto.html#licenseText", "Motosoto License", true, + "Motosoto", null + }, + { + 220, false, "https://spdx.org/licenses/MITNFA.html#licenseText", "MIT +no-false-attribs license", + false, "MITNFA", null + }, + { + 219, false, "https://spdx.org/licenses/MIT-feh.html#licenseText", "feh License", false, "MIT-feh", + null + }, + { + 218, false, "https://spdx.org/licenses/MIT-enna.html#licenseText", "enna License", false, + "MIT-enna", null + }, + { + 217, false, "https://spdx.org/licenses/MIT-CMU.html#licenseText", "CMU License", false, "MIT-CMU", + null + }, + { + 216, false, "https://spdx.org/licenses/MIT-advertising.html#licenseText", + "Enlightenment License (e16)", false, "MIT-advertising", null + }, + { + 215, false, "https://spdx.org/licenses/MIT-0.html#licenseText", "MIT No Attribution", true, "MIT-0", + null + }, + { + 214, true, "https://spdx.org/licenses/MIT.html#licenseText", "MIT License", true, "MIT", null + }, + { + 213, false, "https://spdx.org/licenses/MirOS.html#licenseText", "MirOS License", true, "MirOS", null + }, + { + 212, false, "https://spdx.org/licenses/MakeIndex.html#licenseText", "MakeIndex License", false, + "MakeIndex", null + }, + { + 211, false, "https://spdx.org/licenses/LPPL-1.3c.html#licenseText", + "LaTeX Project Public License v1.3c", true, "LPPL-1.3c", null + }, + { + 210, true, "https://spdx.org/licenses/LPPL-1.3a.html#licenseText", + "LaTeX Project Public License v1.3a", false, "LPPL-1.3a", null + }, + { + 209, true, "https://spdx.org/licenses/LPPL-1.2.html#licenseText", + "LaTeX Project Public License v1.2", false, "LPPL-1.2", null + }, + { + 208, false, "https://spdx.org/licenses/LPPL-1.1.html#licenseText", + "LaTeX Project Public License v1.1", false, "LPPL-1.1", null + }, + { + 207, false, "https://spdx.org/licenses/LPPL-1.0.html#licenseText", + "LaTeX Project Public License v1.0", false, "LPPL-1.0", null + }, + { + 205, false, "https://spdx.org/licenses/LPL-1.0.html#licenseText", + "Lucent Public License Version 1.0", true, "LPL-1.0", null + }, + { + 183, true, "https://spdx.org/licenses/ISC.html#licenseText", "ISC License", true, "ISC", null + }, + { + 272, false, "https://spdx.org/licenses/OLDAP-2.5.html#licenseText", "Open LDAP Public License v2.5", + false, "OLDAP-2.5", null + }, + { + 274, true, "https://spdx.org/licenses/OLDAP-2.7.html#licenseText", "Open LDAP Public License v2.7", + false, "OLDAP-2.7", null + }, + { + 338, false, "https://spdx.org/licenses/VOSTROM.html#licenseText", + "VOSTROM Public License for Open Source", false, "VOSTROM", null + }, + { + 337, true, "https://spdx.org/licenses/Vim.html#licenseText", "Vim License", false, "Vim", null + }, + { + 336, true, "https://spdx.org/licenses/UPL-1.0.html#licenseText", + "Universal Permissive License v1.0", true, "UPL-1.0", null + }, + { + 335, true, "https://spdx.org/licenses/Unlicense.html#licenseText", "The Unlicense", false, + "Unlicense", null + }, + { + 334, false, "https://spdx.org/licenses/Unicode-TOU.html#licenseText", "Unicode Terms of Use", false, + "Unicode-TOU", null + }, + { + 333, false, "https://spdx.org/licenses/Unicode-DFS-2016.html#licenseText", + "Unicode License Agreement - Data Files and Software (2016)", false, "Unicode-DFS-2016", null + }, + { + 332, false, "https://spdx.org/licenses/Unicode-DFS-2015.html#licenseText", + "Unicode License Agreement - Data Files and Software (2015)", false, "Unicode-DFS-2015", null + }, + { + 331, false, "https://spdx.org/licenses/TU-Berlin-2.0.html#licenseText", + "Technische Universitaet Berlin License 2.0", false, "TU-Berlin-2.0", null + }, + { + 339, false, "https://spdx.org/licenses/VSL-1.0.html#licenseText", "Vovida Software License v1.0", + true, "VSL-1.0", null + }, + { + 330, false, "https://spdx.org/licenses/TU-Berlin-1.0.html#licenseText", + "Technische Universitaet Berlin License 1.0", false, "TU-Berlin-1.0", null + }, + { + 328, false, "https://spdx.org/licenses/TORQUE-1.1.html#licenseText", + "TORQUE v2.5+ Software License v1.1", false, "TORQUE-1.1", null + }, + { + 327, false, "https://spdx.org/licenses/TMate.html#licenseText", "TMate Open Source License", false, + "TMate", null + }, + { + 326, false, "https://spdx.org/licenses/TCP-wrappers.html#licenseText", "TCP Wrappers License", + false, "TCP-wrappers", null + }, + { + 325, false, "https://spdx.org/licenses/TCL.html#licenseText", "TCL/TK License", false, "TCL", null + }, + { + 324, false, "https://spdx.org/licenses/TAPR-OHL-1.0.html#licenseText", + "TAPR Open Hardware License v1.0", false, "TAPR-OHL-1.0", null + }, + { + 323, false, "https://spdx.org/licenses/SWL.html#licenseText", + "Scheme Widget Library (SWL) Software License Agreement", false, "SWL", null + }, + { + 322, false, "https://spdx.org/licenses/SugarCRM-1.1.3.html#licenseText", + "SugarCRM Public License v1.1.3", false, "SugarCRM-1.1.3", null + }, + { + 321, true, "https://spdx.org/licenses/SPL-1.0.html#licenseText", "Sun Public License v1.0", true, + "SPL-1.0", null + }, + { + 329, false, "https://spdx.org/licenses/TOSL.html#licenseText", "Trusster Open Source License", + false, "TOSL", null + }, + { + 340, true, "https://spdx.org/licenses/W3C.html#licenseText", + "W3C Software Notice and License (2002-12-31)", true, "W3C", null + }, + { + 341, false, "https://spdx.org/licenses/W3C-19980720.html#licenseText", + "W3C Software Notice and License (1998-07-20)", false, "W3C-19980720", null + }, + { + 342, false, "https://spdx.org/licenses/W3C-20150513.html#licenseText", + "W3C Software Notice and Document License (2015-05-13)", false, "W3C-20150513", null + }, + { + 361, false, "https://spdx.org/licenses/ZPL-1.1.html#licenseText", "Zope Public License 1.1", false, + "ZPL-1.1", null + }, + { + 360, false, "https://spdx.org/licenses/zlib-acknowledgement.html#licenseText", + "zlib/libpng License with Acknowledgement", false, "zlib-acknowledgement", null + }, + { + 359, true, "https://spdx.org/licenses/Zlib.html#licenseText", "zlib License", true, "Zlib", null + }, + { + 358, false, "https://spdx.org/licenses/Zimbra-1.4.html#licenseText", "Zimbra Public License v1.4", + false, "Zimbra-1.4", null + }, + { + 357, true, "https://spdx.org/licenses/Zimbra-1.3.html#licenseText", "Zimbra Public License v1.3", + false, "Zimbra-1.3", null + }, + { + 356, true, "https://spdx.org/licenses/Zend-2.0.html#licenseText", "Zend License v2.0", false, + "Zend-2.0", null + }, + { + 355, false, "https://spdx.org/licenses/Zed.html#licenseText", "Zed License", false, "Zed", null + }, + { + 354, true, "https://spdx.org/licenses/YPL-1.1.html#licenseText", "Yahoo! Public License v1.1", + false, "YPL-1.1", null + }, + { + 353, false, "https://spdx.org/licenses/YPL-1.0.html#licenseText", "Yahoo! Public License v1.0", + false, "YPL-1.0", null + }, + { + 352, false, "https://spdx.org/licenses/XSkat.html#licenseText", "XSkat License", false, "XSkat", + null + }, + { + 351, false, "https://spdx.org/licenses/xpp.html#licenseText", "XPP License", false, "xpp", null + }, + { + 350, false, "https://spdx.org/licenses/Xnet.html#licenseText", "X.Net License", true, "Xnet", null + }, + { + 349, true, "https://spdx.org/licenses/xinetd.html#licenseText", "xinetd License", false, "xinetd", + null + }, + { + 348, true, "https://spdx.org/licenses/XFree86-1.1.html#licenseText", "XFree86 License 1.1", false, + "XFree86-1.1", null + }, + { + 347, false, "https://spdx.org/licenses/Xerox.html#licenseText", "Xerox License", false, "Xerox", + null + }, + { + 346, true, "https://spdx.org/licenses/X11.html#licenseText", "X11 License", false, "X11", null + }, + { + 345, true, "https://spdx.org/licenses/WTFPL.html#licenseText", + "Do What The F*ck You Want To Public License", false, "WTFPL", null + }, + { + 344, false, "https://spdx.org/licenses/Wsuipa.html#licenseText", "Wsuipa License", false, "Wsuipa", + null + }, + { + 343, false, "https://spdx.org/licenses/Watcom-1.0.html#licenseText", + "Sybase Open Watcom Public License 1.0", true, "Watcom-1.0", null + }, + { + 320, false, "https://spdx.org/licenses/Spencer-99.html#licenseText", "Spencer License 99", false, + "Spencer-99", null + }, + { + 319, false, "https://spdx.org/licenses/Spencer-94.html#licenseText", "Spencer License 94", false, + "Spencer-94", null + }, + { + 318, false, "https://spdx.org/licenses/Spencer-86.html#licenseText", "Spencer License 86", false, + "Spencer-86", null + }, + { + 317, false, "https://spdx.org/licenses/SNIA.html#licenseText", "SNIA Public License 1.1", false, + "SNIA", null + }, + { + 293, false, "https://spdx.org/licenses/Qhull.html#licenseText", "Qhull License", false, "Qhull", + null + }, + { + 292, true, "https://spdx.org/licenses/Python-2.0.html#licenseText", "Python License 2.0", true, + "Python-2.0", null + }, + { + 291, false, "https://spdx.org/licenses/psutils.html#licenseText", "psutils License", false, + "psutils", null + }, + { + 290, false, "https://spdx.org/licenses/psfrag.html#licenseText", "psfrag License", false, "psfrag", + null + }, + { + 289, false, "https://spdx.org/licenses/PostgreSQL.html#licenseText", "PostgreSQL License", true, + "PostgreSQL", null + }, + { + 288, false, "https://spdx.org/licenses/Plexus.html#licenseText", "Plexus Classworlds License", + false, "Plexus", null + }, + { + 287, true, "https://spdx.org/licenses/PHP-3.01.html#licenseText", "PHP License v3.01", false, + "PHP-3.01", null + }, + { + 286, false, "https://spdx.org/licenses/PHP-3.0.html#licenseText", "PHP License v3.0", true, + "PHP-3.0", null + }, + { + 285, false, "https://spdx.org/licenses/PDDL-1.0.html#licenseText", + "ODC Public Domain Dedication & License 1.0", false, "PDDL-1.0", null + }, + { + 284, true, "https://spdx.org/licenses/OSL-3.0.html#licenseText", "Open Software License 3.0", true, + "OSL-3.0", null + }, + { + 283, true, "https://spdx.org/licenses/OSL-2.1.html#licenseText", "Open Software License 2.1", true, + "OSL-2.1", null + }, + { + 282, true, "https://spdx.org/licenses/OSL-2.0.html#licenseText", "Open Software License 2.0", true, + "OSL-2.0", null + }, + { + 281, true, "https://spdx.org/licenses/OSL-1.1.html#licenseText", "Open Software License 1.1", false, + "OSL-1.1", null + }, + { + 280, true, "https://spdx.org/licenses/OSL-1.0.html#licenseText", "Open Software License 1.0", true, + "OSL-1.0", null + }, + { + 279, false, "https://spdx.org/licenses/OSET-PL-2.1.html#licenseText", + "OSET Public License version 2.1", true, "OSET-PL-2.1", null + }, + { + 278, false, "https://spdx.org/licenses/OPL-1.0.html#licenseText", "Open Public License v1.0", false, + "OPL-1.0", null + }, + { + 277, true, "https://spdx.org/licenses/OpenSSL.html#licenseText", "OpenSSL License", false, + "OpenSSL", null + }, + { + 276, false, "https://spdx.org/licenses/OML.html#licenseText", "Open Market License", false, "OML", + null + }, + { + 275, false, "https://spdx.org/licenses/OLDAP-2.8.html#licenseText", "Open LDAP Public License v2.8", + false, "OLDAP-2.8", null + }, + { + 294, true, "https://spdx.org/licenses/QPL-1.0.html#licenseText", "Q Public License 1.0", true, + "QPL-1.0", null + }, + { + 273, false, "https://spdx.org/licenses/OLDAP-2.6.html#licenseText", "Open LDAP Public License v2.6", + false, "OLDAP-2.6", null + }, + { + 295, false, "https://spdx.org/licenses/Rdisc.html#licenseText", "Rdisc License", false, "Rdisc", + null + }, + { + 297, false, "https://spdx.org/licenses/RPL-1.1.html#licenseText", "Reciprocal Public License 1.1", + true, "RPL-1.1", null + }, + { + 316, false, "https://spdx.org/licenses/SMPPL.html#licenseText", + "Secure Messaging Protocol Public License", false, "SMPPL", null + }, + { + 315, true, "https://spdx.org/licenses/SMLNJ.html#licenseText", "Standard ML of New Jersey License", + false, "SMLNJ", null + }, + { + 314, true, "https://spdx.org/licenses/Sleepycat.html#licenseText", "Sleepycat License", true, + "Sleepycat", null + }, + { + 313, false, "https://spdx.org/licenses/SISSL-1.2.html#licenseText", + "Sun Industry Standards Source License v1.2", false, "SISSL-1.2", null + }, + { + 312, true, "https://spdx.org/licenses/SISSL.html#licenseText", + "Sun Industry Standards Source License v1.1", true, "SISSL", null + }, + { + 311, false, "https://spdx.org/licenses/SimPL-2.0.html#licenseText", "Simple Public License 2.0", + true, "SimPL-2.0", null + }, + { + 310, true, "https://spdx.org/licenses/SGI-B-2.0.html#licenseText", + "SGI Free Software License B v2.0", false, "SGI-B-2.0", null + }, + { + 309, false, "https://spdx.org/licenses/SGI-B-1.1.html#licenseText", + "SGI Free Software License B v1.1", false, "SGI-B-1.1", null + }, + { + 308, false, "https://spdx.org/licenses/SGI-B-1.0.html#licenseText", + "SGI Free Software License B v1.0", false, "SGI-B-1.0", null + }, + { + 307, false, "https://spdx.org/licenses/Sendmail-8.23.html#licenseText", "Sendmail License 8.23", + false, "Sendmail-8.23", null + }, + { + 306, false, "https://spdx.org/licenses/Sendmail.html#licenseText", "Sendmail License", false, + "Sendmail", null + }, + { + 305, false, "https://spdx.org/licenses/SCEA.html#licenseText", "SCEA Shared Source License", false, + "SCEA", null + }, + { + 304, false, "https://spdx.org/licenses/Saxpath.html#licenseText", "Saxpath License", false, + "Saxpath", null + }, + { + 303, false, "https://spdx.org/licenses/SAX-PD.html#licenseText", "Sax Public Domain Notice", false, + "SAX-PD", null + }, + { + 302, true, "https://spdx.org/licenses/Ruby.html#licenseText", "Ruby License", false, "Ruby", null + }, + { + 301, false, "https://spdx.org/licenses/RSCPL.html#licenseText", "Ricoh Source Code Public License", + true, "RSCPL", null + }, + { + 300, false, "https://spdx.org/licenses/RSA-MD.html#licenseText", "RSA Message-Digest License", + false, "RSA-MD", null + }, + { + 299, true, "https://spdx.org/licenses/RPSL-1.0.html#licenseText", + "RealNetworks Public Source License v1.0", true, "RPSL-1.0", null + }, + { + 298, false, "https://spdx.org/licenses/RPL-1.5.html#licenseText", "Reciprocal Public License 1.5", + true, "RPL-1.5", null + }, + { + 296, false, "https://spdx.org/licenses/RHeCos-1.1.html#licenseText", + "Red Hat eCos Public License v1.1", false, "RHeCos-1.1", null + }, + { + 362, true, "https://spdx.org/licenses/ZPL-2.0.html#licenseText", "Zope Public License 2.0", true, + "ZPL-2.0", null + }, + { + 182, true, "https://spdx.org/licenses/IPL-1.0.html#licenseText", "IBM Public License v1.0", true, + "IPL-1.0", null + }, + { + 180, false, "https://spdx.org/licenses/Interbase-1.0.html#licenseText", + "Interbase Public License v1.0", false, "Interbase-1.0", null + }, + { + 65, false, "https://spdx.org/licenses/CC-BY-1.0.html#licenseText", + "Creative Commons Attribution 1.0 Generic", false, "CC-BY-1.0", null + }, + { + 64, false, "https://spdx.org/licenses/CATOSL-1.1.html#licenseText", + "Computer Associates Trusted Open Source License 1.1", true, "CATOSL-1.1", null + }, + { + 63, false, "https://spdx.org/licenses/Caldera.html#licenseText", "Caldera License", false, + "Caldera", null + }, + { + 62, false, "https://spdx.org/licenses/bzip2-1.0.6.html#licenseText", + "bzip2 and libbzip2 License v1.0.6", false, "bzip2-1.0.6", null + }, + { + 61, false, "https://spdx.org/licenses/bzip2-1.0.5.html#licenseText", + "bzip2 and libbzip2 License v1.0.5", false, "bzip2-1.0.5", null + }, + { + 60, true, "https://spdx.org/licenses/BSL-1.0.html#licenseText", "Boost Software License 1.0", true, + "BSL-1.0", null + }, + { + 59, false, "https://spdx.org/licenses/BSD-Source-Code.html#licenseText", + "BSD Source Code Attribution", false, "BSD-Source-Code", null + }, + { + 58, false, "https://spdx.org/licenses/BSD-Protection.html#licenseText", "BSD Protection License", + false, "BSD-Protection", null + }, + { + 66, false, "https://spdx.org/licenses/CC-BY-2.0.html#licenseText", + "Creative Commons Attribution 2.0 Generic", false, "CC-BY-2.0", null + }, + { + 57, false, "https://spdx.org/licenses/BSD-4-Clause-UC.html#licenseText", + "BSD-4-Clause (University of California-Specific)", false, "BSD-4-Clause-UC", null + }, + { + 55, false, "https://spdx.org/licenses/BSD-3-Clause-No-Nuclear-Warranty.html#licenseText", + "BSD 3-Clause No Nuclear Warranty", false, "BSD-3-Clause-No-Nuclear-Warranty", null + }, + { + 54, false, "https://spdx.org/licenses/BSD-3-Clause-No-Nuclear-License-2014.html#licenseText", + "BSD 3-Clause No Nuclear License 2014", false, "BSD-3-Clause-No-Nuclear-License-2014", null + }, + { + 53, false, "https://spdx.org/licenses/BSD-3-Clause-No-Nuclear-License.html#licenseText", + "BSD 3-Clause No Nuclear License", false, "BSD-3-Clause-No-Nuclear-License", null + }, + { + 52, false, "https://spdx.org/licenses/BSD-3-Clause-LBNL.html#licenseText", + "Lawrence Berkeley National Labs BSD variant license", false, "BSD-3-Clause-LBNL", null + }, + { + 51, true, "https://spdx.org/licenses/BSD-3-Clause-Clear.html#licenseText", + "BSD 3-Clause Clear License", false, "BSD-3-Clause-Clear", null + }, + { + 50, false, "https://spdx.org/licenses/BSD-3-Clause-Attribution.html#licenseText", + "BSD with attribution", false, "BSD-3-Clause-Attribution", null + }, + { + 49, true, "https://spdx.org/licenses/BSD-3-Clause.html#licenseText", + "BSD 3-Clause \"New\" or \"Revised\" License", true, "BSD-3-Clause", null + }, + { + 48, false, "https://spdx.org/licenses/BSD-2-Clause-Patent.html#licenseText", + "BSD-2-Clause Plus Patent License", true, "BSD-2-Clause-Patent", null + }, + { + 56, true, "https://spdx.org/licenses/BSD-4-Clause.html#licenseText", + "BSD 4-Clause \"Original\" or \"Old\" License", false, "BSD-4-Clause", null + }, + { + 67, false, "https://spdx.org/licenses/CC-BY-2.5.html#licenseText", + "Creative Commons Attribution 2.5 Generic", false, "CC-BY-2.5", null + }, + { + 68, false, "https://spdx.org/licenses/CC-BY-3.0.html#licenseText", + "Creative Commons Attribution 3.0 Unported", false, "CC-BY-3.0", null + }, + { + 69, true, "https://spdx.org/licenses/CC-BY-4.0.html#licenseText", + "Creative Commons Attribution 4.0 International", false, "CC-BY-4.0", null + }, + { + 88, false, "https://spdx.org/licenses/CC-BY-ND-3.0.html#licenseText", + "Creative Commons Attribution No Derivatives 3.0 Unported", false, "CC-BY-ND-3.0", null + }, + { + 87, false, "https://spdx.org/licenses/CC-BY-ND-2.5.html#licenseText", + "Creative Commons Attribution No Derivatives 2.5 Generic", false, "CC-BY-ND-2.5", null + }, + { + 86, false, "https://spdx.org/licenses/CC-BY-ND-2.0.html#licenseText", + "Creative Commons Attribution No Derivatives 2.0 Generic", false, "CC-BY-ND-2.0", null + }, + { + 85, false, "https://spdx.org/licenses/CC-BY-ND-1.0.html#licenseText", + "Creative Commons Attribution No Derivatives 1.0 Generic", false, "CC-BY-ND-1.0", null + }, + { + 84, false, "https://spdx.org/licenses/CC-BY-NC-SA-4.0.html#licenseText", + "Creative Commons Attribution Non Commercial Share Alike 4.0 International", false, + "CC-BY-NC-SA-4.0", null + }, + { + 83, false, "https://spdx.org/licenses/CC-BY-NC-SA-3.0.html#licenseText", + "Creative Commons Attribution Non Commercial Share Alike 3.0 Unported", false, "CC-BY-NC-SA-3.0", + null + }, + { + 82, false, "https://spdx.org/licenses/CC-BY-NC-SA-2.5.html#licenseText", + "Creative Commons Attribution Non Commercial Share Alike 2.5 Generic", false, "CC-BY-NC-SA-2.5", + null + }, + { + 81, false, "https://spdx.org/licenses/CC-BY-NC-SA-2.0.html#licenseText", + "Creative Commons Attribution Non Commercial Share Alike 2.0 Generic", false, "CC-BY-NC-SA-2.0", + null + }, + { + 80, false, "https://spdx.org/licenses/CC-BY-NC-SA-1.0.html#licenseText", + "Creative Commons Attribution Non Commercial Share Alike 1.0 Generic", false, "CC-BY-NC-SA-1.0", + null + }, + { + 79, false, "https://spdx.org/licenses/CC-BY-NC-ND-4.0.html#licenseText", + "Creative Commons Attribution Non Commercial No Derivatives 4.0 International", false, + "CC-BY-NC-ND-4.0", null + }, + { + 78, false, "https://spdx.org/licenses/CC-BY-NC-ND-3.0.html#licenseText", + "Creative Commons Attribution Non Commercial No Derivatives 3.0 Unported", false, "CC-BY-NC-ND-3.0", + null + }, + { + 77, false, "https://spdx.org/licenses/CC-BY-NC-ND-2.5.html#licenseText", + "Creative Commons Attribution Non Commercial No Derivatives 2.5 Generic", false, "CC-BY-NC-ND-2.5", + null + }, + { + 76, false, "https://spdx.org/licenses/CC-BY-NC-ND-2.0.html#licenseText", + "Creative Commons Attribution Non Commercial No Derivatives 2.0 Generic", false, "CC-BY-NC-ND-2.0", + null + }, + { + 75, false, "https://spdx.org/licenses/CC-BY-NC-ND-1.0.html#licenseText", + "Creative Commons Attribution Non Commercial No Derivatives 1.0 Generic", false, "CC-BY-NC-ND-1.0", + null + }, + { + 74, false, "https://spdx.org/licenses/CC-BY-NC-4.0.html#licenseText", + "Creative Commons Attribution Non Commercial 4.0 International", false, "CC-BY-NC-4.0", null + }, + { + 73, false, "https://spdx.org/licenses/CC-BY-NC-3.0.html#licenseText", + "Creative Commons Attribution Non Commercial 3.0 Unported", false, "CC-BY-NC-3.0", null + }, + { + 72, false, "https://spdx.org/licenses/CC-BY-NC-2.5.html#licenseText", + "Creative Commons Attribution Non Commercial 2.5 Generic", false, "CC-BY-NC-2.5", null + }, + { + 71, false, "https://spdx.org/licenses/CC-BY-NC-2.0.html#licenseText", + "Creative Commons Attribution Non Commercial 2.0 Generic", false, "CC-BY-NC-2.0", null + }, + { + 70, false, "https://spdx.org/licenses/CC-BY-NC-1.0.html#licenseText", + "Creative Commons Attribution Non Commercial 1.0 Generic", false, "CC-BY-NC-1.0", null + }, + { + 47, false, "https://spdx.org/licenses/BSD-2-Clause-NetBSD.html#licenseText", + "BSD 2-Clause NetBSD License", false, "BSD-2-Clause-NetBSD", null + }, + { + 46, true, "https://spdx.org/licenses/BSD-2-Clause-FreeBSD.html#licenseText", + "BSD 2-Clause FreeBSD License", false, "BSD-2-Clause-FreeBSD", null + }, + { + 45, false, "https://spdx.org/licenses/BSD-2-Clause.html#licenseText", + "BSD 2-Clause \"Simplified\" License", true, "BSD-2-Clause", null + }, + { + 44, false, "https://spdx.org/licenses/BSD-1-Clause.html#licenseText", "BSD 1-Clause License", false, + "BSD-1-Clause", null + }, + { + 20, false, "https://spdx.org/licenses/Aladdin.html#licenseText", "Aladdin Free Public License", + false, "Aladdin", null + }, + { + 19, true, "https://spdx.org/licenses/AGPL-3.0-or-later.html#licenseText", + "GNU Affero General Public License v3.0 or later", true, "AGPL-3.0-or-later", null + }, + { + 18, true, "https://spdx.org/licenses/AGPL-3.0-only.html#licenseText", + "GNU Affero General Public License v3.0 only", true, "AGPL-3.0-only", null + }, + { + 17, false, "https://spdx.org/licenses/AGPL-1.0-or-later.html#licenseText", + "Affero General Public License v1.0 or later", false, "AGPL-1.0-or-later", null + }, + { + 16, false, "https://spdx.org/licenses/AGPL-1.0-only.html#licenseText", + "Affero General Public License v1.0 only", false, "AGPL-1.0-only", null + }, + { + 15, false, "https://spdx.org/licenses/Afmparse.html#licenseText", "Afmparse License", false, + "Afmparse", null + }, + { + 14, true, "https://spdx.org/licenses/AFL-3.0.html#licenseText", "Academic Free License v3.0", true, + "AFL-3.0", null + }, + { + 13, true, "https://spdx.org/licenses/AFL-2.1.html#licenseText", "Academic Free License v2.1", true, + "AFL-2.1", null + }, + { + 12, true, "https://spdx.org/licenses/AFL-2.0.html#licenseText", "Academic Free License v2.0", true, + "AFL-2.0", null + }, + { + 11, true, "https://spdx.org/licenses/AFL-1.2.html#licenseText", "Academic Free License v1.2", true, + "AFL-1.2", null + }, + { + 10, true, "https://spdx.org/licenses/AFL-1.1.html#licenseText", "Academic Free License v1.1", true, + "AFL-1.1", null + }, + { + 9, false, "https://spdx.org/licenses/ADSL.html#licenseText", "Amazon Digital Services License", + false, "ADSL", null + }, + { + 8, false, "https://spdx.org/licenses/Adobe-Glyph.html#licenseText", "Adobe Glyph List License", + false, "Adobe-Glyph", null + }, + { + 7, false, "https://spdx.org/licenses/Adobe-2006.html#licenseText", + "Adobe Systems Incorporated Source Code License Agreement", false, "Adobe-2006", null + }, + { + 6, false, "https://spdx.org/licenses/Abstyles.html#licenseText", "Abstyles License", false, + "Abstyles", null + }, + { + 5, false, "https://spdx.org/licenses/AAL.html#licenseText", "Attribution Assurance License", true, + "AAL", null + }, + { + 4, false, "https://spdx.org/licenses/0BSD.html#licenseText", "BSD Zero Clause License", true, + "0BSD", null + }, + { + 3, false, null, "All rights reserved", false, null, null + }, + { + 2, false, null, "Advertisement use", false, null, null + }, + { + 21, false, "https://spdx.org/licenses/AMDPLPA.html#licenseText", "AMD's plpa_map.c License", false, + "AMDPLPA", null + }, + { + 89, false, "https://spdx.org/licenses/CC-BY-ND-4.0.html#licenseText", + "Creative Commons Attribution No Derivatives 4.0 International", false, "CC-BY-ND-4.0", null + }, + { + 22, false, "https://spdx.org/licenses/AML.html#licenseText", "Apple MIT License", false, "AML", null + }, + { + 24, false, "https://spdx.org/licenses/ANTLR-PD.html#licenseText", "ANTLR Software Rights Notice", + false, "ANTLR-PD", null + }, + { + 43, false, "https://spdx.org/licenses/Borceux.html#licenseText", "Borceux license", false, + "Borceux", null + }, + { + 42, true, "https://spdx.org/licenses/BitTorrent-1.1.html#licenseText", + "BitTorrent Open Source License v1.1", false, "BitTorrent-1.1", null + }, + { + 41, false, "https://spdx.org/licenses/BitTorrent-1.0.html#licenseText", + "BitTorrent Open Source License v1.0", false, "BitTorrent-1.0", null + }, + { + 40, false, "https://spdx.org/licenses/Beerware.html#licenseText", "Beerware License", false, + "Beerware", null + }, + { + 39, false, "https://spdx.org/licenses/Barr.html#licenseText", "Barr License", false, "Barr", null + }, + { + 38, false, "https://spdx.org/licenses/Bahyph.html#licenseText", "Bahyph License", false, "Bahyph", + null + }, + { + 37, true, "https://spdx.org/licenses/Artistic-2.0.html#licenseText", "Artistic License 2.0", true, + "Artistic-2.0", null + }, + { + 36, false, "https://spdx.org/licenses/Artistic-1.0-Perl.html#licenseText", + "Artistic License 1.0 (Perl)", true, "Artistic-1.0-Perl", null + }, + { + 35, false, "https://spdx.org/licenses/Artistic-1.0-cl8.html#licenseText", + "Artistic License 1.0 w/clause 8", true, "Artistic-1.0-cl8", null + }, + { + 34, false, "https://spdx.org/licenses/Artistic-1.0.html#licenseText", "Artistic License 1.0", true, + "Artistic-1.0", null + }, + { + 33, true, "https://spdx.org/licenses/APSL-2.0.html#licenseText", "Apple Public Source License 2.0", + true, "APSL-2.0", null + }, + { + 32, false, "https://spdx.org/licenses/APSL-1.2.html#licenseText", "Apple Public Source License 1.2", + true, "APSL-1.2", null + }, + { + 31, false, "https://spdx.org/licenses/APSL-1.1.html#licenseText", "Apple Public Source License 1.1", + true, "APSL-1.1", null + }, + { + 30, false, "https://spdx.org/licenses/APSL-1.0.html#licenseText", "Apple Public Source License 1.0", + true, "APSL-1.0", null + }, + { + 29, false, "https://spdx.org/licenses/APL-1.0.html#licenseText", "Adaptive Public License 1.0", + true, "APL-1.0", null + }, + { + 28, false, "https://spdx.org/licenses/APAFML.html#licenseText", "Adobe Postscript AFM License", + false, "APAFML", null + }, + { + 27, true, "https://spdx.org/licenses/Apache-2.0.html#licenseText", "Apache License 2.0", true, + "Apache-2.0", null + }, + { + 26, true, "https://spdx.org/licenses/Apache-1.1.html#licenseText", "Apache License 1.1", true, + "Apache-1.1", null + }, + { + 25, true, "https://spdx.org/licenses/Apache-1.0.html#licenseText", "Apache License 1.0", false, + "Apache-1.0", null + }, + { + 23, false, "https://spdx.org/licenses/AMPAS.html#licenseText", + "Academy of Motion Picture Arts and Sciences BSD", false, "AMPAS", null + }, + { + 181, true, "https://spdx.org/licenses/IPA.html#licenseText", "IPA Font License", true, "IPA", null + }, + { + 90, false, "https://spdx.org/licenses/CC-BY-SA-1.0.html#licenseText", + "Creative Commons Attribution Share Alike 1.0 Generic", false, "CC-BY-SA-1.0", null + }, + { + 92, false, "https://spdx.org/licenses/CC-BY-SA-2.5.html#licenseText", + "Creative Commons Attribution Share Alike 2.5 Generic", false, "CC-BY-SA-2.5", null + }, + { + 156, false, "https://spdx.org/licenses/Giftware.html#licenseText", "Giftware License", false, + "Giftware", null + }, + { + 155, true, "https://spdx.org/licenses/GFDL-1.3-or-later.html#licenseText", + "GNU Free Documentation License v1.3 or later", false, "GFDL-1.3-or-later", null + }, + { + 154, true, "https://spdx.org/licenses/GFDL-1.3-only.html#licenseText", + "GNU Free Documentation License v1.3 only", false, "GFDL-1.3-only", null + }, + { + 153, true, "https://spdx.org/licenses/GFDL-1.2-or-later.html#licenseText", + "GNU Free Documentation License v1.2 or later", false, "GFDL-1.2-or-later", null + }, + { + 152, true, "https://spdx.org/licenses/GFDL-1.2-only.html#licenseText", + "GNU Free Documentation License v1.2 only", false, "GFDL-1.2-only", null + }, + { + 151, true, "https://spdx.org/licenses/GFDL-1.1-or-later.html#licenseText", + "GNU Free Documentation License v1.1 or later", false, "GFDL-1.1-or-later", null + }, + { + 150, true, "https://spdx.org/licenses/GFDL-1.1-only.html#licenseText", + "GNU Free Documentation License v1.1 only", false, "GFDL-1.1-only", null + }, + { + 149, true, "https://spdx.org/licenses/FTL.html#licenseText", "Freetype Project License", false, + "FTL", null + }, + { + 157, false, "https://spdx.org/licenses/GL2PS.html#licenseText", "GL2PS License", false, "GL2PS", + null + }, + { + 148, false, "https://spdx.org/licenses/FSFULLR.html#licenseText", + "FSF Unlimited License (with License Retention)", false, "FSFULLR", null + }, + { + 146, true, "https://spdx.org/licenses/FSFAP.html#licenseText", "FSF All Permissive License", false, + "FSFAP", null + }, + { + 145, false, "https://spdx.org/licenses/FreeImage.html#licenseText", "FreeImage Public License v1.0", + false, "FreeImage", null + }, + { + 144, false, "https://spdx.org/licenses/Frameworx-1.0.html#licenseText", + "Frameworx Open License 1.0", true, "Frameworx-1.0", null + }, + { + 143, false, "https://spdx.org/licenses/Fair.html#licenseText", "Fair License", true, "Fair", null + }, + { + 142, false, "https://spdx.org/licenses/Eurosym.html#licenseText", "Eurosym License", false, + "Eurosym", null + }, + { + 141, true, "https://spdx.org/licenses/EUPL-1.2.html#licenseText", + "European Union Public License 1.2", true, "EUPL-1.2", null + }, + { + 140, true, "https://spdx.org/licenses/EUPL-1.1.html#licenseText", + "European Union Public License 1.1", true, "EUPL-1.1", null + }, + { + 139, false, "https://spdx.org/licenses/EUPL-1.0.html#licenseText", + "European Union Public License 1.0", false, "EUPL-1.0", null + }, + { + 147, false, "https://spdx.org/licenses/FSFUL.html#licenseText", "FSF Unlimited License", false, + "FSFUL", null + }, + { + 158, false, "https://spdx.org/licenses/Glide.html#licenseText", "3dfx Glide License", false, + "Glide", null + }, + { + 159, false, "https://spdx.org/licenses/Glulxe.html#licenseText", "Glulxe License", false, "Glulxe", + null + }, + { + 160, true, "https://spdx.org/licenses/gnuplot.html#licenseText", "gnuplot License", false, + "gnuplot", null + }, + { + 179, false, "https://spdx.org/licenses/Intel-ACPI.html#licenseText", + "Intel ACPI Software License Agreement", false, "Intel-ACPI", null + }, + { + 178, true, "https://spdx.org/licenses/Intel.html#licenseText", "Intel Open Source License", true, + "Intel", null + }, + { + 177, false, "https://spdx.org/licenses/Info-ZIP.html#licenseText", "Info-ZIP License", false, + "Info-ZIP", null + } + }); - migrationBuilder.InsertData("Licenses", - new[] {"Id", "FsfApproved", "Link", "Name", "OsiApproved", "SPDX", "Text"}, - new object[,] - { - { - 176, true, "https://spdx.org/licenses/Imlib2.html#licenseText", - "Imlib2 License", false, "Imlib2", null - }, - { - 175, true, "https://spdx.org/licenses/iMatix.html#licenseText", - "iMatix Standard Function Library Agreement", false, "iMatix", null - }, - { - 174, false, "https://spdx.org/licenses/ImageMagick.html#licenseText", - "ImageMagick License", false, "ImageMagick", null - }, - { - 173, true, "https://spdx.org/licenses/IJG.html#licenseText", - "Independent JPEG Group License", false, "IJG", null - }, - { - 172, false, "https://spdx.org/licenses/ICU.html#licenseText", - "ICU License", false, "ICU", null - }, - { - 171, false, "https://spdx.org/licenses/IBM-pibs.html#licenseText", - "IBM PowerPC Initialization and Boot Software", false, "IBM-pibs", null - }, - { - 170, false, - "https://spdx.org/licenses/HPND-sell-variant.html#licenseText", - "Historical Permission Notice and Disclaimer - sell variant", false, - "HPND-sell-variant", null - }, - { - 169, true, "https://spdx.org/licenses/HPND.html#licenseText", - "Historical Permission Notice and Disclaimer", true, "HPND", null - }, - { - 168, false, "https://spdx.org/licenses/HaskellReport.html#licenseText", - "Haskell Language Report License", false, "HaskellReport", null - }, - { - 167, false, "https://spdx.org/licenses/gSOAP-1.3b.html#licenseText", - "gSOAP Public License v1.3b", false, "gSOAP-1.3b", null - }, - { - 166, true, - "https://spdx.org/licenses/GPL-3.0-or-later.html#licenseText", - "GNU General Public License v3.0 or later", true, "GPL-3.0-or-later", - null - }, - { - 165, true, "https://spdx.org/licenses/GPL-3.0-only.html#licenseText", - "GNU General Public License v3.0 only", true, "GPL-3.0-only", null - }, - { - 164, true, - "https://spdx.org/licenses/GPL-2.0-or-later.html#licenseText", - "GNU General Public License v2.0 or later", true, "GPL-2.0-or-later", - null - }, - { - 163, true, "https://spdx.org/licenses/GPL-2.0-only.html#licenseText", - "GNU General Public License v2.0 only", true, "GPL-2.0-only", null - }, - { - 162, false, - "https://spdx.org/licenses/GPL-1.0-or-later.html#licenseText", - "GNU General Public License v1.0 or later", false, "GPL-1.0-or-later", - null - }, - { - 161, false, "https://spdx.org/licenses/GPL-1.0-only.html#licenseText", - "GNU General Public License v1.0 only", false, "GPL-1.0-only", null - }, - { - 138, true, "https://spdx.org/licenses/EUDatagrid.html#licenseText", - "EU DataGrid Software License", true, "EUDatagrid", null - }, - { - 137, false, "https://spdx.org/licenses/ErlPL-1.1.html#licenseText", - "Erlang Public License v1.1", false, "ErlPL-1.1", null - }, - { - 136, true, "https://spdx.org/licenses/EPL-2.0.html#licenseText", - "Eclipse Public License 2.0", true, "EPL-2.0", null - }, - { - 135, true, "https://spdx.org/licenses/EPL-1.0.html#licenseText", - "Eclipse Public License 1.0", true, "EPL-1.0", null - }, - { - 111, false, - "https://spdx.org/licenses/CNRI-Python-GPL-Compatible.html#licenseText", - "CNRI Python Open Source GPL Compatible License Agreement", false, - "CNRI-Python-GPL-Compatible", null - }, - { - 110, false, "https://spdx.org/licenses/CNRI-Python.html#licenseText", - "CNRI Python License", true, "CNRI-Python", null - }, - { - 109, false, "https://spdx.org/licenses/CNRI-Jython.html#licenseText", - "CNRI Jython License", false, "CNRI-Jython", null - }, - { - 108, true, "https://spdx.org/licenses/ClArtistic.html#licenseText", - "Clarified Artistic License", false, "ClArtistic", null - }, - { - 107, false, "https://spdx.org/licenses/CERN-OHL-1.2.html#licenseText", - "CERN Open Hardware Licence v1.2", false, "CERN-OHL-1.2", null - }, - { - 106, false, "https://spdx.org/licenses/CERN-OHL-1.1.html#licenseText", - "CERN Open Hardware License v1.1", false, "CERN-OHL-1.1", null - }, - { - 105, true, "https://spdx.org/licenses/CECILL-C.html#licenseText", - "CeCILL-C Free Software License Agreement", false, "CECILL-C", null - }, - { - 104, true, "https://spdx.org/licenses/CECILL-B.html#licenseText", - "CeCILL-B Free Software License Agreement", false, "CECILL-B", null - }, - { - 103, false, "https://spdx.org/licenses/CECILL-2.1.html#licenseText", - "CeCILL Free Software License Agreement v2.1", true, "CECILL-2.1", null - }, - { - 102, true, "https://spdx.org/licenses/CECILL-2.0.html#licenseText", - "CeCILL Free Software License Agreement v2.0", false, "CECILL-2.0", null - }, - { - 101, false, "https://spdx.org/licenses/CECILL-1.1.html#licenseText", - "CeCILL Free Software License Agreement v1.1", false, "CECILL-1.1", null - }, - { - 100, false, "https://spdx.org/licenses/CECILL-1.0.html#licenseText", - "CeCILL Free Software License Agreement v1.0", false, "CECILL-1.0", null - }, - { - 99, false, - "https://spdx.org/licenses/CDLA-Sharing-1.0.html#licenseText", - "Community Data License Agreement Sharing 1.0", false, - "CDLA-Sharing-1.0", null - }, - { - 98, false, - "https://spdx.org/licenses/CDLA-Permissive-1.0.html#licenseText", - "Community Data License Agreement Permissive 1.0", false, - "CDLA-Permissive-1.0", null - }, - { - 97, false, "https://spdx.org/licenses/CDDL-1.1.html#licenseText", - "Common Development and Distribution License 1.1", false, "CDDL-1.1", - null - }, - { - 96, true, "https://spdx.org/licenses/CDDL-1.0.html#licenseText", - "Common Development and Distribution License 1.0", true, "CDDL-1.0", - null - }, - { - 95, true, "https://spdx.org/licenses/CC0-1.0.html#licenseText", - "Creative Commons Zero v1.0 Universal", false, "CC0-1.0", null - }, - { - 94, true, "https://spdx.org/licenses/CC-BY-SA-4.0.html#licenseText", - "Creative Commons Attribution Share Alike 4.0 International", false, - "CC-BY-SA-4.0", null - }, - { - 93, false, "https://spdx.org/licenses/CC-BY-SA-3.0.html#licenseText", - "Creative Commons Attribution Share Alike 3.0 Unported", false, - "CC-BY-SA-3.0", null - }, - { - 112, true, "https://spdx.org/licenses/Condor-1.1.html#licenseText", - "Condor Public License v1.1", false, "Condor-1.1", null - }, - { - 91, false, "https://spdx.org/licenses/CC-BY-SA-2.0.html#licenseText", - "Creative Commons Attribution Share Alike 2.0 Generic", false, - "CC-BY-SA-2.0", null - }, - { - 113, false, - "https://spdx.org/licenses/copyleft-next-0.3.0.html#licenseText", - "copyleft-next 0.3.0", false, "copyleft-next-0.3.0", null - }, - { - 115, true, "https://spdx.org/licenses/CPAL-1.0.html#licenseText", - "Common Public Attribution License 1.0", true, "CPAL-1.0", null - }, - { - 134, false, "https://spdx.org/licenses/Entessa.html#licenseText", - "Entessa Public License v1.0", true, "Entessa", null - }, - { - 133, false, "https://spdx.org/licenses/eGenix.html#licenseText", - "eGenix.com Public License 1.1.0", false, "eGenix", null - }, - { - 132, true, "https://spdx.org/licenses/EFL-2.0.html#licenseText", - "Eiffel Forum License v2.0", true, "EFL-2.0", null - }, - { - 131, false, "https://spdx.org/licenses/EFL-1.0.html#licenseText", - "Eiffel Forum License v1.0", true, "EFL-1.0", null - }, - { - 130, true, "https://spdx.org/licenses/ECL-2.0.html#licenseText", - "Educational Community License v2.0", true, "ECL-2.0", null - }, - { - 129, false, "https://spdx.org/licenses/ECL-1.0.html#licenseText", - "Educational Community License v1.0", true, "ECL-1.0", null - }, - { - 128, false, "https://spdx.org/licenses/dvipdfm.html#licenseText", - "dvipdfm License", false, "dvipdfm", null - }, - { - 127, false, "https://spdx.org/licenses/DSDP.html#licenseText", - "DSDP License", false, "DSDP", null - }, - { - 126, false, "https://spdx.org/licenses/Dotseqn.html#licenseText", - "Dotseqn License", false, "Dotseqn", null - }, - { - 125, false, "https://spdx.org/licenses/DOC.html#licenseText", - "DOC License", false, "DOC", null - }, - { - 124, false, "https://spdx.org/licenses/diffmark.html#licenseText", - "diffmark license", false, "diffmark", null - }, - { - 123, false, "https://spdx.org/licenses/D-FSL-1.0.html#licenseText", - "Deutsche Freie Software Lizenz", false, "D-FSL-1.0", null - }, - { - 122, false, "https://spdx.org/licenses/curl.html#licenseText", - "curl License", false, "curl", null - }, - { - 121, false, "https://spdx.org/licenses/Cube.html#licenseText", - "Cube License", false, "Cube", null - }, - { - 120, false, "https://spdx.org/licenses/CUA-OPL-1.0.html#licenseText", - "CUA Office Public License v1.0", true, "CUA-OPL-1.0", null - }, - { - 119, false, "https://spdx.org/licenses/CrystalStacker.html#licenseText", - "CrystalStacker License", false, "CrystalStacker", null - }, - { - 118, false, "https://spdx.org/licenses/Crossword.html#licenseText", - "Crossword License", false, "Crossword", null - }, - { - 117, false, "https://spdx.org/licenses/CPOL-1.02.html#licenseText", - "Code Project Open License 1.02", false, "CPOL-1.02", null - }, - { - 116, true, "https://spdx.org/licenses/CPL-1.0.html#licenseText", - "Common Public License 1.0", true, "CPL-1.0", null - }, - { - 114, false, - "https://spdx.org/licenses/copyleft-next-0.3.1.html#licenseText", - "copyleft-next 0.3.1", false, "copyleft-next-0.3.1", null - }, - { - 363, true, "https://spdx.org/licenses/ZPL-2.1.html#licenseText", - "Zope Public License 2.1", false, "ZPL-2.1", null - } - }); + migrationBuilder.InsertData("Licenses", new[] + { + "Id", "FsfApproved", "Link", "Name", "OsiApproved", "SPDX", "Text" + }, new object[,] + { + { + 176, true, "https://spdx.org/licenses/Imlib2.html#licenseText", "Imlib2 License", false, "Imlib2", + null + }, + { + 175, true, "https://spdx.org/licenses/iMatix.html#licenseText", + "iMatix Standard Function Library Agreement", false, "iMatix", null + }, + { + 174, false, "https://spdx.org/licenses/ImageMagick.html#licenseText", "ImageMagick License", false, + "ImageMagick", null + }, + { + 173, true, "https://spdx.org/licenses/IJG.html#licenseText", "Independent JPEG Group License", + false, "IJG", null + }, + { + 172, false, "https://spdx.org/licenses/ICU.html#licenseText", "ICU License", false, "ICU", null + }, + { + 171, false, "https://spdx.org/licenses/IBM-pibs.html#licenseText", + "IBM PowerPC Initialization and Boot Software", false, "IBM-pibs", null + }, + { + 170, false, "https://spdx.org/licenses/HPND-sell-variant.html#licenseText", + "Historical Permission Notice and Disclaimer - sell variant", false, "HPND-sell-variant", null + }, + { + 169, true, "https://spdx.org/licenses/HPND.html#licenseText", + "Historical Permission Notice and Disclaimer", true, "HPND", null + }, + { + 168, false, "https://spdx.org/licenses/HaskellReport.html#licenseText", + "Haskell Language Report License", false, "HaskellReport", null + }, + { + 167, false, "https://spdx.org/licenses/gSOAP-1.3b.html#licenseText", "gSOAP Public License v1.3b", + false, "gSOAP-1.3b", null + }, + { + 166, true, "https://spdx.org/licenses/GPL-3.0-or-later.html#licenseText", + "GNU General Public License v3.0 or later", true, "GPL-3.0-or-later", null + }, + { + 165, true, "https://spdx.org/licenses/GPL-3.0-only.html#licenseText", + "GNU General Public License v3.0 only", true, "GPL-3.0-only", null + }, + { + 164, true, "https://spdx.org/licenses/GPL-2.0-or-later.html#licenseText", + "GNU General Public License v2.0 or later", true, "GPL-2.0-or-later", null + }, + { + 163, true, "https://spdx.org/licenses/GPL-2.0-only.html#licenseText", + "GNU General Public License v2.0 only", true, "GPL-2.0-only", null + }, + { + 162, false, "https://spdx.org/licenses/GPL-1.0-or-later.html#licenseText", + "GNU General Public License v1.0 or later", false, "GPL-1.0-or-later", null + }, + { + 161, false, "https://spdx.org/licenses/GPL-1.0-only.html#licenseText", + "GNU General Public License v1.0 only", false, "GPL-1.0-only", null + }, + { + 138, true, "https://spdx.org/licenses/EUDatagrid.html#licenseText", "EU DataGrid Software License", + true, "EUDatagrid", null + }, + { + 137, false, "https://spdx.org/licenses/ErlPL-1.1.html#licenseText", "Erlang Public License v1.1", + false, "ErlPL-1.1", null + }, + { + 136, true, "https://spdx.org/licenses/EPL-2.0.html#licenseText", "Eclipse Public License 2.0", true, + "EPL-2.0", null + }, + { + 135, true, "https://spdx.org/licenses/EPL-1.0.html#licenseText", "Eclipse Public License 1.0", true, + "EPL-1.0", null + }, + { + 111, false, "https://spdx.org/licenses/CNRI-Python-GPL-Compatible.html#licenseText", + "CNRI Python Open Source GPL Compatible License Agreement", false, "CNRI-Python-GPL-Compatible", + null + }, + { + 110, false, "https://spdx.org/licenses/CNRI-Python.html#licenseText", "CNRI Python License", true, + "CNRI-Python", null + }, + { + 109, false, "https://spdx.org/licenses/CNRI-Jython.html#licenseText", "CNRI Jython License", false, + "CNRI-Jython", null + }, + { + 108, true, "https://spdx.org/licenses/ClArtistic.html#licenseText", "Clarified Artistic License", + false, "ClArtistic", null + }, + { + 107, false, "https://spdx.org/licenses/CERN-OHL-1.2.html#licenseText", + "CERN Open Hardware Licence v1.2", false, "CERN-OHL-1.2", null + }, + { + 106, false, "https://spdx.org/licenses/CERN-OHL-1.1.html#licenseText", + "CERN Open Hardware License v1.1", false, "CERN-OHL-1.1", null + }, + { + 105, true, "https://spdx.org/licenses/CECILL-C.html#licenseText", + "CeCILL-C Free Software License Agreement", false, "CECILL-C", null + }, + { + 104, true, "https://spdx.org/licenses/CECILL-B.html#licenseText", + "CeCILL-B Free Software License Agreement", false, "CECILL-B", null + }, + { + 103, false, "https://spdx.org/licenses/CECILL-2.1.html#licenseText", + "CeCILL Free Software License Agreement v2.1", true, "CECILL-2.1", null + }, + { + 102, true, "https://spdx.org/licenses/CECILL-2.0.html#licenseText", + "CeCILL Free Software License Agreement v2.0", false, "CECILL-2.0", null + }, + { + 101, false, "https://spdx.org/licenses/CECILL-1.1.html#licenseText", + "CeCILL Free Software License Agreement v1.1", false, "CECILL-1.1", null + }, + { + 100, false, "https://spdx.org/licenses/CECILL-1.0.html#licenseText", + "CeCILL Free Software License Agreement v1.0", false, "CECILL-1.0", null + }, + { + 99, false, "https://spdx.org/licenses/CDLA-Sharing-1.0.html#licenseText", + "Community Data License Agreement Sharing 1.0", false, "CDLA-Sharing-1.0", null + }, + { + 98, false, "https://spdx.org/licenses/CDLA-Permissive-1.0.html#licenseText", + "Community Data License Agreement Permissive 1.0", false, "CDLA-Permissive-1.0", null + }, + { + 97, false, "https://spdx.org/licenses/CDDL-1.1.html#licenseText", + "Common Development and Distribution License 1.1", false, "CDDL-1.1", null + }, + { + 96, true, "https://spdx.org/licenses/CDDL-1.0.html#licenseText", + "Common Development and Distribution License 1.0", true, "CDDL-1.0", null + }, + { + 95, true, "https://spdx.org/licenses/CC0-1.0.html#licenseText", + "Creative Commons Zero v1.0 Universal", false, "CC0-1.0", null + }, + { + 94, true, "https://spdx.org/licenses/CC-BY-SA-4.0.html#licenseText", + "Creative Commons Attribution Share Alike 4.0 International", false, "CC-BY-SA-4.0", null + }, + { + 93, false, "https://spdx.org/licenses/CC-BY-SA-3.0.html#licenseText", + "Creative Commons Attribution Share Alike 3.0 Unported", false, "CC-BY-SA-3.0", null + }, + { + 112, true, "https://spdx.org/licenses/Condor-1.1.html#licenseText", "Condor Public License v1.1", + false, "Condor-1.1", null + }, + { + 91, false, "https://spdx.org/licenses/CC-BY-SA-2.0.html#licenseText", + "Creative Commons Attribution Share Alike 2.0 Generic", false, "CC-BY-SA-2.0", null + }, + { + 113, false, "https://spdx.org/licenses/copyleft-next-0.3.0.html#licenseText", "copyleft-next 0.3.0", + false, "copyleft-next-0.3.0", null + }, + { + 115, true, "https://spdx.org/licenses/CPAL-1.0.html#licenseText", + "Common Public Attribution License 1.0", true, "CPAL-1.0", null + }, + { + 134, false, "https://spdx.org/licenses/Entessa.html#licenseText", "Entessa Public License v1.0", + true, "Entessa", null + }, + { + 133, false, "https://spdx.org/licenses/eGenix.html#licenseText", "eGenix.com Public License 1.1.0", + false, "eGenix", null + }, + { + 132, true, "https://spdx.org/licenses/EFL-2.0.html#licenseText", "Eiffel Forum License v2.0", true, + "EFL-2.0", null + }, + { + 131, false, "https://spdx.org/licenses/EFL-1.0.html#licenseText", "Eiffel Forum License v1.0", true, + "EFL-1.0", null + }, + { + 130, true, "https://spdx.org/licenses/ECL-2.0.html#licenseText", + "Educational Community License v2.0", true, "ECL-2.0", null + }, + { + 129, false, "https://spdx.org/licenses/ECL-1.0.html#licenseText", + "Educational Community License v1.0", true, "ECL-1.0", null + }, + { + 128, false, "https://spdx.org/licenses/dvipdfm.html#licenseText", "dvipdfm License", false, + "dvipdfm", null + }, + { + 127, false, "https://spdx.org/licenses/DSDP.html#licenseText", "DSDP License", false, "DSDP", null + }, + { + 126, false, "https://spdx.org/licenses/Dotseqn.html#licenseText", "Dotseqn License", false, + "Dotseqn", null + }, + { + 125, false, "https://spdx.org/licenses/DOC.html#licenseText", "DOC License", false, "DOC", null + }, + { + 124, false, "https://spdx.org/licenses/diffmark.html#licenseText", "diffmark license", false, + "diffmark", null + }, + { + 123, false, "https://spdx.org/licenses/D-FSL-1.0.html#licenseText", + "Deutsche Freie Software Lizenz", false, "D-FSL-1.0", null + }, + { + 122, false, "https://spdx.org/licenses/curl.html#licenseText", "curl License", false, "curl", null + }, + { + 121, false, "https://spdx.org/licenses/Cube.html#licenseText", "Cube License", false, "Cube", null + }, + { + 120, false, "https://spdx.org/licenses/CUA-OPL-1.0.html#licenseText", + "CUA Office Public License v1.0", true, "CUA-OPL-1.0", null + }, + { + 119, false, "https://spdx.org/licenses/CrystalStacker.html#licenseText", "CrystalStacker License", + false, "CrystalStacker", null + }, + { + 118, false, "https://spdx.org/licenses/Crossword.html#licenseText", "Crossword License", false, + "Crossword", null + }, + { + 117, false, "https://spdx.org/licenses/CPOL-1.02.html#licenseText", + "Code Project Open License 1.02", false, "CPOL-1.02", null + }, + { + 116, true, "https://spdx.org/licenses/CPL-1.0.html#licenseText", "Common Public License 1.0", true, + "CPL-1.0", null + }, + { + 114, false, "https://spdx.org/licenses/copyleft-next-0.3.1.html#licenseText", "copyleft-next 0.3.1", + false, "copyleft-next-0.3.1", null + }, + { + 363, true, "https://spdx.org/licenses/ZPL-2.1.html#licenseText", "Zope Public License 2.1", false, + "ZPL-2.1", null + } + }); migrationBuilder.CreateIndex("IX_Licenses_FsfApproved", "Licenses", "FsfApproved"); @@ -1660,9 +1479,6 @@ namespace Marechai.Database.Migrations migrationBuilder.CreateIndex("IX_Licenses_SPDX", "Licenses", "SPDX"); } - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable("Licenses"); - } + protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.DropTable("Licenses"); } } \ No newline at end of file diff --git a/Marechai.Database/Migrations/20190528222110_MachinePhotoForeignKeys.cs b/Marechai.Database/Migrations/20190528222110_MachinePhotoForeignKeys.cs index 60c8b5c1..dccef1ef 100644 --- a/Marechai.Database/Migrations/20190528222110_MachinePhotoForeignKeys.cs +++ b/Marechai.Database/Migrations/20190528222110_MachinePhotoForeignKeys.cs @@ -4,15 +4,11 @@ namespace Marechai.Database.Migrations { public partial class MachinePhotoForeignKeys : Migration { - protected override void Up(MigrationBuilder migrationBuilder) - { + protected override void Up(MigrationBuilder migrationBuilder) => migrationBuilder.AlterColumn("MachineId", "MachinePhotos", nullable: false, oldClrType: typeof(int), oldNullable: true); - } - protected override void Down(MigrationBuilder migrationBuilder) - { + protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.AlterColumn("MachineId", "MachinePhotos", nullable: true, oldClrType: typeof(int)); - } } } \ No newline at end of file diff --git a/Marechai.Database/Migrations/20190528222220_ChangeMachinePhotoSharpnessTypeToExifType.cs b/Marechai.Database/Migrations/20190528222220_ChangeMachinePhotoSharpnessTypeToExifType.cs index 3ba01d29..96e9f01b 100644 --- a/Marechai.Database/Migrations/20190528222220_ChangeMachinePhotoSharpnessTypeToExifType.cs +++ b/Marechai.Database/Migrations/20190528222220_ChangeMachinePhotoSharpnessTypeToExifType.cs @@ -4,16 +4,12 @@ namespace Marechai.Database.Migrations { public partial class ChangeMachinePhotoSharpnessTypeToExifType : Migration { - protected override void Up(MigrationBuilder migrationBuilder) - { + protected override void Up(MigrationBuilder migrationBuilder) => migrationBuilder.AlterColumn("Sharpness", "MachinePhotos", nullable: true, oldClrType: typeof(string), oldNullable: true); - } - protected override void Down(MigrationBuilder migrationBuilder) - { + protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.AlterColumn("Sharpness", "MachinePhotos", nullable: true, oldClrType: typeof(ushort), oldNullable: true); - } } } \ No newline at end of file diff --git a/Marechai.Database/Migrations/20190528234633_AddMachinePhotoSourceUrl.cs b/Marechai.Database/Migrations/20190528234633_AddMachinePhotoSourceUrl.cs index 6358cc9e..fde8c500 100644 --- a/Marechai.Database/Migrations/20190528234633_AddMachinePhotoSourceUrl.cs +++ b/Marechai.Database/Migrations/20190528234633_AddMachinePhotoSourceUrl.cs @@ -4,14 +4,10 @@ namespace Marechai.Database.Migrations { public partial class AddMachinePhotoSourceUrl : Migration { - protected override void Up(MigrationBuilder migrationBuilder) - { + protected override void Up(MigrationBuilder migrationBuilder) => migrationBuilder.AddColumn("Source", "MachinePhotos", nullable: true); - } - protected override void Down(MigrationBuilder migrationBuilder) - { + protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.DropColumn("Source", "MachinePhotos"); - } } } \ No newline at end of file diff --git a/Marechai.Database/Migrations/20190529194436_AddOwnedMachines.cs b/Marechai.Database/Migrations/20190529194436_AddOwnedMachines.cs index 22959824..6fb65a38 100644 --- a/Marechai.Database/Migrations/20190529194436_AddOwnedMachines.cs +++ b/Marechai.Database/Migrations/20190529194436_AddOwnedMachines.cs @@ -8,183 +8,155 @@ namespace Marechai.Database.Migrations { protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.CreateTable("OwnedMachines", - table => new - { - Id = - table.Column() - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - AcquisitionDate = table.Column(), - LostDate = table.Column(nullable: true), - Status = table.Column(), - LastStatusDate = table.Column(nullable: true), - Trade = table.Column(), - Boxed = table.Column(), - Manuals = table.Column(), - SerialNumber = table.Column(nullable: true), - SerialNumberVisible = - table.Column(nullable: false, defaultValue: true), - MachineId = table.Column(), - UserId = table.Column(nullable: true) - }, constraints: table => - { - table.PrimaryKey("PK_OwnedMachines", x => x.Id); - table.ForeignKey("FK_OwnedMachines_machines_MachineId", x => x.MachineId, - "machines", "id", onDelete: ReferentialAction.Cascade); - table.ForeignKey("FK_OwnedMachines_AspNetUsers_UserId", x => x.UserId, - "AspNetUsers", "Id", onDelete: ReferentialAction.Cascade); - }); + migrationBuilder.CreateTable("OwnedMachines", table => new + { + Id = table.Column(). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + AcquisitionDate = table.Column(), LostDate = table.Column(nullable: true), + Status = table.Column(), LastStatusDate = table.Column(nullable: true), + Trade = table.Column(), Boxed = table.Column(), + Manuals = table.Column(), + SerialNumber = table.Column(nullable: true), + SerialNumberVisible = table.Column(nullable: false, defaultValue: true), + MachineId = table.Column(), UserId = table.Column(nullable: true) + }, constraints: table => + { + table.PrimaryKey("PK_OwnedMachines", x => x.Id); - migrationBuilder.CreateTable("GpusByOwnedMachine", - table => new - { - Id = table.Column() - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - GpuId = table.Column(), - OwnedMachineId = table.Column() - }, constraints: table => - { - table.PrimaryKey("PK_GpusByOwnedMachine", x => x.Id); - table.ForeignKey("FK_GpusByOwnedMachine_gpus_GpuId", x => x.GpuId, "gpus", - "id", onDelete: ReferentialAction.Cascade); - table.ForeignKey("FK_GpusByOwnedMachine_OwnedMachines_OwnedMachineId", - x => x.OwnedMachineId, "OwnedMachines", "Id", - onDelete: ReferentialAction.Cascade); - }); + table.ForeignKey("FK_OwnedMachines_machines_MachineId", x => x.MachineId, "machines", "id", + onDelete: ReferentialAction.Cascade); - migrationBuilder.CreateTable("MemoryByOwnedMachine", - table => new - { - Id = table.Column() - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - OwnedMachineId = table.Column(), - Type = table.Column(), - Usage = table.Column(), - Size = table.Column(), - Speed = table.Column() - }, constraints: table => - { - table.PrimaryKey("PK_MemoryByOwnedMachine", x => x.Id); - table.ForeignKey("FK_MemoryByOwnedMachine_OwnedMachines_OwnedMachineId", - x => x.OwnedMachineId, "OwnedMachines", "Id", - onDelete: ReferentialAction.Cascade); - }); + table.ForeignKey("FK_OwnedMachines_AspNetUsers_UserId", x => x.UserId, "AspNetUsers", "Id", + onDelete: ReferentialAction.Cascade); + }); - migrationBuilder.CreateTable("OwnedMachinePhotos", - table => new - { - Id = table.Column(), - Author = table.Column(nullable: true), - CameraManufacturer = table.Column(nullable: true), - CameraModel = table.Column(nullable: true), - ColorSpace = table.Column(nullable: true), - Comments = table.Column(nullable: true), - Contrast = table.Column(nullable: true), - CreationDate = table.Column(nullable: true), - DigitalZoomRatio = table.Column(nullable: true), - ExifVersion = table.Column(nullable: true), - Exposure = table.Column(nullable: true), - ExposureMethod = table.Column(nullable: true), - ExposureProgram = table.Column(nullable: true), - Flash = table.Column(nullable: true), - Focal = table.Column(nullable: true), - FocalLength = table.Column(nullable: true), - FocalLengthEquivalent = table.Column(nullable: true), - HorizontalResolution = table.Column(nullable: true), - IsoRating = table.Column(nullable: true), - Lens = table.Column(nullable: true), - LightSource = table.Column(nullable: true), - MeteringMode = table.Column(nullable: true), - ResolutionUnit = table.Column(nullable: true), - Orientation = table.Column(nullable: true), - Saturation = table.Column(nullable: true), - SceneCaptureType = table.Column(nullable: true), - SensingMethod = table.Column(nullable: true), - Sharpness = table.Column(nullable: true), - SoftwareUsed = table.Column(nullable: true), - SubjectDistanceRange = table.Column(nullable: true), - UploadDate = - table.Column() - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.ComputedColumn), - VerticalResolution = table.Column(nullable: true), - WhiteBalance = table.Column(nullable: true), - UserId = table.Column(nullable: true), - LicenseId = table.Column(), - OwnedMachineId = table.Column() - }, constraints: table => - { - table.PrimaryKey("PK_OwnedMachinePhotos", x => x.Id); - table.ForeignKey("FK_OwnedMachinePhotos_Licenses_LicenseId", - x => x.LicenseId, "Licenses", "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey("FK_OwnedMachinePhotos_OwnedMachines_OwnedMachineId", - x => x.OwnedMachineId, "OwnedMachines", "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey("FK_OwnedMachinePhotos_AspNetUsers_UserId", x => x.UserId, - "AspNetUsers", "Id", onDelete: ReferentialAction.Cascade); - }); + migrationBuilder.CreateTable("GpusByOwnedMachine", table => new + { + Id = table.Column(). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + GpuId = table.Column(), OwnedMachineId = table.Column() + }, constraints: table => + { + table.PrimaryKey("PK_GpusByOwnedMachine", x => x.Id); - migrationBuilder.CreateTable("ProcessorsByOwnedMachine", - table => new - { - Id = table.Column() - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - ProcessorId = table.Column(), - OwnedMachineId = table.Column(), - Speed = table.Column() - }, constraints: table => - { - table.PrimaryKey("PK_ProcessorsByOwnedMachine", x => x.Id); - table - .ForeignKey("FK_ProcessorsByOwnedMachine_OwnedMachines_OwnedMachineId", - x => x.OwnedMachineId, "OwnedMachines", "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey("FK_ProcessorsByOwnedMachine_processors_ProcessorId", - x => x.ProcessorId, "processors", "id", - onDelete: ReferentialAction.Cascade); - }); + table.ForeignKey("FK_GpusByOwnedMachine_gpus_GpuId", x => x.GpuId, "gpus", "id", + onDelete: ReferentialAction.Cascade); - migrationBuilder.CreateTable("SoundByOwnedMachine", - table => new - { - Id = table.Column() - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - SoundSynthId = table.Column(), - OwnedMachineId = table.Column() - }, constraints: table => - { - table.PrimaryKey("PK_SoundByOwnedMachine", x => x.Id); - table.ForeignKey("FK_SoundByOwnedMachine_OwnedMachines_OwnedMachineId", - x => x.OwnedMachineId, "OwnedMachines", "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey("FK_SoundByOwnedMachine_sound_synths_SoundSynthId", - x => x.SoundSynthId, "sound_synths", "id", - onDelete: ReferentialAction.Cascade); - }); + table.ForeignKey("FK_GpusByOwnedMachine_OwnedMachines_OwnedMachineId", x => x.OwnedMachineId, + "OwnedMachines", "Id", onDelete: ReferentialAction.Cascade); + }); - migrationBuilder.CreateTable("StorageByOwnedMachine", - table => new - { - Id = table.Column() - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - OwnedMachineId = table.Column(), - Type = table.Column(), - Interface = table.Column(), - Capacity = table.Column() - }, constraints: table => - { - table.PrimaryKey("PK_StorageByOwnedMachine", x => x.Id); - table.ForeignKey("FK_StorageByOwnedMachine_OwnedMachines_OwnedMachineId", - x => x.OwnedMachineId, "OwnedMachines", "Id", - onDelete: ReferentialAction.Cascade); - }); + migrationBuilder.CreateTable("MemoryByOwnedMachine", table => new + { + Id = table.Column(). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + OwnedMachineId = table.Column(), Type = table.Column(), Usage = table.Column(), + Size = table.Column(), Speed = table.Column() + }, constraints: table => + { + table.PrimaryKey("PK_MemoryByOwnedMachine", x => x.Id); + + table.ForeignKey("FK_MemoryByOwnedMachine_OwnedMachines_OwnedMachineId", x => x.OwnedMachineId, + "OwnedMachines", "Id", onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable("OwnedMachinePhotos", table => new + { + Id = table.Column(), Author = table.Column(nullable: true), + CameraManufacturer = table.Column(nullable: true), + CameraModel = table.Column(nullable: true), + ColorSpace = table.Column(nullable: true), + Comments = table.Column(nullable: true), + Contrast = table.Column(nullable: true), + CreationDate = table.Column(nullable: true), + DigitalZoomRatio = table.Column(nullable: true), + ExifVersion = table.Column(nullable: true), + Exposure = table.Column(nullable: true), + ExposureMethod = table.Column(nullable: true), + ExposureProgram = table.Column(nullable: true), + Flash = table.Column(nullable: true), + Focal = table.Column(nullable: true), + FocalLength = table.Column(nullable: true), + FocalLengthEquivalent = table.Column(nullable: true), + HorizontalResolution = table.Column(nullable: true), + IsoRating = table.Column(nullable: true), + Lens = table.Column(nullable: true), + LightSource = table.Column(nullable: true), + MeteringMode = table.Column(nullable: true), + ResolutionUnit = table.Column(nullable: true), + Orientation = table.Column(nullable: true), + Saturation = table.Column(nullable: true), + SceneCaptureType = table.Column(nullable: true), + SensingMethod = table.Column(nullable: true), + Sharpness = table.Column(nullable: true), + SoftwareUsed = table.Column(nullable: true), + SubjectDistanceRange = table.Column(nullable: true), + UploadDate = table.Column(). + Annotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.ComputedColumn), + VerticalResolution = table.Column(nullable: true), + WhiteBalance = table.Column(nullable: true), + UserId = table.Column(nullable: true), + LicenseId = table.Column(), OwnedMachineId = table.Column() + }, constraints: table => + { + table.PrimaryKey("PK_OwnedMachinePhotos", x => x.Id); + + table.ForeignKey("FK_OwnedMachinePhotos_Licenses_LicenseId", x => x.LicenseId, "Licenses", "Id", + onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_OwnedMachinePhotos_OwnedMachines_OwnedMachineId", x => x.OwnedMachineId, + "OwnedMachines", "Id", onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_OwnedMachinePhotos_AspNetUsers_UserId", x => x.UserId, "AspNetUsers", "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable("ProcessorsByOwnedMachine", table => new + { + Id = table.Column(). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + ProcessorId = table.Column(), OwnedMachineId = table.Column(), Speed = table.Column() + }, constraints: table => + { + table.PrimaryKey("PK_ProcessorsByOwnedMachine", x => x.Id); + + table.ForeignKey("FK_ProcessorsByOwnedMachine_OwnedMachines_OwnedMachineId", x => x.OwnedMachineId, + "OwnedMachines", "Id", onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_ProcessorsByOwnedMachine_processors_ProcessorId", x => x.ProcessorId, "processors", + "id", onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable("SoundByOwnedMachine", table => new + { + Id = table.Column(). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + SoundSynthId = table.Column(), OwnedMachineId = table.Column() + }, constraints: table => + { + table.PrimaryKey("PK_SoundByOwnedMachine", x => x.Id); + + table.ForeignKey("FK_SoundByOwnedMachine_OwnedMachines_OwnedMachineId", x => x.OwnedMachineId, + "OwnedMachines", "Id", onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_SoundByOwnedMachine_sound_synths_SoundSynthId", x => x.SoundSynthId, + "sound_synths", "id", onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable("StorageByOwnedMachine", table => new + { + Id = table.Column(). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + OwnedMachineId = table.Column(), Type = table.Column(), Interface = table.Column(), + Capacity = table.Column() + }, constraints: table => + { + table.PrimaryKey("PK_StorageByOwnedMachine", x => x.Id); + + table.ForeignKey("FK_StorageByOwnedMachine_OwnedMachines_OwnedMachineId", x => x.OwnedMachineId, + "OwnedMachines", "Id", onDelete: ReferentialAction.Cascade); + }); migrationBuilder.CreateIndex("IX_GpusByOwnedMachine_GpuId", "GpusByOwnedMachine", "GpuId"); @@ -357,91 +329,46 @@ SELECT a.date, a.status, a.trade, a.boxed, a.manuals, a.db_id + 356, @userId FRO migrationBuilder.DropTable("OwnedMachines"); - migrationBuilder.CreateTable("owned_computers", - table => new - { - id = - table.Column("int(11)") - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - boxed = - table.Column("int(11)", nullable: false, - defaultValueSql: "'0'"), - cap1 = - table.Column("int(11)", nullable: false, - defaultValueSql: "'0'"), - cap2 = - table.Column("int(11)", nullable: false, - defaultValueSql: "'0'"), - cpu1 = - table.Column("int(11)", nullable: false, - defaultValueSql: "'0'"), - cpu2 = - table.Column("int(11)", nullable: false, - defaultValueSql: "'0'"), - date = - table.Column("varchar(20)", nullable: false, - defaultValueSql: "''"), - db_id = - table.Column("int(11)", nullable: false, - defaultValueSql: "'0'"), - disk1 = - table.Column("int(11)", nullable: false, - defaultValueSql: "'0'"), - disk2 = - table.Column("int(11)", nullable: false, - defaultValueSql: "'0'"), - manuals = - table.Column("int(11)", nullable: false, - defaultValueSql: "'0'"), - mhz1 = - table.Column("decimal(10,0)", nullable: false, - defaultValueSql: "'0'"), - mhz2 = - table.Column("decimal(10,0)", nullable: false, - defaultValueSql: "'0'"), - ram = - table.Column("int(11)", nullable: false, - defaultValueSql: "'0'"), - rigid = - table.Column("varchar(64)", nullable: false, - defaultValueSql: "''"), - status = - table.Column("int(11)", nullable: false, - defaultValueSql: "'0'"), - trade = table.Column("int(11)", nullable: false, - defaultValueSql: "'0'"), - vram = table.Column("int(11)", nullable: false, - defaultValueSql: "'0'") - }, - constraints: table => { table.PrimaryKey("PK_owned_computers", x => x.id); }); + migrationBuilder.CreateTable("owned_computers", table => new + { + id = table.Column("int(11)"). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + boxed = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + cap1 = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + cap2 = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + cpu1 = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + cpu2 = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + date = table.Column("varchar(20)", nullable: false, defaultValueSql: "''"), + db_id = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + disk1 = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + disk2 = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + manuals = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + mhz1 = table.Column("decimal(10,0)", nullable: false, defaultValueSql: "'0'"), + mhz2 = table.Column("decimal(10,0)", nullable: false, defaultValueSql: "'0'"), + ram = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + rigid = table.Column("varchar(64)", nullable: false, defaultValueSql: "''"), + status = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + trade = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + vram = table.Column("int(11)", nullable: false, defaultValueSql: "'0'") + }, constraints: table => + { + table.PrimaryKey("PK_owned_computers", x => x.id); + }); - migrationBuilder.CreateTable("owned_consoles", - table => new - { - id = - table.Column("int(11)") - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - boxed = - table.Column("int(11)", nullable: false, - defaultValueSql: "'0'"), - date = - table.Column("char(20)", nullable: false, - defaultValueSql: "''"), - db_id = - table.Column("int(11)", nullable: false, - defaultValueSql: "'0'"), - manuals = - table.Column("int(11)", nullable: false, - defaultValueSql: "'0'"), - status = - table.Column("int(11)", nullable: false, - defaultValueSql: "'0'"), - trade = table.Column("int(11)", nullable: false, - defaultValueSql: "'0'") - }, - constraints: table => { table.PrimaryKey("PK_owned_consoles", x => x.id); }); + migrationBuilder.CreateTable("owned_consoles", table => new + { + id = table.Column("int(11)"). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + boxed = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + date = table.Column("char(20)", nullable: false, defaultValueSql: "''"), + db_id = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + manuals = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + status = table.Column("int(11)", nullable: false, defaultValueSql: "'0'"), + trade = table.Column("int(11)", nullable: false, defaultValueSql: "'0'") + }, constraints: table => + { + table.PrimaryKey("PK_owned_consoles", x => x.id); + }); migrationBuilder.CreateIndex("idx_owned_computers_boxed", "owned_computers", "boxed"); diff --git a/Marechai.Database/Migrations/20190601122952_AddScreens.cs b/Marechai.Database/Migrations/20190601122952_AddScreens.cs index 148001c3..d63084e4 100644 --- a/Marechai.Database/Migrations/20190601122952_AddScreens.cs +++ b/Marechai.Database/Migrations/20190601122952_AddScreens.cs @@ -7,62 +7,52 @@ namespace Marechai.Database.Migrations { protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.CreateTable("Screens", - table => new - { - Id = table.Column() - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - Width = table.Column(nullable: true), - Height = table.Column(nullable: true), - Diagonal = table.Column(), - NativeResolutionId = table.Column(), - EffectiveColors = table.Column(nullable: true), - Type = table.Column() - }, constraints: table => - { - table.PrimaryKey("PK_Screens", x => x.Id); - table.ForeignKey("FK_Screens_resolutions_NativeResolutionId", - x => x.NativeResolutionId, "resolutions", "id", - onDelete: ReferentialAction.Cascade); - }); + migrationBuilder.CreateTable("Screens", table => new + { + Id = table.Column(). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Width = table.Column(nullable: true), Height = table.Column(nullable: true), + Diagonal = table.Column(), NativeResolutionId = table.Column(), + EffectiveColors = table.Column(nullable: true), Type = table.Column() + }, constraints: table => + { + table.PrimaryKey("PK_Screens", x => x.Id); - migrationBuilder.CreateTable("ResolutionsByScreen", - table => new - { - Id = table.Column() - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - ScreenId = table.Column(), - ResolutionId = table.Column() - }, constraints: table => - { - table.PrimaryKey("PK_ResolutionsByScreen", x => x.Id); - table.ForeignKey("FK_ResolutionsByScreen_resolutions_ResolutionId", - x => x.ResolutionId, "resolutions", "id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey("FK_ResolutionsByScreen_Screens_ScreenId", - x => x.ScreenId, "Screens", "Id", - onDelete: ReferentialAction.Cascade); - }); + table.ForeignKey("FK_Screens_resolutions_NativeResolutionId", x => x.NativeResolutionId, "resolutions", + "id", onDelete: ReferentialAction.Cascade); + }); - migrationBuilder.CreateTable("ScreensByMachine", - table => new - { - Id = table.Column() - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - ScreenId = table.Column(), - MachineId = table.Column() - }, constraints: table => - { - table.PrimaryKey("PK_ScreensByMachine", x => x.Id); - table.ForeignKey("FK_ScreensByMachine_machines_MachineId", - x => x.MachineId, "machines", "id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey("FK_ScreensByMachine_Screens_ScreenId", x => x.ScreenId, - "Screens", "Id", onDelete: ReferentialAction.Cascade); - }); + migrationBuilder.CreateTable("ResolutionsByScreen", table => new + { + Id = table.Column(). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + ScreenId = table.Column(), ResolutionId = table.Column() + }, constraints: table => + { + table.PrimaryKey("PK_ResolutionsByScreen", x => x.Id); + + table.ForeignKey("FK_ResolutionsByScreen_resolutions_ResolutionId", x => x.ResolutionId, "resolutions", + "id", onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_ResolutionsByScreen_Screens_ScreenId", x => x.ScreenId, "Screens", "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable("ScreensByMachine", table => new + { + Id = table.Column(). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + ScreenId = table.Column(), MachineId = table.Column() + }, constraints: table => + { + table.PrimaryKey("PK_ScreensByMachine", x => x.Id); + + table.ForeignKey("FK_ScreensByMachine_machines_MachineId", x => x.MachineId, "machines", "id", + onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_ScreensByMachine_Screens_ScreenId", x => x.ScreenId, "Screens", "Id", + onDelete: ReferentialAction.Cascade); + }); migrationBuilder.CreateIndex("IX_ResolutionsByScreen_ResolutionId", "ResolutionsByScreen", "ResolutionId"); diff --git a/Marechai.Database/Migrations/20190602021943_AddPerson.cs b/Marechai.Database/Migrations/20190602021943_AddPerson.cs index dd71b51a..039d1dd1 100644 --- a/Marechai.Database/Migrations/20190602021943_AddPerson.cs +++ b/Marechai.Database/Migrations/20190602021943_AddPerson.cs @@ -8,28 +8,22 @@ namespace Marechai.Database.Migrations { protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.CreateTable("People", - table => new - { - Id = table.Column() - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - Name = table.Column(), - Surname = table.Column(), - BirthDate = table.Column(), - DeathDate = table.Column(nullable: true), - Webpage = table.Column(nullable: true), - Twitter = table.Column(nullable: true), - Facebook = table.Column(nullable: true), - Photo = table.Column(), - CountryOfBirthId = table.Column(nullable: true) - }, constraints: table => - { - table.PrimaryKey("PK_People", x => x.Id); - table.ForeignKey("FK_People_iso3166_1_numeric_CountryOfBirthId", - x => x.CountryOfBirthId, "iso3166_1_numeric", "id", - onDelete: ReferentialAction.Restrict); - }); + migrationBuilder.CreateTable("People", table => new + { + Id = table.Column(). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Name = table.Column(), Surname = table.Column(), + BirthDate = table.Column(), + DeathDate = table.Column(nullable: true), Webpage = table.Column(nullable: true), + Twitter = table.Column(nullable: true), Facebook = table.Column(nullable: true), + Photo = table.Column(), CountryOfBirthId = table.Column(nullable: true) + }, constraints: table => + { + table.PrimaryKey("PK_People", x => x.Id); + + table.ForeignKey("FK_People_iso3166_1_numeric_CountryOfBirthId", x => x.CountryOfBirthId, + "iso3166_1_numeric", "id", onDelete: ReferentialAction.Restrict); + }); migrationBuilder.CreateIndex("IX_People_BirthDate", "People", "BirthDate"); @@ -50,9 +44,6 @@ namespace Marechai.Database.Migrations migrationBuilder.CreateIndex("IX_People_Webpage", "People", "Webpage"); } - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable("People"); - } + protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.DropTable("People"); } } \ No newline at end of file diff --git a/Marechai.Database/Migrations/20190603165746_AddIso639.cs b/Marechai.Database/Migrations/20190603165746_AddIso639.cs index 2ff20d5e..2393eceb 100644 --- a/Marechai.Database/Migrations/20190603165746_AddIso639.cs +++ b/Marechai.Database/Migrations/20190603165746_AddIso639.cs @@ -6,18 +6,17 @@ namespace Marechai.Database.Migrations { protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.CreateTable("ISO_639-3", - table => new - { - Id = table.Column("char(3)"), - Part2B = table.Column("char(3)", nullable: true), - Part2T = table.Column("char(3)", nullable: true), - Part1 = table.Column("char(2)", nullable: true), - Scope = table.Column("char(1)"), - Type = table.Column("char(1)"), - Ref_Name = table.Column("varchar(150)"), - Comment = table.Column("varchar(150)", nullable: true) - }, constraints: table => { table.PrimaryKey("PK_ISO_639-3", x => x.Id); }); + migrationBuilder.CreateTable("ISO_639-3", table => new + { + Id = table.Column("char(3)"), Part2B = table.Column("char(3)", nullable: true), + Part2T = table.Column("char(3)", nullable: true), + Part1 = table.Column("char(2)", nullable: true), Scope = table.Column("char(1)"), + Type = table.Column("char(1)"), Ref_Name = table.Column("varchar(150)"), + Comment = table.Column("varchar(150)", nullable: true) + }, constraints: table => + { + table.PrimaryKey("PK_ISO_639-3", x => x.Id); + }); migrationBuilder.CreateIndex("IX_ISO_639-3_Comment", "ISO_639-3", "Comment"); @@ -34,9 +33,6 @@ namespace Marechai.Database.Migrations migrationBuilder.CreateIndex("IX_ISO_639-3_Type", "ISO_639-3", "Type"); } - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable("ISO_639-3"); - } + protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.DropTable("ISO_639-3"); } } \ No newline at end of file diff --git a/Marechai.Database/Migrations/20190605142832_AddPeopleByCompany.cs b/Marechai.Database/Migrations/20190605142832_AddPeopleByCompany.cs index f87f3482..b6756bfc 100644 --- a/Marechai.Database/Migrations/20190605142832_AddPeopleByCompany.cs +++ b/Marechai.Database/Migrations/20190605142832_AddPeopleByCompany.cs @@ -8,66 +8,36 @@ namespace Marechai.Database.Migrations { protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.CreateTable( - name: "PeopleByCompany", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - PersonId = table.Column(nullable: false), - CompanyId = table.Column(nullable: false), - Position = table.Column(nullable: true), - Start = table.Column(nullable: true), - End = table.Column(nullable: true), - Ongoing = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_PeopleByCompany", x => x.Id); - table.ForeignKey( - name: "FK_PeopleByCompany_companies_CompanyId", - column: x => x.CompanyId, - principalTable: "companies", - principalColumn: "id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_PeopleByCompany_People_PersonId", - column: x => x.PersonId, - principalTable: "People", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); + migrationBuilder.CreateTable("PeopleByCompany", table => new + { + Id = table.Column(). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + PersonId = table.Column(), CompanyId = table.Column(), + Position = table.Column(nullable: true), Start = table.Column(nullable: true), + End = table.Column(nullable: true), Ongoing = table.Column() + }, constraints: table => + { + table.PrimaryKey("PK_PeopleByCompany", x => x.Id); - migrationBuilder.CreateIndex( - name: "IX_PeopleByCompany_CompanyId", - table: "PeopleByCompany", - column: "CompanyId"); + table.ForeignKey("FK_PeopleByCompany_companies_CompanyId", x => x.CompanyId, "companies", "id", + onDelete: ReferentialAction.Cascade); - migrationBuilder.CreateIndex( - name: "IX_PeopleByCompany_End", - table: "PeopleByCompany", - column: "End"); + table.ForeignKey("FK_PeopleByCompany_People_PersonId", x => x.PersonId, "People", "Id", + onDelete: ReferentialAction.Cascade); + }); - migrationBuilder.CreateIndex( - name: "IX_PeopleByCompany_PersonId", - table: "PeopleByCompany", - column: "PersonId"); + migrationBuilder.CreateIndex("IX_PeopleByCompany_CompanyId", "PeopleByCompany", "CompanyId"); - migrationBuilder.CreateIndex( - name: "IX_PeopleByCompany_Position", - table: "PeopleByCompany", - column: "Position"); + migrationBuilder.CreateIndex("IX_PeopleByCompany_End", "PeopleByCompany", "End"); - migrationBuilder.CreateIndex( - name: "IX_PeopleByCompany_Start", - table: "PeopleByCompany", - column: "Start"); + migrationBuilder.CreateIndex("IX_PeopleByCompany_PersonId", "PeopleByCompany", "PersonId"); + + migrationBuilder.CreateIndex("IX_PeopleByCompany_Position", "PeopleByCompany", "Position"); + + migrationBuilder.CreateIndex("IX_PeopleByCompany_Start", "PeopleByCompany", "Start"); } - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "PeopleByCompany"); - } + protected override void Down(MigrationBuilder migrationBuilder) => + migrationBuilder.DropTable("PeopleByCompany"); } -} +} \ No newline at end of file diff --git a/Marechai.Database/Migrations/20190616210450_AddDocuments.cs b/Marechai.Database/Migrations/20190616210450_AddDocuments.cs index 9b920437..e3ab9123 100644 --- a/Marechai.Database/Migrations/20190616210450_AddDocuments.cs +++ b/Marechai.Database/Migrations/20190616210450_AddDocuments.cs @@ -8,24 +8,20 @@ namespace Marechai.Database.Migrations { protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.CreateTable("Documents", - table => new - { - Id = table.Column() - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - Title = table.Column(), - NativeTitle = table.Column(nullable: true), - Published = table.Column(nullable: true), - CountryId = table.Column(nullable: true), - Synopsis = table.Column(maxLength: 262144, nullable: true) - }, constraints: table => - { - table.PrimaryKey("PK_Documents", x => x.Id); - table.ForeignKey("FK_Documents_iso3166_1_numeric_CountryId", - x => x.CountryId, "iso3166_1_numeric", "id", - onDelete: ReferentialAction.Restrict); - }); + migrationBuilder.CreateTable("Documents", table => new + { + Id = table.Column(). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Title = table.Column(), NativeTitle = table.Column(nullable: true), + Published = table.Column(nullable: true), CountryId = table.Column(nullable: true), + Synopsis = table.Column(maxLength: 262144, nullable: true) + }, constraints: table => + { + table.PrimaryKey("PK_Documents", x => x.Id); + + table.ForeignKey("FK_Documents_iso3166_1_numeric_CountryId", x => x.CountryId, "iso3166_1_numeric", + "id", onDelete: ReferentialAction.Restrict); + }); migrationBuilder.CreateIndex("IX_Documents_CountryId", "Documents", "CountryId"); @@ -33,15 +29,12 @@ namespace Marechai.Database.Migrations migrationBuilder.CreateIndex("IX_Documents_Published", "Documents", "Published"); - migrationBuilder.CreateIndex("IX_Documents_Synopsis", "Documents", "Synopsis") - .Annotation("MySql:FullTextIndex", true); + migrationBuilder.CreateIndex("IX_Documents_Synopsis", "Documents", "Synopsis"). + Annotation("MySql:FullTextIndex", true); migrationBuilder.CreateIndex("IX_Documents_Title", "Documents", "Title"); } - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable("Documents"); - } + protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.DropTable("Documents"); } } \ No newline at end of file diff --git a/Marechai.Database/Migrations/20190616211045_AddDocumentRoles.cs b/Marechai.Database/Migrations/20190616211045_AddDocumentRoles.cs index e43d03a1..92ed550a 100644 --- a/Marechai.Database/Migrations/20190616211045_AddDocumentRoles.cs +++ b/Marechai.Database/Migrations/20190616211045_AddDocumentRoles.cs @@ -6,174 +6,840 @@ namespace Marechai.Database.Migrations { protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.CreateTable("DocumentRoles", - table => new - { - Id = table.Column("char(3)"), - Name = table.Column(nullable: true), - Enabled = table.Column(nullable: false, defaultValue: true) - }, - constraints: table => { table.PrimaryKey("PK_DocumentRoles", x => x.Id); }); + migrationBuilder.CreateTable("DocumentRoles", table => new + { + Id = table.Column("char(3)"), Name = table.Column(nullable: true), + Enabled = table.Column(nullable: false, defaultValue: true) + }, constraints: table => + { + table.PrimaryKey("PK_DocumentRoles", x => x.Id); + }); - migrationBuilder.InsertData("DocumentRoles", new[] {"Id", "Enabled", "Name"}, - new object[,] - { - {"abr", true, "Abridger"}, {"orm", true, "Organizer"}, - {"osp", true, "Onscreen presenter"}, {"oth", true, "Other"}, - {"own", true, "Owner"}, {"pan", true, "Panelist"}, - {"pat", true, "Patron"}, {"pbd", true, "Publishing director"}, - {"pbl", true, "Publisher"}, {"pdr", true, "Project director"}, - {"pfr", true, "Proofreader"}, {"pht", true, "Photographer"}, - {"plt", true, "Platemaker"}, {"pma", true, "Permitting agency"}, - {"pmn", true, "Production manager"}, {"org", true, "Originator"}, - {"pop", true, "Printer of plates"}, {"ppt", true, "Puppeteer"}, - {"pra", true, "Praeses"}, {"prc", true, "Process contact"}, - {"prd", true, "Production personnel"}, {"pre", true, "Presenter"}, - {"prf", true, "Performer"}, {"prg", true, "Programmer"}, - {"prm", true, "Printmaker"}, {"prn", true, "Production company"}, - {"pro", true, "Producer"}, {"prp", true, "Production place"}, - {"prs", true, "Production designer"}, {"prt", true, "Printer"}, - {"prv", true, "Provider"}, {"ppm", true, "Papermaker"}, - {"pta", true, "Patent applicant"}, {"opn", true, "Opponent"}, - {"mus", true, "Musician"}, {"jug", true, "Jurisdiction governed"}, - {"lbr", true, "Laboratory"}, {"lbt", true, "Librettist"}, - {"ldr", true, "Laboratory director"}, {"led", true, "Lead"}, - {"lee", true, "Libelee-appellee"}, {"lel", true, "Libelee"}, - {"len", true, "Lender"}, {"let", true, "Libelee-appellant"}, - {"lgd", true, "Lighting designer"}, {"lie", true, "Libelant-appellee"}, - {"lil", true, "Libelant"}, {"lit", true, "Libelant-appellant"}, - {"lsa", true, "Landscape architect"}, {"nrt", true, "Narrator"}, - {"lse", true, "Licensee"}, {"ltg", true, "Lithographer"}, - {"lyr", true, "Lyricist"}, {"mcp", true, "Music copyist"}, - {"mdc", true, "Metadata contact"}, {"med", true, "Medium"}, - {"mfp", true, "Manufacture place"}, {"mfr", true, "Manufacturer"}, - {"mod", true, "Moderator"}, {"mon", true, "Monitor"}, - {"mrb", true, "Marbler"}, {"mrk", true, "Markup editor"}, - {"msd", true, "Musical director"}, {"mte", true, "Metal-engraver"}, - {"mtk", true, "Minute taker"}, {"lso", true, "Licensor"}, - {"jud", true, "Judge"}, {"pte", true, "Plaintiff-appellee"}, - {"pth", true, "Patent holder"}, {"spn", true, "Sponsor"}, - {"spy", true, "Second party"}, {"srv", true, "Surveyor"}, - {"std", true, "Set designer"}, {"stg", true, "Setting"}, - {"stl", true, "Storyteller"}, {"stm", true, "Stage manager"}, - {"stn", true, "Standards body"}, {"str", true, "Stereotyper"}, - {"tcd", true, "Technical director"}, {"tch", true, "Teacher"}, - {"ths", true, "Thesis advisor"}, {"tld", true, "Television director"}, - {"tlp", true, "Television producer"}, {"spk", true, "Speaker"}, - {"trc", true, "Transcriber"}, {"tyd", true, "Type designer"}, - {"tyg", true, "Typographer"}, {"uvp", true, "University place"}, - {"vac", true, "Voice actor"}, {"vdg", true, "Videographer"}, - {"voc", false, "Vocalist"}, {"wac", true, "Writer of added commentary"}, - {"wal", true, "Writer of added lyrics"}, - {"wam", true, "Writer of accompanying material"}, - {"wat", true, "Writer of added text"}, {"wdc", true, "Woodcutter"}, - {"wde", true, "Wood engraver"}, {"win", true, "Writer of introduction"}, - {"wit", true, "Witness"}, {"trl", true, "Translator"}, - {"ptf", true, "Plaintiff"}, {"sng", true, "Singer"}, - {"sht", true, "Supporting host"}, {"ptt", true, "Plaintiff-appellant"}, - {"pup", true, "Publication place"}, {"rbr", true, "Rubricator"}, - {"rcd", true, "Recordist"}, {"rce", true, "Recording engineer"}, - {"rcp", true, "Addressee"}, {"rdd", true, "Radio director"}, - {"red", true, "Redaktor"}, {"ren", true, "Renderer"}, - {"res", true, "Researcher"}, {"rev", true, "Reviewer"}, - {"rpc", true, "Radio producer"}, {"rps", true, "Repository"}, - {"rpt", true, "Reporter"}, {"sll", true, "Seller"}, - {"rpy", true, "Responsible party"}, {"rsg", true, "Restager"}, - {"rsp", true, "Respondent"}, {"rsr", true, "Restorationist"}, - {"rst", true, "Respondent-appellant"}, - {"rth", true, "Research team head"}, - {"rtm", true, "Research team member"}, - {"sad", true, "Scientific advisor"}, {"sce", true, "Scenarist"}, - {"scl", true, "Sculptor"}, {"scr", true, "Scribe"}, - {"sds", true, "Sound designer"}, {"sec", true, "Secretary"}, - {"sgd", true, "Stage director"}, {"sgn", true, "Signer"}, - {"rse", true, "Respondent-appellee"}, - {"wpr", true, "Writer of preface"}, {"ivr", true, "Interviewer"}, - {"itr", true, "Instrumentalist"}, {"brl", true, "Braille embosser"}, - {"bsl", true, "Bookseller"}, {"cas", true, "Caster"}, - {"ccp", true, "Conceptor"}, {"chr", true, "Choreographer"}, - {"clb", false, "Collaborator"}, {"cli", true, "Client"}, - {"cll", true, "Calligrapher"}, {"clr", true, "Colorist"}, - {"clt", true, "Collotyper"}, {"cmm", true, "Commentator"}, - {"cmp", true, "Composer"}, {"cmt", true, "Compositor"}, - {"cnd", true, "Conductor"}, {"brd", true, "Broadcaster"}, - {"cng", true, "Cinematographer"}, {"coe", true, "Contestant-appellee"}, - {"col", true, "Collector"}, {"com", true, "Compiler"}, - {"con", true, "Conservator"}, {"cor", true, "Collection registrar"}, - {"cos", true, "Contestant"}, {"cot", true, "Contestant-appellant"}, - {"cou", true, "Court governed"}, {"cov", true, "Cover designer"}, - {"cpc", true, "Copyright claimant"}, - {"cpe", true, "Complainant-appellee"}, - {"cph", true, "Copyright holder"}, {"cpl", true, "Complainant"}, - {"cpt", true, "Complainant-appellant"}, {"cns", true, "Censor"}, - {"cre", true, "Creator"}, {"bpd", true, "Bookplate designer"}, - {"blw", true, "Blurb writer"}, {"acp", true, "Art copyist"}, - {"act", true, "Actor"}, {"adi", true, "Art director"}, - {"adp", true, "Adapter"}, - {"aft", true, "Author of afterword, colophon, etc."}, - {"anl", true, "Analyst"}, {"anm", true, "Animator"}, - {"ann", true, "Annotator"}, {"ant", true, "Bibliographic antecedent"}, - {"ape", true, "Appellee"}, {"apl", true, "Appellant"}, - {"app", true, "Applicant"}, - {"aqt", true, "Author in quotations or text abstracts"}, - {"arc", true, "Architect"}, {"bnd", true, "Binder"}, - {"ard", true, "Artistic director"}, {"art", true, "Artist"}, - {"asg", true, "Assignee"}, {"asn", true, "Associated name"}, - {"ato", true, "Autographer"}, {"att", true, "Attributed name"}, - {"auc", true, "Auctioneer"}, {"aud", true, "Author of dialog"}, - {"aui", true, "Author of introduction, etc."}, - {"aus", true, "Screenwriter"}, {"aut", true, "Author"}, - {"bdd", true, "Binding designer"}, {"bjd", true, "Bookjacket designer"}, - {"bkd", true, "Book designer"}, {"bkp", true, "Book producer"}, - {"arr", true, "Arranger"}, {"ive", true, "Interviewee"}, - {"crp", true, "Correspondent"}, {"crt", true, "Court reporter"}, - {"edt", true, "Editor"}, {"egr", true, "Engraver"}, - {"elg", true, "Electrician"}, {"elt", true, "Electrotyper"}, - {"eng", true, "Engineer"}, {"enj", true, "Enacting jurisdiction"}, - {"etr", true, "Etcher"}, {"evp", true, "Event place"}, - {"exp", true, "Expert"}, {"fac", true, "Facsimilist"}, - {"fds", true, "Film distributor"}, {"fld", true, "Field director"}, - {"flm", true, "Film editor"}, {"fmd", true, "Film director"}, - {"edm", true, "Editor of moving image work"}, - {"fmk", true, "Filmmaker"}, {"fmp", true, "Film producer"}, - {"fnd", true, "Funder"}, {"fpy", true, "First party"}, - {"frg", true, "Forger"}, - {"gis", true, "Geographic information specialist"}, - {"grt", false, "Graphic technician"}, {"his", true, "Host institution"}, - {"hnr", true, "Honoree"}, {"hst", true, "Host"}, - {"ill", true, "Illustrator"}, {"ilu", true, "Illuminator"}, - {"ins", true, "Inscriber"}, {"inv", true, "Inventor"}, - {"isb", true, "Issuing body"}, {"fmo", true, "Former owner"}, - {"crr", true, "Corrector"}, {"edc", true, "Editor of compilation"}, - {"dto", true, "Dedicator"}, {"csl", true, "Consultant"}, - {"csp", true, "Consultant to a project"}, - {"cst", true, "Costume designer"}, {"ctb", true, "Contributor"}, - {"cte", true, "Contestee-appellee"}, {"ctg", true, "Cartographer"}, - {"ctr", true, "Contractor"}, {"cts", true, "Contestee"}, - {"ctt", true, "Contestee-appellant"}, {"cur", true, "Curator"}, - {"cwt", true, "Commentator for written text"}, - {"dbp", true, "Distribution place"}, {"dfd", true, "Defendant"}, - {"dfe", true, "Defendant-appellee"}, {"dub", true, "Dubious author"}, - {"dft", true, "Defendant-appellant"}, - {"dgs", true, "Degree supervisor"}, {"dis", true, "Dissertant"}, - {"dln", true, "Delineator"}, {"dnc", true, "Dancer"}, - {"dnr", true, "Donor"}, {"dpc", true, "Depicted"}, - {"dpt", true, "Depositor"}, {"drm", true, "Draftsman"}, - {"drt", true, "Director"}, {"dsr", true, "Designer"}, - {"dst", true, "Distributor"}, {"dtc", true, "Data contributor"}, - {"dte", true, "Dedicatee"}, {"dtm", true, "Data manager"}, - {"dgg", true, "Degree granting institution"}, - {"wst", true, "Writer of supplementary textual content"} - }); + migrationBuilder.InsertData("DocumentRoles", new[] + { + "Id", "Enabled", "Name" + }, new object[,] + { + { + "abr", true, "Abridger" + }, + { + "orm", true, "Organizer" + }, + { + "osp", true, "Onscreen presenter" + }, + { + "oth", true, "Other" + }, + { + "own", true, "Owner" + }, + { + "pan", true, "Panelist" + }, + { + "pat", true, "Patron" + }, + { + "pbd", true, "Publishing director" + }, + { + "pbl", true, "Publisher" + }, + { + "pdr", true, "Project director" + }, + { + "pfr", true, "Proofreader" + }, + { + "pht", true, "Photographer" + }, + { + "plt", true, "Platemaker" + }, + { + "pma", true, "Permitting agency" + }, + { + "pmn", true, "Production manager" + }, + { + "org", true, "Originator" + }, + { + "pop", true, "Printer of plates" + }, + { + "ppt", true, "Puppeteer" + }, + { + "pra", true, "Praeses" + }, + { + "prc", true, "Process contact" + }, + { + "prd", true, "Production personnel" + }, + { + "pre", true, "Presenter" + }, + { + "prf", true, "Performer" + }, + { + "prg", true, "Programmer" + }, + { + "prm", true, "Printmaker" + }, + { + "prn", true, "Production company" + }, + { + "pro", true, "Producer" + }, + { + "prp", true, "Production place" + }, + { + "prs", true, "Production designer" + }, + { + "prt", true, "Printer" + }, + { + "prv", true, "Provider" + }, + { + "ppm", true, "Papermaker" + }, + { + "pta", true, "Patent applicant" + }, + { + "opn", true, "Opponent" + }, + { + "mus", true, "Musician" + }, + { + "jug", true, "Jurisdiction governed" + }, + { + "lbr", true, "Laboratory" + }, + { + "lbt", true, "Librettist" + }, + { + "ldr", true, "Laboratory director" + }, + { + "led", true, "Lead" + }, + { + "lee", true, "Libelee-appellee" + }, + { + "lel", true, "Libelee" + }, + { + "len", true, "Lender" + }, + { + "let", true, "Libelee-appellant" + }, + { + "lgd", true, "Lighting designer" + }, + { + "lie", true, "Libelant-appellee" + }, + { + "lil", true, "Libelant" + }, + { + "lit", true, "Libelant-appellant" + }, + { + "lsa", true, "Landscape architect" + }, + { + "nrt", true, "Narrator" + }, + { + "lse", true, "Licensee" + }, + { + "ltg", true, "Lithographer" + }, + { + "lyr", true, "Lyricist" + }, + { + "mcp", true, "Music copyist" + }, + { + "mdc", true, "Metadata contact" + }, + { + "med", true, "Medium" + }, + { + "mfp", true, "Manufacture place" + }, + { + "mfr", true, "Manufacturer" + }, + { + "mod", true, "Moderator" + }, + { + "mon", true, "Monitor" + }, + { + "mrb", true, "Marbler" + }, + { + "mrk", true, "Markup editor" + }, + { + "msd", true, "Musical director" + }, + { + "mte", true, "Metal-engraver" + }, + { + "mtk", true, "Minute taker" + }, + { + "lso", true, "Licensor" + }, + { + "jud", true, "Judge" + }, + { + "pte", true, "Plaintiff-appellee" + }, + { + "pth", true, "Patent holder" + }, + { + "spn", true, "Sponsor" + }, + { + "spy", true, "Second party" + }, + { + "srv", true, "Surveyor" + }, + { + "std", true, "Set designer" + }, + { + "stg", true, "Setting" + }, + { + "stl", true, "Storyteller" + }, + { + "stm", true, "Stage manager" + }, + { + "stn", true, "Standards body" + }, + { + "str", true, "Stereotyper" + }, + { + "tcd", true, "Technical director" + }, + { + "tch", true, "Teacher" + }, + { + "ths", true, "Thesis advisor" + }, + { + "tld", true, "Television director" + }, + { + "tlp", true, "Television producer" + }, + { + "spk", true, "Speaker" + }, + { + "trc", true, "Transcriber" + }, + { + "tyd", true, "Type designer" + }, + { + "tyg", true, "Typographer" + }, + { + "uvp", true, "University place" + }, + { + "vac", true, "Voice actor" + }, + { + "vdg", true, "Videographer" + }, + { + "voc", false, "Vocalist" + }, + { + "wac", true, "Writer of added commentary" + }, + { + "wal", true, "Writer of added lyrics" + }, + { + "wam", true, "Writer of accompanying material" + }, + { + "wat", true, "Writer of added text" + }, + { + "wdc", true, "Woodcutter" + }, + { + "wde", true, "Wood engraver" + }, + { + "win", true, "Writer of introduction" + }, + { + "wit", true, "Witness" + }, + { + "trl", true, "Translator" + }, + { + "ptf", true, "Plaintiff" + }, + { + "sng", true, "Singer" + }, + { + "sht", true, "Supporting host" + }, + { + "ptt", true, "Plaintiff-appellant" + }, + { + "pup", true, "Publication place" + }, + { + "rbr", true, "Rubricator" + }, + { + "rcd", true, "Recordist" + }, + { + "rce", true, "Recording engineer" + }, + { + "rcp", true, "Addressee" + }, + { + "rdd", true, "Radio director" + }, + { + "red", true, "Redaktor" + }, + { + "ren", true, "Renderer" + }, + { + "res", true, "Researcher" + }, + { + "rev", true, "Reviewer" + }, + { + "rpc", true, "Radio producer" + }, + { + "rps", true, "Repository" + }, + { + "rpt", true, "Reporter" + }, + { + "sll", true, "Seller" + }, + { + "rpy", true, "Responsible party" + }, + { + "rsg", true, "Restager" + }, + { + "rsp", true, "Respondent" + }, + { + "rsr", true, "Restorationist" + }, + { + "rst", true, "Respondent-appellant" + }, + { + "rth", true, "Research team head" + }, + { + "rtm", true, "Research team member" + }, + { + "sad", true, "Scientific advisor" + }, + { + "sce", true, "Scenarist" + }, + { + "scl", true, "Sculptor" + }, + { + "scr", true, "Scribe" + }, + { + "sds", true, "Sound designer" + }, + { + "sec", true, "Secretary" + }, + { + "sgd", true, "Stage director" + }, + { + "sgn", true, "Signer" + }, + { + "rse", true, "Respondent-appellee" + }, + { + "wpr", true, "Writer of preface" + }, + { + "ivr", true, "Interviewer" + }, + { + "itr", true, "Instrumentalist" + }, + { + "brl", true, "Braille embosser" + }, + { + "bsl", true, "Bookseller" + }, + { + "cas", true, "Caster" + }, + { + "ccp", true, "Conceptor" + }, + { + "chr", true, "Choreographer" + }, + { + "clb", false, "Collaborator" + }, + { + "cli", true, "Client" + }, + { + "cll", true, "Calligrapher" + }, + { + "clr", true, "Colorist" + }, + { + "clt", true, "Collotyper" + }, + { + "cmm", true, "Commentator" + }, + { + "cmp", true, "Composer" + }, + { + "cmt", true, "Compositor" + }, + { + "cnd", true, "Conductor" + }, + { + "brd", true, "Broadcaster" + }, + { + "cng", true, "Cinematographer" + }, + { + "coe", true, "Contestant-appellee" + }, + { + "col", true, "Collector" + }, + { + "com", true, "Compiler" + }, + { + "con", true, "Conservator" + }, + { + "cor", true, "Collection registrar" + }, + { + "cos", true, "Contestant" + }, + { + "cot", true, "Contestant-appellant" + }, + { + "cou", true, "Court governed" + }, + { + "cov", true, "Cover designer" + }, + { + "cpc", true, "Copyright claimant" + }, + { + "cpe", true, "Complainant-appellee" + }, + { + "cph", true, "Copyright holder" + }, + { + "cpl", true, "Complainant" + }, + { + "cpt", true, "Complainant-appellant" + }, + { + "cns", true, "Censor" + }, + { + "cre", true, "Creator" + }, + { + "bpd", true, "Bookplate designer" + }, + { + "blw", true, "Blurb writer" + }, + { + "acp", true, "Art copyist" + }, + { + "act", true, "Actor" + }, + { + "adi", true, "Art director" + }, + { + "adp", true, "Adapter" + }, + { + "aft", true, "Author of afterword, colophon, etc." + }, + { + "anl", true, "Analyst" + }, + { + "anm", true, "Animator" + }, + { + "ann", true, "Annotator" + }, + { + "ant", true, "Bibliographic antecedent" + }, + { + "ape", true, "Appellee" + }, + { + "apl", true, "Appellant" + }, + { + "app", true, "Applicant" + }, + { + "aqt", true, "Author in quotations or text abstracts" + }, + { + "arc", true, "Architect" + }, + { + "bnd", true, "Binder" + }, + { + "ard", true, "Artistic director" + }, + { + "art", true, "Artist" + }, + { + "asg", true, "Assignee" + }, + { + "asn", true, "Associated name" + }, + { + "ato", true, "Autographer" + }, + { + "att", true, "Attributed name" + }, + { + "auc", true, "Auctioneer" + }, + { + "aud", true, "Author of dialog" + }, + { + "aui", true, "Author of introduction, etc." + }, + { + "aus", true, "Screenwriter" + }, + { + "aut", true, "Author" + }, + { + "bdd", true, "Binding designer" + }, + { + "bjd", true, "Bookjacket designer" + }, + { + "bkd", true, "Book designer" + }, + { + "bkp", true, "Book producer" + }, + { + "arr", true, "Arranger" + }, + { + "ive", true, "Interviewee" + }, + { + "crp", true, "Correspondent" + }, + { + "crt", true, "Court reporter" + }, + { + "edt", true, "Editor" + }, + { + "egr", true, "Engraver" + }, + { + "elg", true, "Electrician" + }, + { + "elt", true, "Electrotyper" + }, + { + "eng", true, "Engineer" + }, + { + "enj", true, "Enacting jurisdiction" + }, + { + "etr", true, "Etcher" + }, + { + "evp", true, "Event place" + }, + { + "exp", true, "Expert" + }, + { + "fac", true, "Facsimilist" + }, + { + "fds", true, "Film distributor" + }, + { + "fld", true, "Field director" + }, + { + "flm", true, "Film editor" + }, + { + "fmd", true, "Film director" + }, + { + "edm", true, "Editor of moving image work" + }, + { + "fmk", true, "Filmmaker" + }, + { + "fmp", true, "Film producer" + }, + { + "fnd", true, "Funder" + }, + { + "fpy", true, "First party" + }, + { + "frg", true, "Forger" + }, + { + "gis", true, "Geographic information specialist" + }, + { + "grt", false, "Graphic technician" + }, + { + "his", true, "Host institution" + }, + { + "hnr", true, "Honoree" + }, + { + "hst", true, "Host" + }, + { + "ill", true, "Illustrator" + }, + { + "ilu", true, "Illuminator" + }, + { + "ins", true, "Inscriber" + }, + { + "inv", true, "Inventor" + }, + { + "isb", true, "Issuing body" + }, + { + "fmo", true, "Former owner" + }, + { + "crr", true, "Corrector" + }, + { + "edc", true, "Editor of compilation" + }, + { + "dto", true, "Dedicator" + }, + { + "csl", true, "Consultant" + }, + { + "csp", true, "Consultant to a project" + }, + { + "cst", true, "Costume designer" + }, + { + "ctb", true, "Contributor" + }, + { + "cte", true, "Contestee-appellee" + }, + { + "ctg", true, "Cartographer" + }, + { + "ctr", true, "Contractor" + }, + { + "cts", true, "Contestee" + }, + { + "ctt", true, "Contestee-appellant" + }, + { + "cur", true, "Curator" + }, + { + "cwt", true, "Commentator for written text" + }, + { + "dbp", true, "Distribution place" + }, + { + "dfd", true, "Defendant" + }, + { + "dfe", true, "Defendant-appellee" + }, + { + "dub", true, "Dubious author" + }, + { + "dft", true, "Defendant-appellant" + }, + { + "dgs", true, "Degree supervisor" + }, + { + "dis", true, "Dissertant" + }, + { + "dln", true, "Delineator" + }, + { + "dnc", true, "Dancer" + }, + { + "dnr", true, "Donor" + }, + { + "dpc", true, "Depicted" + }, + { + "dpt", true, "Depositor" + }, + { + "drm", true, "Draftsman" + }, + { + "drt", true, "Director" + }, + { + "dsr", true, "Designer" + }, + { + "dst", true, "Distributor" + }, + { + "dtc", true, "Data contributor" + }, + { + "dte", true, "Dedicatee" + }, + { + "dtm", true, "Data manager" + }, + { + "dgg", true, "Degree granting institution" + }, + { + "wst", true, "Writer of supplementary textual content" + } + }); migrationBuilder.CreateIndex("IX_DocumentRoles_Enabled", "DocumentRoles", "Enabled"); migrationBuilder.CreateIndex("IX_DocumentRoles_Name", "DocumentRoles", "Name"); } - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable("DocumentRoles"); - } + protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.DropTable("DocumentRoles"); } } \ No newline at end of file diff --git a/Marechai.Database/Migrations/20190616232349_AddDocumentPeople.cs b/Marechai.Database/Migrations/20190616232349_AddDocumentPeople.cs index 3b436e63..de26da8c 100644 --- a/Marechai.Database/Migrations/20190616232349_AddDocumentPeople.cs +++ b/Marechai.Database/Migrations/20190616232349_AddDocumentPeople.cs @@ -9,21 +9,19 @@ namespace Marechai.Database.Migrations { migrationBuilder.AddColumn("DocumentPersonId", "People", nullable: true); - migrationBuilder.CreateTable("DocumentPeople", - table => new - { - Id = table.Column() - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - Name = table.Column(), - Surname = table.Column(), - PersonId = table.Column(nullable: true) - }, constraints: table => - { - table.PrimaryKey("PK_DocumentPeople", x => x.Id); - table.ForeignKey("FK_DocumentPeople_People_PersonId", x => x.PersonId, - "People", "Id", onDelete: ReferentialAction.SetNull); - }); + migrationBuilder.CreateTable("DocumentPeople", table => new + { + Id = table.Column(). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Name = table.Column(), Surname = table.Column(), + PersonId = table.Column(nullable: true) + }, constraints: table => + { + table.PrimaryKey("PK_DocumentPeople", x => x.Id); + + table.ForeignKey("FK_DocumentPeople_People_PersonId", x => x.PersonId, "People", "Id", + onDelete: ReferentialAction.SetNull); + }); migrationBuilder.CreateIndex("IX_DocumentPeople_Name", "DocumentPeople", "Name"); diff --git a/Marechai.Database/Migrations/20190616233045_AddPeopleByDocument.cs b/Marechai.Database/Migrations/20190616233045_AddPeopleByDocument.cs index c8304bc8..9056aecc 100644 --- a/Marechai.Database/Migrations/20190616233045_AddPeopleByDocument.cs +++ b/Marechai.Database/Migrations/20190616233045_AddPeopleByDocument.cs @@ -7,28 +7,25 @@ namespace Marechai.Database.Migrations { protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.CreateTable("PeopleByDocuments", - table => new - { - Id = table.Column() - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - PersonId = table.Column(), - DocumentId = table.Column(), - RoleId = table.Column("char(3)") - }, constraints: table => - { - table.PrimaryKey("PK_PeopleByDocuments", x => x.Id); - table.ForeignKey("FK_PeopleByDocuments_Documents_DocumentId", - x => x.DocumentId, "Documents", "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey("FK_PeopleByDocuments_DocumentPeople_PersonId", - x => x.PersonId, "DocumentPeople", "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey("FK_PeopleByDocuments_DocumentRoles_RoleId", - x => x.RoleId, "DocumentRoles", "Id", - onDelete: ReferentialAction.Cascade); - }); + migrationBuilder.CreateTable("PeopleByDocuments", table => new + { + Id = table.Column(). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + PersonId = table.Column(), DocumentId = table.Column(), + RoleId = table.Column("char(3)") + }, constraints: table => + { + table.PrimaryKey("PK_PeopleByDocuments", x => x.Id); + + table.ForeignKey("FK_PeopleByDocuments_Documents_DocumentId", x => x.DocumentId, "Documents", "Id", + onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_PeopleByDocuments_DocumentPeople_PersonId", x => x.PersonId, "DocumentPeople", + "Id", onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_PeopleByDocuments_DocumentRoles_RoleId", x => x.RoleId, "DocumentRoles", "Id", + onDelete: ReferentialAction.Cascade); + }); migrationBuilder.CreateIndex("IX_PeopleByDocuments_DocumentId", "PeopleByDocuments", "DocumentId"); @@ -37,9 +34,7 @@ namespace Marechai.Database.Migrations migrationBuilder.CreateIndex("IX_PeopleByDocuments_RoleId", "PeopleByDocuments", "RoleId"); } - protected override void Down(MigrationBuilder migrationBuilder) - { + protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.DropTable("PeopleByDocuments"); - } } } \ No newline at end of file diff --git a/Marechai.Database/Migrations/20190616233807_AddDocumentCompany.cs b/Marechai.Database/Migrations/20190616233807_AddDocumentCompany.cs index 64e4eb39..20eff1c2 100644 --- a/Marechai.Database/Migrations/20190616233807_AddDocumentCompany.cs +++ b/Marechai.Database/Migrations/20190616233807_AddDocumentCompany.cs @@ -9,19 +9,15 @@ namespace Marechai.Database.Migrations { migrationBuilder.AddColumn("DocumentCompanyId", "companies", nullable: true); - migrationBuilder.CreateTable("DocumentCompanies", - table => new - { - Id = table.Column() - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - Name = table.Column(), - CompanyId = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_DocumentCompanies", x => x.Id); - }); + migrationBuilder.CreateTable("DocumentCompanies", table => new + { + Id = table.Column(). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Name = table.Column(), CompanyId = table.Column(nullable: true) + }, constraints: table => + { + table.PrimaryKey("PK_DocumentCompanies", x => x.Id); + }); migrationBuilder.CreateIndex("IX_companies_DocumentCompanyId", "companies", "DocumentCompanyId", unique: true); diff --git a/Marechai.Database/Migrations/20190616234431_AddCompaniesByDocument.cs b/Marechai.Database/Migrations/20190616234431_AddCompaniesByDocument.cs index efd78134..d60e6bf6 100644 --- a/Marechai.Database/Migrations/20190616234431_AddCompaniesByDocument.cs +++ b/Marechai.Database/Migrations/20190616234431_AddCompaniesByDocument.cs @@ -7,28 +7,25 @@ namespace Marechai.Database.Migrations { protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.CreateTable("CompaniesByDocuments", - table => new - { - Id = table.Column() - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - CompanyId = table.Column(), - DocumentId = table.Column(), - RoleId = table.Column("char(3)") - }, constraints: table => - { - table.PrimaryKey("PK_CompaniesByDocuments", x => x.Id); - table.ForeignKey("FK_CompaniesByDocuments_DocumentCompanies_CompanyId", - x => x.CompanyId, "DocumentCompanies", "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey("FK_CompaniesByDocuments_Documents_DocumentId", - x => x.DocumentId, "Documents", "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey("FK_CompaniesByDocuments_DocumentRoles_RoleId", - x => x.RoleId, "DocumentRoles", "Id", - onDelete: ReferentialAction.Cascade); - }); + migrationBuilder.CreateTable("CompaniesByDocuments", table => new + { + Id = table.Column(). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + CompanyId = table.Column(), DocumentId = table.Column(), + RoleId = table.Column("char(3)") + }, constraints: table => + { + table.PrimaryKey("PK_CompaniesByDocuments", x => x.Id); + + table.ForeignKey("FK_CompaniesByDocuments_DocumentCompanies_CompanyId", x => x.CompanyId, + "DocumentCompanies", "Id", onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_CompaniesByDocuments_Documents_DocumentId", x => x.DocumentId, "Documents", "Id", + onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_CompaniesByDocuments_DocumentRoles_RoleId", x => x.RoleId, "DocumentRoles", "Id", + onDelete: ReferentialAction.Cascade); + }); migrationBuilder.CreateIndex("IX_CompaniesByDocuments_CompanyId", "CompaniesByDocuments", "CompanyId"); @@ -37,9 +34,7 @@ namespace Marechai.Database.Migrations migrationBuilder.CreateIndex("IX_CompaniesByDocuments_RoleId", "CompaniesByDocuments", "RoleId"); } - protected override void Down(MigrationBuilder migrationBuilder) - { + protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.DropTable("CompaniesByDocuments"); - } } } \ No newline at end of file diff --git a/Marechai.Database/Migrations/20190616235255_AddDocumentsByMachine.cs b/Marechai.Database/Migrations/20190616235255_AddDocumentsByMachine.cs index 7b10ca2e..cdf4f9fb 100644 --- a/Marechai.Database/Migrations/20190616235255_AddDocumentsByMachine.cs +++ b/Marechai.Database/Migrations/20190616235255_AddDocumentsByMachine.cs @@ -7,33 +7,28 @@ namespace Marechai.Database.Migrations { protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.CreateTable("DocumentsByMachines", - table => new - { - Id = table.Column() - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - DocumentId = table.Column(), - MachineId = table.Column() - }, constraints: table => - { - table.PrimaryKey("PK_DocumentsByMachines", x => x.Id); - table.ForeignKey("FK_DocumentsByMachines_Documents_DocumentId", - x => x.DocumentId, "Documents", "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey("FK_DocumentsByMachines_machines_MachineId", - x => x.MachineId, "machines", "id", - onDelete: ReferentialAction.Cascade); - }); + migrationBuilder.CreateTable("DocumentsByMachines", table => new + { + Id = table.Column(). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + DocumentId = table.Column(), MachineId = table.Column() + }, constraints: table => + { + table.PrimaryKey("PK_DocumentsByMachines", x => x.Id); + + table.ForeignKey("FK_DocumentsByMachines_Documents_DocumentId", x => x.DocumentId, "Documents", "Id", + onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_DocumentsByMachines_machines_MachineId", x => x.MachineId, "machines", "id", + onDelete: ReferentialAction.Cascade); + }); migrationBuilder.CreateIndex("IX_DocumentsByMachines_DocumentId", "DocumentsByMachines", "DocumentId"); migrationBuilder.CreateIndex("IX_DocumentsByMachines_MachineId", "DocumentsByMachines", "MachineId"); } - protected override void Down(MigrationBuilder migrationBuilder) - { + protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.DropTable("DocumentsByMachines"); - } } } \ No newline at end of file diff --git a/Marechai.Database/Migrations/20190617010136_AddDocumentsByMachineFamily.cs b/Marechai.Database/Migrations/20190617010136_AddDocumentsByMachineFamily.cs index c094f22c..c115d8ca 100644 --- a/Marechai.Database/Migrations/20190617010136_AddDocumentsByMachineFamily.cs +++ b/Marechai.Database/Migrations/20190617010136_AddDocumentsByMachineFamily.cs @@ -7,25 +7,21 @@ namespace Marechai.Database.Migrations { protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.CreateTable("DocumentsByMachineFamily", - table => new - { - Id = table.Column() - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - DocumentId = table.Column(), - MachineFamilyId = table.Column() - }, constraints: table => - { - table.PrimaryKey("PK_DocumentsByMachineFamily", x => x.Id); - table.ForeignKey("FK_DocumentsByMachineFamily_Documents_DocumentId", - x => x.DocumentId, "Documents", "Id", - onDelete: ReferentialAction.Cascade); - table - .ForeignKey("FK_DocumentsByMachineFamily_machine_families_MachineFamilyId", - x => x.MachineFamilyId, "machine_families", "id", - onDelete: ReferentialAction.Cascade); - }); + migrationBuilder.CreateTable("DocumentsByMachineFamily", table => new + { + Id = table.Column(). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + DocumentId = table.Column(), MachineFamilyId = table.Column() + }, constraints: table => + { + table.PrimaryKey("PK_DocumentsByMachineFamily", x => x.Id); + + table.ForeignKey("FK_DocumentsByMachineFamily_Documents_DocumentId", x => x.DocumentId, "Documents", + "Id", onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_DocumentsByMachineFamily_machine_families_MachineFamilyId", x => x.MachineFamilyId, + "machine_families", "id", onDelete: ReferentialAction.Cascade); + }); migrationBuilder.CreateIndex("IX_DocumentsByMachineFamily_DocumentId", "DocumentsByMachineFamily", "DocumentId"); @@ -34,9 +30,7 @@ namespace Marechai.Database.Migrations "MachineFamilyId"); } - protected override void Down(MigrationBuilder migrationBuilder) - { + protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.DropTable("DocumentsByMachineFamily"); - } } } \ No newline at end of file diff --git a/Marechai.Database/Migrations/20190617012113_AddBooks.cs b/Marechai.Database/Migrations/20190617012113_AddBooks.cs index 287eba9c..fadd226e 100644 --- a/Marechai.Database/Migrations/20190617012113_AddBooks.cs +++ b/Marechai.Database/Migrations/20190617012113_AddBooks.cs @@ -8,34 +8,31 @@ namespace Marechai.Database.Migrations { protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.CreateTable("Books", - table => new - { - Id = - table.Column() - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - Title = table.Column(), - NativeTitle = table.Column(nullable: true), - Published = table.Column(nullable: true), - CountryId = table.Column(nullable: true), - Synopsis = table.Column(maxLength: 262144, nullable: true), - Isbn = table.Column(maxLength: 13, nullable: true), - Pages = table.Column(nullable: true), - Edition = table.Column(nullable: true), - PreviousId = table.Column(nullable: true), - SourceId = table.Column(nullable: true) - }, constraints: table => - { - table.PrimaryKey("PK_Books", x => x.Id); - table.ForeignKey("FK_Books_iso3166_1_numeric_CountryId", x => x.CountryId, - "iso3166_1_numeric", "id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey("FK_Books_Books_PreviousId", x => x.PreviousId, "Books", - "Id", onDelete: ReferentialAction.Restrict); - table.ForeignKey("FK_Books_Books_SourceId", x => x.SourceId, "Books", "Id", - onDelete: ReferentialAction.Restrict); - }); + migrationBuilder.CreateTable("Books", table => new + { + Id = table.Column(). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Title = table.Column(), NativeTitle = table.Column(nullable: true), + Published = table.Column(nullable: true), CountryId = table.Column(nullable: true), + Synopsis = table.Column(maxLength: 262144, nullable: true), + Isbn = table.Column(maxLength: 13, nullable: true), + Pages = table.Column(nullable: true), + Edition = table.Column(nullable: true), + PreviousId = table.Column(nullable: true), + SourceId = table.Column(nullable: true) + }, constraints: table => + { + table.PrimaryKey("PK_Books", x => x.Id); + + table.ForeignKey("FK_Books_iso3166_1_numeric_CountryId", x => x.CountryId, "iso3166_1_numeric", "id", + onDelete: ReferentialAction.Restrict); + + table.ForeignKey("FK_Books_Books_PreviousId", x => x.PreviousId, "Books", "Id", + onDelete: ReferentialAction.Restrict); + + table.ForeignKey("FK_Books_Books_SourceId", x => x.SourceId, "Books", "Id", + onDelete: ReferentialAction.Restrict); + }); migrationBuilder.CreateIndex("IX_Books_CountryId", "Books", "CountryId"); @@ -53,15 +50,12 @@ namespace Marechai.Database.Migrations migrationBuilder.CreateIndex("IX_Books_SourceId", "Books", "SourceId"); - migrationBuilder.CreateIndex("IX_Books_Synopsis", "Books", "Synopsis") - .Annotation("MySql:FullTextIndex", true); + migrationBuilder.CreateIndex("IX_Books_Synopsis", "Books", "Synopsis"). + Annotation("MySql:FullTextIndex", true); migrationBuilder.CreateIndex("IX_Books_Title", "Books", "Title"); } - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable("Books"); - } + protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.DropTable("Books"); } } \ No newline at end of file diff --git a/Marechai.Database/Migrations/20190617014131_AddCompaniesByBook.cs b/Marechai.Database/Migrations/20190617014131_AddCompaniesByBook.cs index 164fae86..e8a793f5 100644 --- a/Marechai.Database/Migrations/20190617014131_AddCompaniesByBook.cs +++ b/Marechai.Database/Migrations/20190617014131_AddCompaniesByBook.cs @@ -7,27 +7,24 @@ namespace Marechai.Database.Migrations { protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.CreateTable("CompaniesByBooks", - table => new - { - Id = table.Column() - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - CompanyId = table.Column(), - BookId = table.Column(), - RoleId = table.Column("char(3)") - }, constraints: table => - { - table.PrimaryKey("PK_CompaniesByBooks", x => x.Id); - table.ForeignKey("FK_CompaniesByBooks_Books_BookId", x => x.BookId, - "Books", "Id", onDelete: ReferentialAction.Cascade); - table.ForeignKey("FK_CompaniesByBooks_DocumentCompanies_CompanyId", - x => x.CompanyId, "DocumentCompanies", "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey("FK_CompaniesByBooks_DocumentRoles_RoleId", x => x.RoleId, - "DocumentRoles", "Id", - onDelete: ReferentialAction.Cascade); - }); + migrationBuilder.CreateTable("CompaniesByBooks", table => new + { + Id = table.Column(). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + CompanyId = table.Column(), BookId = table.Column(), RoleId = table.Column("char(3)") + }, constraints: table => + { + table.PrimaryKey("PK_CompaniesByBooks", x => x.Id); + + table.ForeignKey("FK_CompaniesByBooks_Books_BookId", x => x.BookId, "Books", "Id", + onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_CompaniesByBooks_DocumentCompanies_CompanyId", x => x.CompanyId, + "DocumentCompanies", "Id", onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_CompaniesByBooks_DocumentRoles_RoleId", x => x.RoleId, "DocumentRoles", "Id", + onDelete: ReferentialAction.Cascade); + }); migrationBuilder.CreateIndex("IX_CompaniesByBooks_BookId", "CompaniesByBooks", "BookId"); @@ -36,9 +33,7 @@ namespace Marechai.Database.Migrations migrationBuilder.CreateIndex("IX_CompaniesByBooks_RoleId", "CompaniesByBooks", "RoleId"); } - protected override void Down(MigrationBuilder migrationBuilder) - { + protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.DropTable("CompaniesByBooks"); - } } } \ No newline at end of file diff --git a/Marechai.Database/Migrations/20190617015011_AddPeopleByBook.cs b/Marechai.Database/Migrations/20190617015011_AddPeopleByBook.cs index 0e9ef35f..ac0a8069 100644 --- a/Marechai.Database/Migrations/20190617015011_AddPeopleByBook.cs +++ b/Marechai.Database/Migrations/20190617015011_AddPeopleByBook.cs @@ -7,27 +7,24 @@ namespace Marechai.Database.Migrations { protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.CreateTable("PeopleByBooks", - table => new - { - Id = table.Column() - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - PersonId = table.Column(), - BookId = table.Column(), - RoleId = table.Column("char(3)") - }, constraints: table => - { - table.PrimaryKey("PK_PeopleByBooks", x => x.Id); - table.ForeignKey("FK_PeopleByBooks_Books_BookId", x => x.BookId, "Books", - "Id", onDelete: ReferentialAction.Cascade); - table.ForeignKey("FK_PeopleByBooks_DocumentPeople_PersonId", - x => x.PersonId, "DocumentPeople", "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey("FK_PeopleByBooks_DocumentRoles_RoleId", x => x.RoleId, - "DocumentRoles", "Id", - onDelete: ReferentialAction.Cascade); - }); + migrationBuilder.CreateTable("PeopleByBooks", table => new + { + Id = table.Column(). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + PersonId = table.Column(), BookId = table.Column(), RoleId = table.Column("char(3)") + }, constraints: table => + { + table.PrimaryKey("PK_PeopleByBooks", x => x.Id); + + table.ForeignKey("FK_PeopleByBooks_Books_BookId", x => x.BookId, "Books", "Id", + onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_PeopleByBooks_DocumentPeople_PersonId", x => x.PersonId, "DocumentPeople", "Id", + onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_PeopleByBooks_DocumentRoles_RoleId", x => x.RoleId, "DocumentRoles", "Id", + onDelete: ReferentialAction.Cascade); + }); migrationBuilder.CreateIndex("IX_PeopleByBooks_BookId", "PeopleByBooks", "BookId"); @@ -36,9 +33,6 @@ namespace Marechai.Database.Migrations migrationBuilder.CreateIndex("IX_PeopleByBooks_RoleId", "PeopleByBooks", "RoleId"); } - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable("PeopleByBooks"); - } + protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.DropTable("PeopleByBooks"); } } \ No newline at end of file diff --git a/Marechai.Database/Migrations/20190617020655_AddBooksByMachine.cs b/Marechai.Database/Migrations/20190617020655_AddBooksByMachine.cs index 39bf3281..239bdfe3 100644 --- a/Marechai.Database/Migrations/20190617020655_AddBooksByMachine.cs +++ b/Marechai.Database/Migrations/20190617020655_AddBooksByMachine.cs @@ -7,31 +7,28 @@ namespace Marechai.Database.Migrations { protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.CreateTable("BooksByMachines", - table => new - { - Id = table.Column() - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - BookId = table.Column(), - MachineId = table.Column() - }, constraints: table => - { - table.PrimaryKey("PK_BooksByMachines", x => x.Id); - table.ForeignKey("FK_BooksByMachines_Books_BookId", x => x.BookId, "Books", - "Id", onDelete: ReferentialAction.Cascade); - table.ForeignKey("FK_BooksByMachines_machines_MachineId", x => x.MachineId, - "machines", "id", onDelete: ReferentialAction.Cascade); - }); + migrationBuilder.CreateTable("BooksByMachines", table => new + { + Id = table.Column(). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + BookId = table.Column(), MachineId = table.Column() + }, constraints: table => + { + table.PrimaryKey("PK_BooksByMachines", x => x.Id); + + table.ForeignKey("FK_BooksByMachines_Books_BookId", x => x.BookId, "Books", "Id", + onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_BooksByMachines_machines_MachineId", x => x.MachineId, "machines", "id", + onDelete: ReferentialAction.Cascade); + }); migrationBuilder.CreateIndex("IX_BooksByMachines_BookId", "BooksByMachines", "BookId"); migrationBuilder.CreateIndex("IX_BooksByMachines_MachineId", "BooksByMachines", "MachineId"); } - protected override void Down(MigrationBuilder migrationBuilder) - { + protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.DropTable("BooksByMachines"); - } } } \ No newline at end of file diff --git a/Marechai.Database/Migrations/20190617021725_AddBooksByMachineFamily.cs b/Marechai.Database/Migrations/20190617021725_AddBooksByMachineFamily.cs index 0cd10453..2b93814d 100644 --- a/Marechai.Database/Migrations/20190617021725_AddBooksByMachineFamily.cs +++ b/Marechai.Database/Migrations/20190617021725_AddBooksByMachineFamily.cs @@ -7,24 +7,21 @@ namespace Marechai.Database.Migrations { protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.CreateTable("BooksByMachineFamilies", - table => new - { - Id = table.Column() - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - BookId = table.Column(), - MachineFamilyId = table.Column() - }, constraints: table => - { - table.PrimaryKey("PK_BooksByMachineFamilies", x => x.Id); - table.ForeignKey("FK_BooksByMachineFamilies_Books_BookId", x => x.BookId, - "Books", "Id", onDelete: ReferentialAction.Cascade); - table - .ForeignKey("FK_BooksByMachineFamilies_machine_families_MachineFamilyId", - x => x.MachineFamilyId, "machine_families", "id", - onDelete: ReferentialAction.Cascade); - }); + migrationBuilder.CreateTable("BooksByMachineFamilies", table => new + { + Id = table.Column(). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + BookId = table.Column(), MachineFamilyId = table.Column() + }, constraints: table => + { + table.PrimaryKey("PK_BooksByMachineFamilies", x => x.Id); + + table.ForeignKey("FK_BooksByMachineFamilies_Books_BookId", x => x.BookId, "Books", "Id", + onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_BooksByMachineFamilies_machine_families_MachineFamilyId", x => x.MachineFamilyId, + "machine_families", "id", onDelete: ReferentialAction.Cascade); + }); migrationBuilder.CreateIndex("IX_BooksByMachineFamilies_BookId", "BooksByMachineFamilies", "BookId"); @@ -32,9 +29,7 @@ namespace Marechai.Database.Migrations "MachineFamilyId"); } - protected override void Down(MigrationBuilder migrationBuilder) - { + protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.DropTable("BooksByMachineFamilies"); - } } } \ No newline at end of file diff --git a/Marechai.Database/Migrations/20190617022849_AddMagazines.cs b/Marechai.Database/Migrations/20190617022849_AddMagazines.cs index f9b731a6..4f74c6ad 100644 --- a/Marechai.Database/Migrations/20190617022849_AddMagazines.cs +++ b/Marechai.Database/Migrations/20190617022849_AddMagazines.cs @@ -8,26 +8,24 @@ namespace Marechai.Database.Migrations { protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.CreateTable("Magazines", - table => new - { - Id = table.Column() - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - Title = table.Column(), - NativeTitle = table.Column(nullable: true), - Published = table.Column(nullable: true), - CountryId = table.Column(nullable: true), - Synopsis = table.Column(maxLength: 262144, nullable: true), - Issn = table.Column(maxLength: 8, nullable: true), - FirstPublication = table.Column(nullable: true) - }, constraints: table => - { - table.PrimaryKey("PK_Magazines", x => x.Id); - table.ForeignKey("FK_Magazines_iso3166_1_numeric_CountryId", - x => x.CountryId, "iso3166_1_numeric", "id", - onDelete: ReferentialAction.Restrict); - }); + migrationBuilder.CreateTable("Magazines", table => new + { + Id = table.Column(). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Title = table.Column(), + NativeTitle = table.Column(nullable: true), + Published = table.Column(nullable: true), + CountryId = table.Column(nullable: true), + Synopsis = table.Column(maxLength: 262144, nullable: true), + Issn = table.Column(maxLength: 8, nullable: true), + FirstPublication = table.Column(nullable: true) + }, constraints: table => + { + table.PrimaryKey("PK_Magazines", x => x.Id); + + table.ForeignKey("FK_Magazines_iso3166_1_numeric_CountryId", x => x.CountryId, "iso3166_1_numeric", + "id", onDelete: ReferentialAction.Restrict); + }); migrationBuilder.CreateIndex("IX_Magazines_CountryId", "Magazines", "CountryId"); @@ -39,15 +37,12 @@ namespace Marechai.Database.Migrations migrationBuilder.CreateIndex("IX_Magazines_Published", "Magazines", "Published"); - migrationBuilder.CreateIndex("IX_Magazines_Synopsis", "Magazines", "Synopsis") - .Annotation("MySql:FullTextIndex", true); + migrationBuilder.CreateIndex("IX_Magazines_Synopsis", "Magazines", "Synopsis"). + Annotation("MySql:FullTextIndex", true); migrationBuilder.CreateIndex("IX_Magazines_Title", "Magazines", "Title"); } - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable("Magazines"); - } + protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.DropTable("Magazines"); } } \ No newline at end of file diff --git a/Marechai.Database/Migrations/20190617024228_AddMagazineIssues.cs b/Marechai.Database/Migrations/20190617024228_AddMagazineIssues.cs index f83163cf..6098e3d7 100644 --- a/Marechai.Database/Migrations/20190617024228_AddMagazineIssues.cs +++ b/Marechai.Database/Migrations/20190617024228_AddMagazineIssues.cs @@ -8,25 +8,21 @@ namespace Marechai.Database.Migrations { protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.CreateTable("MagazineIssues", - table => new - { - Id = table.Column() - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - MagazineId = table.Column(), - Caption = table.Column(), - NativeCaption = table.Column(nullable: true), - Published = table.Column(nullable: true), - ProductCode = table.Column(maxLength: 18, nullable: true), - Pages = table.Column() - }, constraints: table => - { - table.PrimaryKey("PK_MagazineIssues", x => x.Id); - table.ForeignKey("FK_MagazineIssues_Magazines_MagazineId", - x => x.MagazineId, "Magazines", "Id", - onDelete: ReferentialAction.Cascade); - }); + migrationBuilder.CreateTable("MagazineIssues", table => new + { + Id = table.Column(). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + MagazineId = table.Column(), Caption = table.Column(), + NativeCaption = table.Column(nullable: true), + Published = table.Column(nullable: true), + ProductCode = table.Column(maxLength: 18, nullable: true), Pages = table.Column() + }, constraints: table => + { + table.PrimaryKey("PK_MagazineIssues", x => x.Id); + + table.ForeignKey("FK_MagazineIssues_Magazines_MagazineId", x => x.MagazineId, "Magazines", "Id", + onDelete: ReferentialAction.Cascade); + }); migrationBuilder.CreateIndex("IX_MagazineIssues_Caption", "MagazineIssues", "Caption"); @@ -41,9 +37,6 @@ namespace Marechai.Database.Migrations migrationBuilder.CreateIndex("IX_MagazineIssues_Published", "MagazineIssues", "Published"); } - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable("MagazineIssues"); - } + protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.DropTable("MagazineIssues"); } } \ No newline at end of file diff --git a/Marechai.Database/Migrations/20190617025439_AddCompaniesByMagazine.cs b/Marechai.Database/Migrations/20190617025439_AddCompaniesByMagazine.cs index 1f511818..5bae2b86 100644 --- a/Marechai.Database/Migrations/20190617025439_AddCompaniesByMagazine.cs +++ b/Marechai.Database/Migrations/20190617025439_AddCompaniesByMagazine.cs @@ -7,28 +7,25 @@ namespace Marechai.Database.Migrations { protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.CreateTable("CompaniesByMagazines", - table => new - { - Id = table.Column() - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - CompanyId = table.Column(), - MagazineId = table.Column(), - RoleId = table.Column("char(3)") - }, constraints: table => - { - table.PrimaryKey("PK_CompaniesByMagazines", x => x.Id); - table.ForeignKey("FK_CompaniesByMagazines_DocumentCompanies_CompanyId", - x => x.CompanyId, "DocumentCompanies", "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey("FK_CompaniesByMagazines_Magazines_MagazineId", - x => x.MagazineId, "Magazines", "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey("FK_CompaniesByMagazines_DocumentRoles_RoleId", - x => x.RoleId, "DocumentRoles", "Id", - onDelete: ReferentialAction.Cascade); - }); + migrationBuilder.CreateTable("CompaniesByMagazines", table => new + { + Id = table.Column(). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + CompanyId = table.Column(), MagazineId = table.Column(), + RoleId = table.Column("char(3)") + }, constraints: table => + { + table.PrimaryKey("PK_CompaniesByMagazines", x => x.Id); + + table.ForeignKey("FK_CompaniesByMagazines_DocumentCompanies_CompanyId", x => x.CompanyId, + "DocumentCompanies", "Id", onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_CompaniesByMagazines_Magazines_MagazineId", x => x.MagazineId, "Magazines", "Id", + onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_CompaniesByMagazines_DocumentRoles_RoleId", x => x.RoleId, "DocumentRoles", "Id", + onDelete: ReferentialAction.Cascade); + }); migrationBuilder.CreateIndex("IX_CompaniesByMagazines_CompanyId", "CompaniesByMagazines", "CompanyId"); @@ -37,9 +34,7 @@ namespace Marechai.Database.Migrations migrationBuilder.CreateIndex("IX_CompaniesByMagazines_RoleId", "CompaniesByMagazines", "RoleId"); } - protected override void Down(MigrationBuilder migrationBuilder) - { + protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.DropTable("CompaniesByMagazines"); - } } } \ No newline at end of file diff --git a/Marechai.Database/Migrations/20190617030141_AddPeopleByMagazine.cs b/Marechai.Database/Migrations/20190617030141_AddPeopleByMagazine.cs index 6f6a89e2..577e07a6 100644 --- a/Marechai.Database/Migrations/20190617030141_AddPeopleByMagazine.cs +++ b/Marechai.Database/Migrations/20190617030141_AddPeopleByMagazine.cs @@ -7,28 +7,25 @@ namespace Marechai.Database.Migrations { protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.CreateTable("PeopleByMagazines", - table => new - { - Id = table.Column() - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - PersonId = table.Column(), - MagazineId = table.Column(), - RoleId = table.Column("char(3)") - }, constraints: table => - { - table.PrimaryKey("PK_PeopleByMagazines", x => x.Id); - table.ForeignKey("FK_PeopleByMagazines_MagazineIssues_MagazineId", - x => x.MagazineId, "MagazineIssues", "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey("FK_PeopleByMagazines_DocumentPeople_PersonId", - x => x.PersonId, "DocumentPeople", "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey("FK_PeopleByMagazines_DocumentRoles_RoleId", - x => x.RoleId, "DocumentRoles", "Id", - onDelete: ReferentialAction.Cascade); - }); + migrationBuilder.CreateTable("PeopleByMagazines", table => new + { + Id = table.Column(). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + PersonId = table.Column(), MagazineId = table.Column(), + RoleId = table.Column("char(3)") + }, constraints: table => + { + table.PrimaryKey("PK_PeopleByMagazines", x => x.Id); + + table.ForeignKey("FK_PeopleByMagazines_MagazineIssues_MagazineId", x => x.MagazineId, "MagazineIssues", + "Id", onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_PeopleByMagazines_DocumentPeople_PersonId", x => x.PersonId, "DocumentPeople", + "Id", onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_PeopleByMagazines_DocumentRoles_RoleId", x => x.RoleId, "DocumentRoles", "Id", + onDelete: ReferentialAction.Cascade); + }); migrationBuilder.CreateIndex("IX_PeopleByMagazines_MagazineId", "PeopleByMagazines", "MagazineId"); @@ -37,9 +34,7 @@ namespace Marechai.Database.Migrations migrationBuilder.CreateIndex("IX_PeopleByMagazines_RoleId", "PeopleByMagazines", "RoleId"); } - protected override void Down(MigrationBuilder migrationBuilder) - { + protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.DropTable("PeopleByMagazines"); - } } } \ No newline at end of file diff --git a/Marechai.Database/Migrations/20190617031250_AddMagazinesByMachine.cs b/Marechai.Database/Migrations/20190617031250_AddMagazinesByMachine.cs index c573372f..61d401d2 100644 --- a/Marechai.Database/Migrations/20190617031250_AddMagazinesByMachine.cs +++ b/Marechai.Database/Migrations/20190617031250_AddMagazinesByMachine.cs @@ -7,33 +7,28 @@ namespace Marechai.Database.Migrations { protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.CreateTable("MagazinesByMachines", - table => new - { - Id = table.Column() - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - MagazineId = table.Column(), - MachineId = table.Column() - }, constraints: table => - { - table.PrimaryKey("PK_MagazinesByMachines", x => x.Id); - table.ForeignKey("FK_MagazinesByMachines_machines_MachineId", - x => x.MachineId, "machines", "id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey("FK_MagazinesByMachines_MagazineIssues_MagazineId", - x => x.MagazineId, "MagazineIssues", "Id", - onDelete: ReferentialAction.Cascade); - }); + migrationBuilder.CreateTable("MagazinesByMachines", table => new + { + Id = table.Column(). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + MagazineId = table.Column(), MachineId = table.Column() + }, constraints: table => + { + table.PrimaryKey("PK_MagazinesByMachines", x => x.Id); + + table.ForeignKey("FK_MagazinesByMachines_machines_MachineId", x => x.MachineId, "machines", "id", + onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_MagazinesByMachines_MagazineIssues_MagazineId", x => x.MagazineId, + "MagazineIssues", "Id", onDelete: ReferentialAction.Cascade); + }); migrationBuilder.CreateIndex("IX_MagazinesByMachines_MachineId", "MagazinesByMachines", "MachineId"); migrationBuilder.CreateIndex("IX_MagazinesByMachines_MagazineId", "MagazinesByMachines", "MagazineId"); } - protected override void Down(MigrationBuilder migrationBuilder) - { + protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.DropTable("MagazinesByMachines"); - } } } \ No newline at end of file diff --git a/Marechai.Database/Migrations/20190617031843_AddMagazinesByMachineFamily.cs b/Marechai.Database/Migrations/20190617031843_AddMagazinesByMachineFamily.cs index 4af0ca87..cf74176d 100644 --- a/Marechai.Database/Migrations/20190617031843_AddMagazinesByMachineFamily.cs +++ b/Marechai.Database/Migrations/20190617031843_AddMagazinesByMachineFamily.cs @@ -7,26 +7,21 @@ namespace Marechai.Database.Migrations { protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.CreateTable("MagazinesByMachinesFamilies", - table => new - { - Id = table.Column() - .Annotation("MySql:ValueGenerationStrategy", - MySqlValueGenerationStrategy.IdentityColumn), - MagazineId = table.Column(), - MachineFamilyId = table.Column() - }, constraints: table => - { - table.PrimaryKey("PK_MagazinesByMachinesFamilies", x => x.Id); - table - .ForeignKey("FK_MagazinesByMachinesFamilies_machine_families_MachineFamilyId", - x => x.MachineFamilyId, "machine_families", "id", - onDelete: ReferentialAction.Cascade); - table - .ForeignKey("FK_MagazinesByMachinesFamilies_MagazineIssues_MagazineId", - x => x.MagazineId, "MagazineIssues", "Id", - onDelete: ReferentialAction.Cascade); - }); + migrationBuilder.CreateTable("MagazinesByMachinesFamilies", table => new + { + Id = table.Column(). + Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + MagazineId = table.Column(), MachineFamilyId = table.Column() + }, constraints: table => + { + table.PrimaryKey("PK_MagazinesByMachinesFamilies", x => x.Id); + + table.ForeignKey("FK_MagazinesByMachinesFamilies_machine_families_MachineFamilyId", + x => x.MachineFamilyId, "machine_families", "id", onDelete: ReferentialAction.Cascade); + + table.ForeignKey("FK_MagazinesByMachinesFamilies_MagazineIssues_MagazineId", x => x.MagazineId, + "MagazineIssues", "Id", onDelete: ReferentialAction.Cascade); + }); migrationBuilder.CreateIndex("IX_MagazinesByMachinesFamilies_MachineFamilyId", "MagazinesByMachinesFamilies", "MachineFamilyId"); @@ -35,9 +30,7 @@ namespace Marechai.Database.Migrations "MagazineId"); } - protected override void Down(MigrationBuilder migrationBuilder) - { + protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.DropTable("MagazinesByMachinesFamilies"); - } } } \ No newline at end of file diff --git a/Marechai.Database/Migrations/MarechaiContextModelSnapshot.cs b/Marechai.Database/Migrations/MarechaiContextModelSnapshot.cs index 57d668f8..8bd365db 100644 --- a/Marechai.Database/Migrations/MarechaiContextModelSnapshot.cs +++ b/Marechai.Database/Migrations/MarechaiContextModelSnapshot.cs @@ -8,13 +8,13 @@ using Microsoft.EntityFrameworkCore.Infrastructure; namespace Marechai.Database.Migrations { [DbContext(typeof(MarechaiContext))] - class MarechaiContextModelSnapshot : ModelSnapshot + internal class MarechaiContextModelSnapshot : ModelSnapshot { protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "2.2.4-servicing-10062") - .HasAnnotation("Relational:MaxIdentifierLength", 64); + modelBuilder.HasAnnotation("ProductVersion", "2.2.4-servicing-10062"). + HasAnnotation("Relational:MaxIdentifierLength", 64); modelBuilder.Entity("Marechai.Database.Models.Book", b => { @@ -103,53 +103,53 @@ namespace Marechai.Database.Migrations { b.Property("Id").ValueGeneratedOnAdd().HasColumnName("id").HasColumnType("int(11)"); - b.Property("Agif").ValueGeneratedOnAdd().HasColumnName("agif").HasColumnType("tinyint(1)") - .HasDefaultValueSql("'0'"); + b.Property("Agif").ValueGeneratedOnAdd().HasColumnName("agif").HasColumnType("tinyint(1)"). + HasDefaultValueSql("'0'"); - b.Property("Browser").IsRequired().ValueGeneratedOnAdd().HasColumnName("browser") - .HasColumnType("varchar(64)").HasDefaultValueSql("''").HasMaxLength(64); + b.Property("Browser").IsRequired().ValueGeneratedOnAdd().HasColumnName("browser"). + HasColumnType("varchar(64)").HasDefaultValueSql("''").HasMaxLength(64); - b.Property("Colors").ValueGeneratedOnAdd().HasColumnName("colors").HasColumnType("tinyint(1)") - .HasDefaultValueSql("'0'"); + b.Property("Colors").ValueGeneratedOnAdd().HasColumnName("colors").HasColumnType("tinyint(1)"). + HasDefaultValueSql("'0'"); - b.Property("Flash").ValueGeneratedOnAdd().HasColumnName("flash").HasColumnType("tinyint(1)") - .HasDefaultValueSql("'0'"); + b.Property("Flash").ValueGeneratedOnAdd().HasColumnName("flash").HasColumnType("tinyint(1)"). + HasDefaultValueSql("'0'"); - b.Property("Frames").ValueGeneratedOnAdd().HasColumnName("frames").HasColumnType("tinyint(1)") - .HasDefaultValueSql("'0'"); + b.Property("Frames").ValueGeneratedOnAdd().HasColumnName("frames").HasColumnType("tinyint(1)"). + HasDefaultValueSql("'0'"); - b.Property("Gif87").ValueGeneratedOnAdd().HasColumnName("gif87").HasColumnType("tinyint(1)") - .HasDefaultValueSql("'0'"); + b.Property("Gif87").ValueGeneratedOnAdd().HasColumnName("gif87").HasColumnType("tinyint(1)"). + HasDefaultValueSql("'0'"); - b.Property("Gif89").ValueGeneratedOnAdd().HasColumnName("gif89").HasColumnType("tinyint(1)") - .HasDefaultValueSql("'0'"); + b.Property("Gif89").ValueGeneratedOnAdd().HasColumnName("gif89").HasColumnType("tinyint(1)"). + HasDefaultValueSql("'0'"); - b.Property("Jpeg").ValueGeneratedOnAdd().HasColumnName("jpeg").HasColumnType("tinyint(1)") - .HasDefaultValueSql("'0'"); + b.Property("Jpeg").ValueGeneratedOnAdd().HasColumnName("jpeg").HasColumnType("tinyint(1)"). + HasDefaultValueSql("'0'"); - b.Property("Js").ValueGeneratedOnAdd().HasColumnName("js").HasColumnType("tinyint(1)") - .HasDefaultValueSql("'0'"); + b.Property("Js").ValueGeneratedOnAdd().HasColumnName("js").HasColumnType("tinyint(1)"). + HasDefaultValueSql("'0'"); - b.Property("Os").IsRequired().ValueGeneratedOnAdd().HasColumnName("os") - .HasColumnType("varchar(32)").HasDefaultValueSql("''").HasMaxLength(32); + b.Property("Os").IsRequired().ValueGeneratedOnAdd().HasColumnName("os"). + HasColumnType("varchar(32)").HasDefaultValueSql("''").HasMaxLength(32); - b.Property("Platform").IsRequired().ValueGeneratedOnAdd().HasColumnName("platform") - .HasColumnType("varchar(8)").HasDefaultValueSql("''").HasMaxLength(8); + b.Property("Platform").IsRequired().ValueGeneratedOnAdd().HasColumnName("platform"). + HasColumnType("varchar(8)").HasDefaultValueSql("''").HasMaxLength(8); - b.Property("Png").ValueGeneratedOnAdd().HasColumnName("png").HasColumnType("tinyint(1)") - .HasDefaultValueSql("'0'"); + b.Property("Png").ValueGeneratedOnAdd().HasColumnName("png").HasColumnType("tinyint(1)"). + HasDefaultValueSql("'0'"); - b.Property("Pngt").ValueGeneratedOnAdd().HasColumnName("pngt").HasColumnType("tinyint(1)") - .HasDefaultValueSql("'0'"); + b.Property("Pngt").ValueGeneratedOnAdd().HasColumnName("pngt").HasColumnType("tinyint(1)"). + HasDefaultValueSql("'0'"); - b.Property("Table").ValueGeneratedOnAdd().HasColumnName("table").HasColumnType("tinyint(1)") - .HasDefaultValueSql("'0'"); + b.Property("Table").ValueGeneratedOnAdd().HasColumnName("table").HasColumnType("tinyint(1)"). + HasDefaultValueSql("'0'"); - b.Property("UserAgent").IsRequired().ValueGeneratedOnAdd().HasColumnName("user_agent") - .HasColumnType("varchar(128)").HasDefaultValueSql("''").HasMaxLength(128); + b.Property("UserAgent").IsRequired().ValueGeneratedOnAdd().HasColumnName("user_agent"). + HasColumnType("varchar(128)").HasDefaultValueSql("''").HasMaxLength(128); - b.Property("Version").IsRequired().ValueGeneratedOnAdd().HasColumnName("version") - .HasColumnType("varchar(16)").HasDefaultValueSql("''").HasMaxLength(16); + b.Property("Version").IsRequired().ValueGeneratedOnAdd().HasColumnName("version"). + HasColumnType("varchar(16)").HasDefaultValueSql("''").HasMaxLength(16); b.HasKey("Id"); @@ -170,8 +170,8 @@ namespace Marechai.Database.Migrations { b.Property("Id").ValueGeneratedOnAdd().HasColumnName("id").HasColumnType("int(11)"); - b.Property("Updated").ValueGeneratedOnAdd().HasColumnName("updated") - .HasColumnType("timestamp").HasDefaultValueSql("CURRENT_TIMESTAMP"); + b.Property("Updated").ValueGeneratedOnAdd().HasColumnName("updated"). + HasColumnType("timestamp").HasDefaultValueSql("CURRENT_TIMESTAMP"); b.Property("Version").HasColumnName("version").HasColumnType("int(11)"); @@ -259,11 +259,11 @@ namespace Marechai.Database.Migrations b.Property("Founded").HasColumnName("founded").HasColumnType("datetime"); - b.Property("Name").IsRequired().ValueGeneratedOnAdd().HasColumnName("name") - .HasColumnType("varchar(128)").HasDefaultValueSql("''"); + b.Property("Name").IsRequired().ValueGeneratedOnAdd().HasColumnName("name"). + HasColumnType("varchar(128)").HasDefaultValueSql("''"); - b.Property("PostalCode").HasColumnName("postal_code").HasColumnType("varchar(25)") - .HasMaxLength(25); + b.Property("PostalCode").HasColumnName("postal_code").HasColumnType("varchar(25)"). + HasMaxLength(25); b.Property("Province").HasColumnName("province").HasColumnType("varchar(80)").HasMaxLength(80); @@ -439,277 +439,820 @@ namespace Marechai.Database.Migrations b.ToTable("DocumentRoles"); - b.HasData(new {Id = "abr", Enabled = true, Name = "Abridger"}, - new {Id = "acp", Enabled = true, Name = "Art copyist"}, - new {Id = "act", Enabled = true, Name = "Actor"}, - new {Id = "adi", Enabled = true, Name = "Art director"}, - new {Id = "adp", Enabled = true, Name = "Adapter"}, - new {Id = "aft", Enabled = true, Name = "Author of afterword, colophon, etc."}, - new {Id = "anl", Enabled = true, Name = "Analyst"}, - new {Id = "anm", Enabled = true, Name = "Animator"}, - new {Id = "ann", Enabled = true, Name = "Annotator"}, - new {Id = "ant", Enabled = true, Name = "Bibliographic antecedent"}, - new {Id = "ape", Enabled = true, Name = "Appellee"}, - new {Id = "apl", Enabled = true, Name = "Appellant"}, - new {Id = "app", Enabled = true, Name = "Applicant"}, - new {Id = "aqt", Enabled = true, Name = "Author in quotations or text abstracts"}, - new {Id = "arc", Enabled = true, Name = "Architect"}, - new {Id = "ard", Enabled = true, Name = "Artistic director"}, - new {Id = "arr", Enabled = true, Name = "Arranger"}, - new {Id = "art", Enabled = true, Name = "Artist"}, - new {Id = "asg", Enabled = true, Name = "Assignee"}, - new {Id = "asn", Enabled = true, Name = "Associated name"}, - new {Id = "ato", Enabled = true, Name = "Autographer"}, - new {Id = "att", Enabled = true, Name = "Attributed name"}, - new {Id = "auc", Enabled = true, Name = "Auctioneer"}, - new {Id = "aud", Enabled = true, Name = "Author of dialog"}, - new {Id = "aui", Enabled = true, Name = "Author of introduction, etc."}, - new {Id = "aus", Enabled = true, Name = "Screenwriter"}, - new {Id = "aut", Enabled = true, Name = "Author"}, - new {Id = "bdd", Enabled = true, Name = "Binding designer"}, - new {Id = "bjd", Enabled = true, Name = "Bookjacket designer"}, - new {Id = "bkd", Enabled = true, Name = "Book designer"}, - new {Id = "bkp", Enabled = true, Name = "Book producer"}, - new {Id = "blw", Enabled = true, Name = "Blurb writer"}, - new {Id = "bnd", Enabled = true, Name = "Binder"}, - new {Id = "bpd", Enabled = true, Name = "Bookplate designer"}, - new {Id = "brd", Enabled = true, Name = "Broadcaster"}, - new {Id = "brl", Enabled = true, Name = "Braille embosser"}, - new {Id = "bsl", Enabled = true, Name = "Bookseller"}, - new {Id = "cas", Enabled = true, Name = "Caster"}, - new {Id = "ccp", Enabled = true, Name = "Conceptor"}, - new {Id = "chr", Enabled = true, Name = "Choreographer"}, - new {Id = "clb", Enabled = false, Name = "Collaborator"}, - new {Id = "cli", Enabled = true, Name = "Client"}, - new {Id = "cll", Enabled = true, Name = "Calligrapher"}, - new {Id = "clr", Enabled = true, Name = "Colorist"}, - new {Id = "clt", Enabled = true, Name = "Collotyper"}, - new {Id = "cmm", Enabled = true, Name = "Commentator"}, - new {Id = "cmp", Enabled = true, Name = "Composer"}, - new {Id = "cmt", Enabled = true, Name = "Compositor"}, - new {Id = "cnd", Enabled = true, Name = "Conductor"}, - new {Id = "cng", Enabled = true, Name = "Cinematographer"}, - new {Id = "cns", Enabled = true, Name = "Censor"}, - new {Id = "coe", Enabled = true, Name = "Contestant-appellee"}, - new {Id = "col", Enabled = true, Name = "Collector"}, - new {Id = "com", Enabled = true, Name = "Compiler"}, - new {Id = "con", Enabled = true, Name = "Conservator"}, - new {Id = "cor", Enabled = true, Name = "Collection registrar"}, - new {Id = "cos", Enabled = true, Name = "Contestant"}, - new {Id = "cot", Enabled = true, Name = "Contestant-appellant"}, - new {Id = "cou", Enabled = true, Name = "Court governed"}, - new {Id = "cov", Enabled = true, Name = "Cover designer"}, - new {Id = "cpc", Enabled = true, Name = "Copyright claimant"}, - new {Id = "cpe", Enabled = true, Name = "Complainant-appellee"}, - new {Id = "cph", Enabled = true, Name = "Copyright holder"}, - new {Id = "cpl", Enabled = true, Name = "Complainant"}, - new {Id = "cpt", Enabled = true, Name = "Complainant-appellant"}, - new {Id = "cre", Enabled = true, Name = "Creator"}, - new {Id = "crp", Enabled = true, Name = "Correspondent"}, - new {Id = "crr", Enabled = true, Name = "Corrector"}, - new {Id = "crt", Enabled = true, Name = "Court reporter"}, - new {Id = "csl", Enabled = true, Name = "Consultant"}, - new {Id = "csp", Enabled = true, Name = "Consultant to a project"}, - new {Id = "cst", Enabled = true, Name = "Costume designer"}, - new {Id = "ctb", Enabled = true, Name = "Contributor"}, - new {Id = "cte", Enabled = true, Name = "Contestee-appellee"}, - new {Id = "ctg", Enabled = true, Name = "Cartographer"}, - new {Id = "ctr", Enabled = true, Name = "Contractor"}, - new {Id = "cts", Enabled = true, Name = "Contestee"}, - new {Id = "ctt", Enabled = true, Name = "Contestee-appellant"}, - new {Id = "cur", Enabled = true, Name = "Curator"}, - new {Id = "cwt", Enabled = true, Name = "Commentator for written text"}, - new {Id = "dbp", Enabled = true, Name = "Distribution place"}, - new {Id = "dfd", Enabled = true, Name = "Defendant"}, - new {Id = "dfe", Enabled = true, Name = "Defendant-appellee"}, - new {Id = "dft", Enabled = true, Name = "Defendant-appellant"}, - new {Id = "dgg", Enabled = true, Name = "Degree granting institution"}, - new {Id = "dgs", Enabled = true, Name = "Degree supervisor"}, - new {Id = "dis", Enabled = true, Name = "Dissertant"}, - new {Id = "dln", Enabled = true, Name = "Delineator"}, - new {Id = "dnc", Enabled = true, Name = "Dancer"}, - new {Id = "dnr", Enabled = true, Name = "Donor"}, - new {Id = "dpc", Enabled = true, Name = "Depicted"}, - new {Id = "dpt", Enabled = true, Name = "Depositor"}, - new {Id = "drm", Enabled = true, Name = "Draftsman"}, - new {Id = "drt", Enabled = true, Name = "Director"}, - new {Id = "dsr", Enabled = true, Name = "Designer"}, - new {Id = "dst", Enabled = true, Name = "Distributor"}, - new {Id = "dtc", Enabled = true, Name = "Data contributor"}, - new {Id = "dte", Enabled = true, Name = "Dedicatee"}, - new {Id = "dtm", Enabled = true, Name = "Data manager"}, - new {Id = "dto", Enabled = true, Name = "Dedicator"}, - new {Id = "dub", Enabled = true, Name = "Dubious author"}, - new {Id = "edc", Enabled = true, Name = "Editor of compilation"}, - new {Id = "edm", Enabled = true, Name = "Editor of moving image work"}, - new {Id = "edt", Enabled = true, Name = "Editor"}, - new {Id = "egr", Enabled = true, Name = "Engraver"}, - new {Id = "elg", Enabled = true, Name = "Electrician"}, - new {Id = "elt", Enabled = true, Name = "Electrotyper"}, - new {Id = "eng", Enabled = true, Name = "Engineer"}, - new {Id = "enj", Enabled = true, Name = "Enacting jurisdiction"}, - new {Id = "etr", Enabled = true, Name = "Etcher"}, - new {Id = "evp", Enabled = true, Name = "Event place"}, - new {Id = "exp", Enabled = true, Name = "Expert"}, - new {Id = "fac", Enabled = true, Name = "Facsimilist"}, - new {Id = "fds", Enabled = true, Name = "Film distributor"}, - new {Id = "fld", Enabled = true, Name = "Field director"}, - new {Id = "flm", Enabled = true, Name = "Film editor"}, - new {Id = "fmd", Enabled = true, Name = "Film director"}, - new {Id = "fmk", Enabled = true, Name = "Filmmaker"}, - new {Id = "fmo", Enabled = true, Name = "Former owner"}, - new {Id = "fmp", Enabled = true, Name = "Film producer"}, - new {Id = "fnd", Enabled = true, Name = "Funder"}, - new {Id = "fpy", Enabled = true, Name = "First party"}, - new {Id = "frg", Enabled = true, Name = "Forger"}, - new {Id = "gis", Enabled = true, Name = "Geographic information specialist"}, - new {Id = "grt", Enabled = false, Name = "Graphic technician"}, - new {Id = "his", Enabled = true, Name = "Host institution"}, - new {Id = "hnr", Enabled = true, Name = "Honoree"}, - new {Id = "hst", Enabled = true, Name = "Host"}, - new {Id = "ill", Enabled = true, Name = "Illustrator"}, - new {Id = "ilu", Enabled = true, Name = "Illuminator"}, - new {Id = "ins", Enabled = true, Name = "Inscriber"}, - new {Id = "inv", Enabled = true, Name = "Inventor"}, - new {Id = "isb", Enabled = true, Name = "Issuing body"}, - new {Id = "itr", Enabled = true, Name = "Instrumentalist"}, - new {Id = "ive", Enabled = true, Name = "Interviewee"}, - new {Id = "ivr", Enabled = true, Name = "Interviewer"}, - new {Id = "jud", Enabled = true, Name = "Judge"}, - new {Id = "jug", Enabled = true, Name = "Jurisdiction governed"}, - new {Id = "lbr", Enabled = true, Name = "Laboratory"}, - new {Id = "lbt", Enabled = true, Name = "Librettist"}, - new {Id = "ldr", Enabled = true, Name = "Laboratory director"}, - new {Id = "led", Enabled = true, Name = "Lead"}, - new {Id = "lee", Enabled = true, Name = "Libelee-appellee"}, - new {Id = "lel", Enabled = true, Name = "Libelee"}, - new {Id = "len", Enabled = true, Name = "Lender"}, - new {Id = "let", Enabled = true, Name = "Libelee-appellant"}, - new {Id = "lgd", Enabled = true, Name = "Lighting designer"}, - new {Id = "lie", Enabled = true, Name = "Libelant-appellee"}, - new {Id = "lil", Enabled = true, Name = "Libelant"}, - new {Id = "lit", Enabled = true, Name = "Libelant-appellant"}, - new {Id = "lsa", Enabled = true, Name = "Landscape architect"}, - new {Id = "lse", Enabled = true, Name = "Licensee"}, - new {Id = "lso", Enabled = true, Name = "Licensor"}, - new {Id = "ltg", Enabled = true, Name = "Lithographer"}, - new {Id = "lyr", Enabled = true, Name = "Lyricist"}, - new {Id = "mcp", Enabled = true, Name = "Music copyist"}, - new {Id = "mdc", Enabled = true, Name = "Metadata contact"}, - new {Id = "med", Enabled = true, Name = "Medium"}, - new {Id = "mfp", Enabled = true, Name = "Manufacture place"}, - new {Id = "mfr", Enabled = true, Name = "Manufacturer"}, - new {Id = "mod", Enabled = true, Name = "Moderator"}, - new {Id = "mon", Enabled = true, Name = "Monitor"}, - new {Id = "mrb", Enabled = true, Name = "Marbler"}, - new {Id = "mrk", Enabled = true, Name = "Markup editor"}, - new {Id = "msd", Enabled = true, Name = "Musical director"}, - new {Id = "mte", Enabled = true, Name = "Metal-engraver"}, - new {Id = "mtk", Enabled = true, Name = "Minute taker"}, - new {Id = "mus", Enabled = true, Name = "Musician"}, - new {Id = "nrt", Enabled = true, Name = "Narrator"}, - new {Id = "opn", Enabled = true, Name = "Opponent"}, - new {Id = "org", Enabled = true, Name = "Originator"}, - new {Id = "orm", Enabled = true, Name = "Organizer"}, - new {Id = "osp", Enabled = true, Name = "Onscreen presenter"}, - new {Id = "oth", Enabled = true, Name = "Other"}, - new {Id = "own", Enabled = true, Name = "Owner"}, - new {Id = "pan", Enabled = true, Name = "Panelist"}, - new {Id = "pat", Enabled = true, Name = "Patron"}, - new {Id = "pbd", Enabled = true, Name = "Publishing director"}, - new {Id = "pbl", Enabled = true, Name = "Publisher"}, - new {Id = "pdr", Enabled = true, Name = "Project director"}, - new {Id = "pfr", Enabled = true, Name = "Proofreader"}, - new {Id = "pht", Enabled = true, Name = "Photographer"}, - new {Id = "plt", Enabled = true, Name = "Platemaker"}, - new {Id = "pma", Enabled = true, Name = "Permitting agency"}, - new {Id = "pmn", Enabled = true, Name = "Production manager"}, - new {Id = "pop", Enabled = true, Name = "Printer of plates"}, - new {Id = "ppm", Enabled = true, Name = "Papermaker"}, - new {Id = "ppt", Enabled = true, Name = "Puppeteer"}, - new {Id = "pra", Enabled = true, Name = "Praeses"}, - new {Id = "prc", Enabled = true, Name = "Process contact"}, - new {Id = "prd", Enabled = true, Name = "Production personnel"}, - new {Id = "pre", Enabled = true, Name = "Presenter"}, - new {Id = "prf", Enabled = true, Name = "Performer"}, - new {Id = "prg", Enabled = true, Name = "Programmer"}, - new {Id = "prm", Enabled = true, Name = "Printmaker"}, - new {Id = "prn", Enabled = true, Name = "Production company"}, - new {Id = "pro", Enabled = true, Name = "Producer"}, - new {Id = "prp", Enabled = true, Name = "Production place"}, - new {Id = "prs", Enabled = true, Name = "Production designer"}, - new {Id = "prt", Enabled = true, Name = "Printer"}, - new {Id = "prv", Enabled = true, Name = "Provider"}, - new {Id = "pta", Enabled = true, Name = "Patent applicant"}, - new {Id = "pte", Enabled = true, Name = "Plaintiff-appellee"}, - new {Id = "ptf", Enabled = true, Name = "Plaintiff"}, - new {Id = "pth", Enabled = true, Name = "Patent holder"}, - new {Id = "ptt", Enabled = true, Name = "Plaintiff-appellant"}, - new {Id = "pup", Enabled = true, Name = "Publication place"}, - new {Id = "rbr", Enabled = true, Name = "Rubricator"}, - new {Id = "rcd", Enabled = true, Name = "Recordist"}, - new {Id = "rce", Enabled = true, Name = "Recording engineer"}, - new {Id = "rcp", Enabled = true, Name = "Addressee"}, - new {Id = "rdd", Enabled = true, Name = "Radio director"}, - new {Id = "red", Enabled = true, Name = "Redaktor"}, - new {Id = "ren", Enabled = true, Name = "Renderer"}, - new {Id = "res", Enabled = true, Name = "Researcher"}, - new {Id = "rev", Enabled = true, Name = "Reviewer"}, - new {Id = "rpc", Enabled = true, Name = "Radio producer"}, - new {Id = "rps", Enabled = true, Name = "Repository"}, - new {Id = "rpt", Enabled = true, Name = "Reporter"}, - new {Id = "rpy", Enabled = true, Name = "Responsible party"}, - new {Id = "rse", Enabled = true, Name = "Respondent-appellee"}, - new {Id = "rsg", Enabled = true, Name = "Restager"}, - new {Id = "rsp", Enabled = true, Name = "Respondent"}, - new {Id = "rsr", Enabled = true, Name = "Restorationist"}, - new {Id = "rst", Enabled = true, Name = "Respondent-appellant"}, - new {Id = "rth", Enabled = true, Name = "Research team head"}, - new {Id = "rtm", Enabled = true, Name = "Research team member"}, - new {Id = "sad", Enabled = true, Name = "Scientific advisor"}, - new {Id = "sce", Enabled = true, Name = "Scenarist"}, - new {Id = "scl", Enabled = true, Name = "Sculptor"}, - new {Id = "scr", Enabled = true, Name = "Scribe"}, - new {Id = "sds", Enabled = true, Name = "Sound designer"}, - new {Id = "sec", Enabled = true, Name = "Secretary"}, - new {Id = "sgd", Enabled = true, Name = "Stage director"}, - new {Id = "sgn", Enabled = true, Name = "Signer"}, - new {Id = "sht", Enabled = true, Name = "Supporting host"}, - new {Id = "sll", Enabled = true, Name = "Seller"}, - new {Id = "sng", Enabled = true, Name = "Singer"}, - new {Id = "spk", Enabled = true, Name = "Speaker"}, - new {Id = "spn", Enabled = true, Name = "Sponsor"}, - new {Id = "spy", Enabled = true, Name = "Second party"}, - new {Id = "srv", Enabled = true, Name = "Surveyor"}, - new {Id = "std", Enabled = true, Name = "Set designer"}, - new {Id = "stg", Enabled = true, Name = "Setting"}, - new {Id = "stl", Enabled = true, Name = "Storyteller"}, - new {Id = "stm", Enabled = true, Name = "Stage manager"}, - new {Id = "stn", Enabled = true, Name = "Standards body"}, - new {Id = "str", Enabled = true, Name = "Stereotyper"}, - new {Id = "tcd", Enabled = true, Name = "Technical director"}, - new {Id = "tch", Enabled = true, Name = "Teacher"}, - new {Id = "ths", Enabled = true, Name = "Thesis advisor"}, - new {Id = "tld", Enabled = true, Name = "Television director"}, - new {Id = "tlp", Enabled = true, Name = "Television producer"}, - new {Id = "trc", Enabled = true, Name = "Transcriber"}, - new {Id = "trl", Enabled = true, Name = "Translator"}, - new {Id = "tyd", Enabled = true, Name = "Type designer"}, - new {Id = "tyg", Enabled = true, Name = "Typographer"}, - new {Id = "uvp", Enabled = true, Name = "University place"}, - new {Id = "vac", Enabled = true, Name = "Voice actor"}, - new {Id = "vdg", Enabled = true, Name = "Videographer"}, - new {Id = "voc", Enabled = false, Name = "Vocalist"}, - new {Id = "wac", Enabled = true, Name = "Writer of added commentary"}, - new {Id = "wal", Enabled = true, Name = "Writer of added lyrics"}, - new {Id = "wam", Enabled = true, Name = "Writer of accompanying material"}, - new {Id = "wat", Enabled = true, Name = "Writer of added text"}, - new {Id = "wdc", Enabled = true, Name = "Woodcutter"}, - new {Id = "wde", Enabled = true, Name = "Wood engraver"}, - new {Id = "win", Enabled = true, Name = "Writer of introduction"}, - new {Id = "wit", Enabled = true, Name = "Witness"}, - new {Id = "wpr", Enabled = true, Name = "Writer of preface"}, - new {Id = "wst", Enabled = true, Name = "Writer of supplementary textual content"}); + b.HasData(new + { + Id = "abr", Enabled = true, Name = "Abridger" + }, new + { + Id = "acp", Enabled = true, Name = "Art copyist" + }, new + { + Id = "act", Enabled = true, Name = "Actor" + }, new + { + Id = "adi", Enabled = true, Name = "Art director" + }, new + { + Id = "adp", Enabled = true, Name = "Adapter" + }, new + { + Id = "aft", Enabled = true, Name = "Author of afterword, colophon, etc." + }, new + { + Id = "anl", Enabled = true, Name = "Analyst" + }, new + { + Id = "anm", Enabled = true, Name = "Animator" + }, new + { + Id = "ann", Enabled = true, Name = "Annotator" + }, new + { + Id = "ant", Enabled = true, Name = "Bibliographic antecedent" + }, new + { + Id = "ape", Enabled = true, Name = "Appellee" + }, new + { + Id = "apl", Enabled = true, Name = "Appellant" + }, new + { + Id = "app", Enabled = true, Name = "Applicant" + }, new + { + Id = "aqt", Enabled = true, Name = "Author in quotations or text abstracts" + }, new + { + Id = "arc", Enabled = true, Name = "Architect" + }, new + { + Id = "ard", Enabled = true, Name = "Artistic director" + }, new + { + Id = "arr", Enabled = true, Name = "Arranger" + }, new + { + Id = "art", Enabled = true, Name = "Artist" + }, new + { + Id = "asg", Enabled = true, Name = "Assignee" + }, new + { + Id = "asn", Enabled = true, Name = "Associated name" + }, new + { + Id = "ato", Enabled = true, Name = "Autographer" + }, new + { + Id = "att", Enabled = true, Name = "Attributed name" + }, new + { + Id = "auc", Enabled = true, Name = "Auctioneer" + }, new + { + Id = "aud", Enabled = true, Name = "Author of dialog" + }, new + { + Id = "aui", Enabled = true, Name = "Author of introduction, etc." + }, new + { + Id = "aus", Enabled = true, Name = "Screenwriter" + }, new + { + Id = "aut", Enabled = true, Name = "Author" + }, new + { + Id = "bdd", Enabled = true, Name = "Binding designer" + }, new + { + Id = "bjd", Enabled = true, Name = "Bookjacket designer" + }, new + { + Id = "bkd", Enabled = true, Name = "Book designer" + }, new + { + Id = "bkp", Enabled = true, Name = "Book producer" + }, new + { + Id = "blw", Enabled = true, Name = "Blurb writer" + }, new + { + Id = "bnd", Enabled = true, Name = "Binder" + }, new + { + Id = "bpd", Enabled = true, Name = "Bookplate designer" + }, new + { + Id = "brd", Enabled = true, Name = "Broadcaster" + }, new + { + Id = "brl", Enabled = true, Name = "Braille embosser" + }, new + { + Id = "bsl", Enabled = true, Name = "Bookseller" + }, new + { + Id = "cas", Enabled = true, Name = "Caster" + }, new + { + Id = "ccp", Enabled = true, Name = "Conceptor" + }, new + { + Id = "chr", Enabled = true, Name = "Choreographer" + }, new + { + Id = "clb", Enabled = false, Name = "Collaborator" + }, new + { + Id = "cli", Enabled = true, Name = "Client" + }, new + { + Id = "cll", Enabled = true, Name = "Calligrapher" + }, new + { + Id = "clr", Enabled = true, Name = "Colorist" + }, new + { + Id = "clt", Enabled = true, Name = "Collotyper" + }, new + { + Id = "cmm", Enabled = true, Name = "Commentator" + }, new + { + Id = "cmp", Enabled = true, Name = "Composer" + }, new + { + Id = "cmt", Enabled = true, Name = "Compositor" + }, new + { + Id = "cnd", Enabled = true, Name = "Conductor" + }, new + { + Id = "cng", Enabled = true, Name = "Cinematographer" + }, new + { + Id = "cns", Enabled = true, Name = "Censor" + }, new + { + Id = "coe", Enabled = true, Name = "Contestant-appellee" + }, new + { + Id = "col", Enabled = true, Name = "Collector" + }, new + { + Id = "com", Enabled = true, Name = "Compiler" + }, new + { + Id = "con", Enabled = true, Name = "Conservator" + }, new + { + Id = "cor", Enabled = true, Name = "Collection registrar" + }, new + { + Id = "cos", Enabled = true, Name = "Contestant" + }, new + { + Id = "cot", Enabled = true, Name = "Contestant-appellant" + }, new + { + Id = "cou", Enabled = true, Name = "Court governed" + }, new + { + Id = "cov", Enabled = true, Name = "Cover designer" + }, new + { + Id = "cpc", Enabled = true, Name = "Copyright claimant" + }, new + { + Id = "cpe", Enabled = true, Name = "Complainant-appellee" + }, new + { + Id = "cph", Enabled = true, Name = "Copyright holder" + }, new + { + Id = "cpl", Enabled = true, Name = "Complainant" + }, new + { + Id = "cpt", Enabled = true, Name = "Complainant-appellant" + }, new + { + Id = "cre", Enabled = true, Name = "Creator" + }, new + { + Id = "crp", Enabled = true, Name = "Correspondent" + }, new + { + Id = "crr", Enabled = true, Name = "Corrector" + }, new + { + Id = "crt", Enabled = true, Name = "Court reporter" + }, new + { + Id = "csl", Enabled = true, Name = "Consultant" + }, new + { + Id = "csp", Enabled = true, Name = "Consultant to a project" + }, new + { + Id = "cst", Enabled = true, Name = "Costume designer" + }, new + { + Id = "ctb", Enabled = true, Name = "Contributor" + }, new + { + Id = "cte", Enabled = true, Name = "Contestee-appellee" + }, new + { + Id = "ctg", Enabled = true, Name = "Cartographer" + }, new + { + Id = "ctr", Enabled = true, Name = "Contractor" + }, new + { + Id = "cts", Enabled = true, Name = "Contestee" + }, new + { + Id = "ctt", Enabled = true, Name = "Contestee-appellant" + }, new + { + Id = "cur", Enabled = true, Name = "Curator" + }, new + { + Id = "cwt", Enabled = true, Name = "Commentator for written text" + }, new + { + Id = "dbp", Enabled = true, Name = "Distribution place" + }, new + { + Id = "dfd", Enabled = true, Name = "Defendant" + }, new + { + Id = "dfe", Enabled = true, Name = "Defendant-appellee" + }, new + { + Id = "dft", Enabled = true, Name = "Defendant-appellant" + }, new + { + Id = "dgg", Enabled = true, Name = "Degree granting institution" + }, new + { + Id = "dgs", Enabled = true, Name = "Degree supervisor" + }, new + { + Id = "dis", Enabled = true, Name = "Dissertant" + }, new + { + Id = "dln", Enabled = true, Name = "Delineator" + }, new + { + Id = "dnc", Enabled = true, Name = "Dancer" + }, new + { + Id = "dnr", Enabled = true, Name = "Donor" + }, new + { + Id = "dpc", Enabled = true, Name = "Depicted" + }, new + { + Id = "dpt", Enabled = true, Name = "Depositor" + }, new + { + Id = "drm", Enabled = true, Name = "Draftsman" + }, new + { + Id = "drt", Enabled = true, Name = "Director" + }, new + { + Id = "dsr", Enabled = true, Name = "Designer" + }, new + { + Id = "dst", Enabled = true, Name = "Distributor" + }, new + { + Id = "dtc", Enabled = true, Name = "Data contributor" + }, new + { + Id = "dte", Enabled = true, Name = "Dedicatee" + }, new + { + Id = "dtm", Enabled = true, Name = "Data manager" + }, new + { + Id = "dto", Enabled = true, Name = "Dedicator" + }, new + { + Id = "dub", Enabled = true, Name = "Dubious author" + }, new + { + Id = "edc", Enabled = true, Name = "Editor of compilation" + }, new + { + Id = "edm", Enabled = true, Name = "Editor of moving image work" + }, new + { + Id = "edt", Enabled = true, Name = "Editor" + }, new + { + Id = "egr", Enabled = true, Name = "Engraver" + }, new + { + Id = "elg", Enabled = true, Name = "Electrician" + }, new + { + Id = "elt", Enabled = true, Name = "Electrotyper" + }, new + { + Id = "eng", Enabled = true, Name = "Engineer" + }, new + { + Id = "enj", Enabled = true, Name = "Enacting jurisdiction" + }, new + { + Id = "etr", Enabled = true, Name = "Etcher" + }, new + { + Id = "evp", Enabled = true, Name = "Event place" + }, new + { + Id = "exp", Enabled = true, Name = "Expert" + }, new + { + Id = "fac", Enabled = true, Name = "Facsimilist" + }, new + { + Id = "fds", Enabled = true, Name = "Film distributor" + }, new + { + Id = "fld", Enabled = true, Name = "Field director" + }, new + { + Id = "flm", Enabled = true, Name = "Film editor" + }, new + { + Id = "fmd", Enabled = true, Name = "Film director" + }, new + { + Id = "fmk", Enabled = true, Name = "Filmmaker" + }, new + { + Id = "fmo", Enabled = true, Name = "Former owner" + }, new + { + Id = "fmp", Enabled = true, Name = "Film producer" + }, new + { + Id = "fnd", Enabled = true, Name = "Funder" + }, new + { + Id = "fpy", Enabled = true, Name = "First party" + }, new + { + Id = "frg", Enabled = true, Name = "Forger" + }, new + { + Id = "gis", Enabled = true, Name = "Geographic information specialist" + }, new + { + Id = "grt", Enabled = false, Name = "Graphic technician" + }, new + { + Id = "his", Enabled = true, Name = "Host institution" + }, new + { + Id = "hnr", Enabled = true, Name = "Honoree" + }, new + { + Id = "hst", Enabled = true, Name = "Host" + }, new + { + Id = "ill", Enabled = true, Name = "Illustrator" + }, new + { + Id = "ilu", Enabled = true, Name = "Illuminator" + }, new + { + Id = "ins", Enabled = true, Name = "Inscriber" + }, new + { + Id = "inv", Enabled = true, Name = "Inventor" + }, new + { + Id = "isb", Enabled = true, Name = "Issuing body" + }, new + { + Id = "itr", Enabled = true, Name = "Instrumentalist" + }, new + { + Id = "ive", Enabled = true, Name = "Interviewee" + }, new + { + Id = "ivr", Enabled = true, Name = "Interviewer" + }, new + { + Id = "jud", Enabled = true, Name = "Judge" + }, new + { + Id = "jug", Enabled = true, Name = "Jurisdiction governed" + }, new + { + Id = "lbr", Enabled = true, Name = "Laboratory" + }, new + { + Id = "lbt", Enabled = true, Name = "Librettist" + }, new + { + Id = "ldr", Enabled = true, Name = "Laboratory director" + }, new + { + Id = "led", Enabled = true, Name = "Lead" + }, new + { + Id = "lee", Enabled = true, Name = "Libelee-appellee" + }, new + { + Id = "lel", Enabled = true, Name = "Libelee" + }, new + { + Id = "len", Enabled = true, Name = "Lender" + }, new + { + Id = "let", Enabled = true, Name = "Libelee-appellant" + }, new + { + Id = "lgd", Enabled = true, Name = "Lighting designer" + }, new + { + Id = "lie", Enabled = true, Name = "Libelant-appellee" + }, new + { + Id = "lil", Enabled = true, Name = "Libelant" + }, new + { + Id = "lit", Enabled = true, Name = "Libelant-appellant" + }, new + { + Id = "lsa", Enabled = true, Name = "Landscape architect" + }, new + { + Id = "lse", Enabled = true, Name = "Licensee" + }, new + { + Id = "lso", Enabled = true, Name = "Licensor" + }, new + { + Id = "ltg", Enabled = true, Name = "Lithographer" + }, new + { + Id = "lyr", Enabled = true, Name = "Lyricist" + }, new + { + Id = "mcp", Enabled = true, Name = "Music copyist" + }, new + { + Id = "mdc", Enabled = true, Name = "Metadata contact" + }, new + { + Id = "med", Enabled = true, Name = "Medium" + }, new + { + Id = "mfp", Enabled = true, Name = "Manufacture place" + }, new + { + Id = "mfr", Enabled = true, Name = "Manufacturer" + }, new + { + Id = "mod", Enabled = true, Name = "Moderator" + }, new + { + Id = "mon", Enabled = true, Name = "Monitor" + }, new + { + Id = "mrb", Enabled = true, Name = "Marbler" + }, new + { + Id = "mrk", Enabled = true, Name = "Markup editor" + }, new + { + Id = "msd", Enabled = true, Name = "Musical director" + }, new + { + Id = "mte", Enabled = true, Name = "Metal-engraver" + }, new + { + Id = "mtk", Enabled = true, Name = "Minute taker" + }, new + { + Id = "mus", Enabled = true, Name = "Musician" + }, new + { + Id = "nrt", Enabled = true, Name = "Narrator" + }, new + { + Id = "opn", Enabled = true, Name = "Opponent" + }, new + { + Id = "org", Enabled = true, Name = "Originator" + }, new + { + Id = "orm", Enabled = true, Name = "Organizer" + }, new + { + Id = "osp", Enabled = true, Name = "Onscreen presenter" + }, new + { + Id = "oth", Enabled = true, Name = "Other" + }, new + { + Id = "own", Enabled = true, Name = "Owner" + }, new + { + Id = "pan", Enabled = true, Name = "Panelist" + }, new + { + Id = "pat", Enabled = true, Name = "Patron" + }, new + { + Id = "pbd", Enabled = true, Name = "Publishing director" + }, new + { + Id = "pbl", Enabled = true, Name = "Publisher" + }, new + { + Id = "pdr", Enabled = true, Name = "Project director" + }, new + { + Id = "pfr", Enabled = true, Name = "Proofreader" + }, new + { + Id = "pht", Enabled = true, Name = "Photographer" + }, new + { + Id = "plt", Enabled = true, Name = "Platemaker" + }, new + { + Id = "pma", Enabled = true, Name = "Permitting agency" + }, new + { + Id = "pmn", Enabled = true, Name = "Production manager" + }, new + { + Id = "pop", Enabled = true, Name = "Printer of plates" + }, new + { + Id = "ppm", Enabled = true, Name = "Papermaker" + }, new + { + Id = "ppt", Enabled = true, Name = "Puppeteer" + }, new + { + Id = "pra", Enabled = true, Name = "Praeses" + }, new + { + Id = "prc", Enabled = true, Name = "Process contact" + }, new + { + Id = "prd", Enabled = true, Name = "Production personnel" + }, new + { + Id = "pre", Enabled = true, Name = "Presenter" + }, new + { + Id = "prf", Enabled = true, Name = "Performer" + }, new + { + Id = "prg", Enabled = true, Name = "Programmer" + }, new + { + Id = "prm", Enabled = true, Name = "Printmaker" + }, new + { + Id = "prn", Enabled = true, Name = "Production company" + }, new + { + Id = "pro", Enabled = true, Name = "Producer" + }, new + { + Id = "prp", Enabled = true, Name = "Production place" + }, new + { + Id = "prs", Enabled = true, Name = "Production designer" + }, new + { + Id = "prt", Enabled = true, Name = "Printer" + }, new + { + Id = "prv", Enabled = true, Name = "Provider" + }, new + { + Id = "pta", Enabled = true, Name = "Patent applicant" + }, new + { + Id = "pte", Enabled = true, Name = "Plaintiff-appellee" + }, new + { + Id = "ptf", Enabled = true, Name = "Plaintiff" + }, new + { + Id = "pth", Enabled = true, Name = "Patent holder" + }, new + { + Id = "ptt", Enabled = true, Name = "Plaintiff-appellant" + }, new + { + Id = "pup", Enabled = true, Name = "Publication place" + }, new + { + Id = "rbr", Enabled = true, Name = "Rubricator" + }, new + { + Id = "rcd", Enabled = true, Name = "Recordist" + }, new + { + Id = "rce", Enabled = true, Name = "Recording engineer" + }, new + { + Id = "rcp", Enabled = true, Name = "Addressee" + }, new + { + Id = "rdd", Enabled = true, Name = "Radio director" + }, new + { + Id = "red", Enabled = true, Name = "Redaktor" + }, new + { + Id = "ren", Enabled = true, Name = "Renderer" + }, new + { + Id = "res", Enabled = true, Name = "Researcher" + }, new + { + Id = "rev", Enabled = true, Name = "Reviewer" + }, new + { + Id = "rpc", Enabled = true, Name = "Radio producer" + }, new + { + Id = "rps", Enabled = true, Name = "Repository" + }, new + { + Id = "rpt", Enabled = true, Name = "Reporter" + }, new + { + Id = "rpy", Enabled = true, Name = "Responsible party" + }, new + { + Id = "rse", Enabled = true, Name = "Respondent-appellee" + }, new + { + Id = "rsg", Enabled = true, Name = "Restager" + }, new + { + Id = "rsp", Enabled = true, Name = "Respondent" + }, new + { + Id = "rsr", Enabled = true, Name = "Restorationist" + }, new + { + Id = "rst", Enabled = true, Name = "Respondent-appellant" + }, new + { + Id = "rth", Enabled = true, Name = "Research team head" + }, new + { + Id = "rtm", Enabled = true, Name = "Research team member" + }, new + { + Id = "sad", Enabled = true, Name = "Scientific advisor" + }, new + { + Id = "sce", Enabled = true, Name = "Scenarist" + }, new + { + Id = "scl", Enabled = true, Name = "Sculptor" + }, new + { + Id = "scr", Enabled = true, Name = "Scribe" + }, new + { + Id = "sds", Enabled = true, Name = "Sound designer" + }, new + { + Id = "sec", Enabled = true, Name = "Secretary" + }, new + { + Id = "sgd", Enabled = true, Name = "Stage director" + }, new + { + Id = "sgn", Enabled = true, Name = "Signer" + }, new + { + Id = "sht", Enabled = true, Name = "Supporting host" + }, new + { + Id = "sll", Enabled = true, Name = "Seller" + }, new + { + Id = "sng", Enabled = true, Name = "Singer" + }, new + { + Id = "spk", Enabled = true, Name = "Speaker" + }, new + { + Id = "spn", Enabled = true, Name = "Sponsor" + }, new + { + Id = "spy", Enabled = true, Name = "Second party" + }, new + { + Id = "srv", Enabled = true, Name = "Surveyor" + }, new + { + Id = "std", Enabled = true, Name = "Set designer" + }, new + { + Id = "stg", Enabled = true, Name = "Setting" + }, new + { + Id = "stl", Enabled = true, Name = "Storyteller" + }, new + { + Id = "stm", Enabled = true, Name = "Stage manager" + }, new + { + Id = "stn", Enabled = true, Name = "Standards body" + }, new + { + Id = "str", Enabled = true, Name = "Stereotyper" + }, new + { + Id = "tcd", Enabled = true, Name = "Technical director" + }, new + { + Id = "tch", Enabled = true, Name = "Teacher" + }, new + { + Id = "ths", Enabled = true, Name = "Thesis advisor" + }, new + { + Id = "tld", Enabled = true, Name = "Television director" + }, new + { + Id = "tlp", Enabled = true, Name = "Television producer" + }, new + { + Id = "trc", Enabled = true, Name = "Transcriber" + }, new + { + Id = "trl", Enabled = true, Name = "Translator" + }, new + { + Id = "tyd", Enabled = true, Name = "Type designer" + }, new + { + Id = "tyg", Enabled = true, Name = "Typographer" + }, new + { + Id = "uvp", Enabled = true, Name = "University place" + }, new + { + Id = "vac", Enabled = true, Name = "Voice actor" + }, new + { + Id = "vdg", Enabled = true, Name = "Videographer" + }, new + { + Id = "voc", Enabled = false, Name = "Vocalist" + }, new + { + Id = "wac", Enabled = true, Name = "Writer of added commentary" + }, new + { + Id = "wal", Enabled = true, Name = "Writer of added lyrics" + }, new + { + Id = "wam", Enabled = true, Name = "Writer of accompanying material" + }, new + { + Id = "wat", Enabled = true, Name = "Writer of added text" + }, new + { + Id = "wdc", Enabled = true, Name = "Woodcutter" + }, new + { + Id = "wde", Enabled = true, Name = "Wood engraver" + }, new + { + Id = "win", Enabled = true, Name = "Writer of introduction" + }, new + { + Id = "wit", Enabled = true, Name = "Witness" + }, new + { + Id = "wpr", Enabled = true, Name = "Writer of preface" + }, new + { + Id = "wst", Enabled = true, Name = "Writer of supplementary textual content" + }); }); modelBuilder.Entity("Marechai.Database.Models.DocumentsByMachine", b => @@ -750,17 +1293,17 @@ namespace Marechai.Database.Migrations { b.Property("Id").ValueGeneratedOnAdd().HasColumnName("id").HasColumnType("int(11)"); - b.Property("Browser").IsRequired().ValueGeneratedOnAdd().HasColumnName("browser") - .HasColumnType("char(128)").HasDefaultValueSql("''"); + b.Property("Browser").IsRequired().ValueGeneratedOnAdd().HasColumnName("browser"). + HasColumnType("char(128)").HasDefaultValueSql("''"); - b.Property("Date").IsRequired().ValueGeneratedOnAdd().HasColumnName("date") - .HasColumnType("char(20)").HasDefaultValueSql("''"); + b.Property("Date").IsRequired().ValueGeneratedOnAdd().HasColumnName("date"). + HasColumnType("char(20)").HasDefaultValueSql("''"); - b.Property("Ip").IsRequired().ValueGeneratedOnAdd().HasColumnName("ip") - .HasColumnType("char(16)").HasDefaultValueSql("''"); + b.Property("Ip").IsRequired().ValueGeneratedOnAdd().HasColumnName("ip"). + HasColumnType("char(16)").HasDefaultValueSql("''"); - b.Property("Referer").IsRequired().ValueGeneratedOnAdd().HasColumnName("referer") - .HasColumnType("char(255)").HasDefaultValueSql("''"); + b.Property("Referer").IsRequired().ValueGeneratedOnAdd().HasColumnName("referer"). + HasColumnType("char(255)").HasDefaultValueSql("''"); b.HasKey("Id"); @@ -785,11 +1328,11 @@ namespace Marechai.Database.Migrations b.Property("Introduced").HasColumnName("introduced").HasColumnType("datetime"); - b.Property("ModelCode").HasColumnName("model_code").HasColumnType("varchar(45)") - .HasMaxLength(45); + b.Property("ModelCode").HasColumnName("model_code").HasColumnType("varchar(45)"). + HasMaxLength(45); - b.Property("Name").IsRequired().ValueGeneratedOnAdd().HasColumnName("name") - .HasColumnType("char(128)").HasDefaultValueSql("''").HasMaxLength(128); + b.Property("Name").IsRequired().ValueGeneratedOnAdd().HasColumnName("name"). + HasColumnType("char(128)").HasDefaultValueSql("''").HasMaxLength(128); b.Property("Package").HasColumnName("package").HasColumnType("varchar(45)").HasMaxLength(45); @@ -860,8 +1403,8 @@ namespace Marechai.Database.Migrations { b.Property("Id").ValueGeneratedOnAdd().HasColumnName("id").HasColumnType("int(11)"); - b.Property("Name").IsRequired().HasColumnName("instruction_set").HasColumnType("varchar(45)") - .HasMaxLength(45); + b.Property("Name").IsRequired().HasColumnName("instruction_set").HasColumnType("varchar(45)"). + HasMaxLength(45); b.HasKey("Id"); @@ -872,8 +1415,8 @@ namespace Marechai.Database.Migrations { b.Property("Id").ValueGeneratedOnAdd().HasColumnName("id").HasColumnType("int(11)"); - b.Property("Extension").IsRequired().HasColumnName("extension").HasColumnType("varchar(45)") - .HasMaxLength(45); + b.Property("Extension").IsRequired().HasColumnName("extension").HasColumnType("varchar(45)"). + HasMaxLength(45); b.HasKey("Id"); @@ -901,8 +1444,8 @@ namespace Marechai.Database.Migrations { b.Property("Id").ValueGeneratedOnAdd().HasColumnName("id").HasColumnType("smallint(3)"); - b.Property("Name").IsRequired().HasColumnName("name").HasColumnType("varchar(64)") - .HasMaxLength(64); + b.Property("Name").IsRequired().HasColumnName("name").HasColumnType("varchar(64)"). + HasMaxLength(64); b.HasKey("Id"); @@ -923,8 +1466,8 @@ namespace Marechai.Database.Migrations b.Property("Part2T").HasColumnType("char(3)"); - b.Property("ReferenceName").IsRequired().HasColumnName("Ref_Name") - .HasColumnType("varchar(150)"); + b.Property("ReferenceName").IsRequired().HasColumnName("Ref_Name"). + HasColumnType("varchar(150)"); b.Property("Scope").IsRequired().HasColumnType("char(1)"); @@ -977,3270 +1520,1874 @@ namespace Marechai.Database.Migrations b.ToTable("Licenses"); - b.HasData(new {Id = 1, FsfApproved = false, Name = "Fair use", OsiApproved = false}, - new {Id = 2, FsfApproved = false, Name = "Advertisement use", OsiApproved = false}, - new {Id = 3, FsfApproved = false, Name = "All rights reserved", OsiApproved = false}, - new - { - Id = 4, - FsfApproved = false, - Link = "https://spdx.org/licenses/0BSD.html#licenseText", - Name = "BSD Zero Clause License", - OsiApproved = true, - SPDX = "0BSD" - }, - new - { - Id = 5, - FsfApproved = false, - Link = "https://spdx.org/licenses/AAL.html#licenseText", - Name = "Attribution Assurance License", - OsiApproved = true, - SPDX = "AAL" - }, - new - { - Id = 6, - FsfApproved = false, - Link = "https://spdx.org/licenses/Abstyles.html#licenseText", - Name = "Abstyles License", - OsiApproved = false, - SPDX = "Abstyles" - }, - new - { - Id = 7, - FsfApproved = false, - Link = "https://spdx.org/licenses/Adobe-2006.html#licenseText", - Name = "Adobe Systems Incorporated Source Code License Agreement", - OsiApproved = false, - SPDX = "Adobe-2006" - }, - new - { - Id = 8, - FsfApproved = false, - Link = "https://spdx.org/licenses/Adobe-Glyph.html#licenseText", - Name = "Adobe Glyph List License", - OsiApproved = false, - SPDX = "Adobe-Glyph" - }, - new - { - Id = 9, - FsfApproved = false, - Link = "https://spdx.org/licenses/ADSL.html#licenseText", - Name = "Amazon Digital Services License", - OsiApproved = false, - SPDX = "ADSL" - }, - new - { - Id = 10, - FsfApproved = true, - Link = "https://spdx.org/licenses/AFL-1.1.html#licenseText", - Name = "Academic Free License v1.1", - OsiApproved = true, - SPDX = "AFL-1.1" - }, - new - { - Id = 11, - FsfApproved = true, - Link = "https://spdx.org/licenses/AFL-1.2.html#licenseText", - Name = "Academic Free License v1.2", - OsiApproved = true, - SPDX = "AFL-1.2" - }, - new - { - Id = 12, - FsfApproved = true, - Link = "https://spdx.org/licenses/AFL-2.0.html#licenseText", - Name = "Academic Free License v2.0", - OsiApproved = true, - SPDX = "AFL-2.0" - }, - new - { - Id = 13, - FsfApproved = true, - Link = "https://spdx.org/licenses/AFL-2.1.html#licenseText", - Name = "Academic Free License v2.1", - OsiApproved = true, - SPDX = "AFL-2.1" - }, - new - { - Id = 14, - FsfApproved = true, - Link = "https://spdx.org/licenses/AFL-3.0.html#licenseText", - Name = "Academic Free License v3.0", - OsiApproved = true, - SPDX = "AFL-3.0" - }, - new - { - Id = 15, - FsfApproved = false, - Link = "https://spdx.org/licenses/Afmparse.html#licenseText", - Name = "Afmparse License", - OsiApproved = false, - SPDX = "Afmparse" - }, - new - { - Id = 16, - FsfApproved = false, - Link = "https://spdx.org/licenses/AGPL-1.0-only.html#licenseText", - Name = "Affero General Public License v1.0 only", - OsiApproved = false, - SPDX = "AGPL-1.0-only" - }, - new - { - Id = 17, - FsfApproved = false, - Link = "https://spdx.org/licenses/AGPL-1.0-or-later.html#licenseText", - Name = "Affero General Public License v1.0 or later", - OsiApproved = false, - SPDX = "AGPL-1.0-or-later" - }, - new - { - Id = 18, - FsfApproved = true, - Link = "https://spdx.org/licenses/AGPL-3.0-only.html#licenseText", - Name = "GNU Affero General Public License v3.0 only", - OsiApproved = true, - SPDX = "AGPL-3.0-only" - }, - new - { - Id = 19, - FsfApproved = true, - Link = "https://spdx.org/licenses/AGPL-3.0-or-later.html#licenseText", - Name = "GNU Affero General Public License v3.0 or later", - OsiApproved = true, - SPDX = "AGPL-3.0-or-later" - }, - new - { - Id = 20, - FsfApproved = false, - Link = "https://spdx.org/licenses/Aladdin.html#licenseText", - Name = "Aladdin Free Public License", - OsiApproved = false, - SPDX = "Aladdin" - }, - new - { - Id = 21, - FsfApproved = false, - Link = "https://spdx.org/licenses/AMDPLPA.html#licenseText", - Name = "AMD's plpa_map.c License", - OsiApproved = false, - SPDX = "AMDPLPA" - }, - new - { - Id = 22, - FsfApproved = false, - Link = "https://spdx.org/licenses/AML.html#licenseText", - Name = "Apple MIT License", - OsiApproved = false, - SPDX = "AML" - }, - new - { - Id = 23, - FsfApproved = false, - Link = "https://spdx.org/licenses/AMPAS.html#licenseText", - Name = "Academy of Motion Picture Arts and Sciences BSD", - OsiApproved = false, - SPDX = "AMPAS" - }, - new - { - Id = 24, - FsfApproved = false, - Link = "https://spdx.org/licenses/ANTLR-PD.html#licenseText", - Name = "ANTLR Software Rights Notice", - OsiApproved = false, - SPDX = "ANTLR-PD" - }, - new - { - Id = 25, - FsfApproved = true, - Link = "https://spdx.org/licenses/Apache-1.0.html#licenseText", - Name = "Apache License 1.0", - OsiApproved = false, - SPDX = "Apache-1.0" - }, - new - { - Id = 26, - FsfApproved = true, - Link = "https://spdx.org/licenses/Apache-1.1.html#licenseText", - Name = "Apache License 1.1", - OsiApproved = true, - SPDX = "Apache-1.1" - }, - new - { - Id = 27, - FsfApproved = true, - Link = "https://spdx.org/licenses/Apache-2.0.html#licenseText", - Name = "Apache License 2.0", - OsiApproved = true, - SPDX = "Apache-2.0" - }, - new - { - Id = 28, - FsfApproved = false, - Link = "https://spdx.org/licenses/APAFML.html#licenseText", - Name = "Adobe Postscript AFM License", - OsiApproved = false, - SPDX = "APAFML" - }, - new - { - Id = 29, - FsfApproved = false, - Link = "https://spdx.org/licenses/APL-1.0.html#licenseText", - Name = "Adaptive Public License 1.0", - OsiApproved = true, - SPDX = "APL-1.0" - }, - new - { - Id = 30, - FsfApproved = false, - Link = "https://spdx.org/licenses/APSL-1.0.html#licenseText", - Name = "Apple Public Source License 1.0", - OsiApproved = true, - SPDX = "APSL-1.0" - }, - new - { - Id = 31, - FsfApproved = false, - Link = "https://spdx.org/licenses/APSL-1.1.html#licenseText", - Name = "Apple Public Source License 1.1", - OsiApproved = true, - SPDX = "APSL-1.1" - }, - new - { - Id = 32, - FsfApproved = false, - Link = "https://spdx.org/licenses/APSL-1.2.html#licenseText", - Name = "Apple Public Source License 1.2", - OsiApproved = true, - SPDX = "APSL-1.2" - }, - new - { - Id = 33, - FsfApproved = true, - Link = "https://spdx.org/licenses/APSL-2.0.html#licenseText", - Name = "Apple Public Source License 2.0", - OsiApproved = true, - SPDX = "APSL-2.0" - }, - new - { - Id = 34, - FsfApproved = false, - Link = "https://spdx.org/licenses/Artistic-1.0.html#licenseText", - Name = "Artistic License 1.0", - OsiApproved = true, - SPDX = "Artistic-1.0" - }, - new - { - Id = 35, - FsfApproved = false, - Link = "https://spdx.org/licenses/Artistic-1.0-cl8.html#licenseText", - Name = "Artistic License 1.0 w/clause 8", - OsiApproved = true, - SPDX = "Artistic-1.0-cl8" - }, - new - { - Id = 36, - FsfApproved = false, - Link = "https://spdx.org/licenses/Artistic-1.0-Perl.html#licenseText", - Name = "Artistic License 1.0 (Perl)", - OsiApproved = true, - SPDX = "Artistic-1.0-Perl" - }, - new - { - Id = 37, - FsfApproved = true, - Link = "https://spdx.org/licenses/Artistic-2.0.html#licenseText", - Name = "Artistic License 2.0", - OsiApproved = true, - SPDX = "Artistic-2.0" - }, - new - { - Id = 38, - FsfApproved = false, - Link = "https://spdx.org/licenses/Bahyph.html#licenseText", - Name = "Bahyph License", - OsiApproved = false, - SPDX = "Bahyph" - }, - new - { - Id = 39, - FsfApproved = false, - Link = "https://spdx.org/licenses/Barr.html#licenseText", - Name = "Barr License", - OsiApproved = false, - SPDX = "Barr" - }, - new - { - Id = 40, - FsfApproved = false, - Link = "https://spdx.org/licenses/Beerware.html#licenseText", - Name = "Beerware License", - OsiApproved = false, - SPDX = "Beerware" - }, - new - { - Id = 41, - FsfApproved = false, - Link = "https://spdx.org/licenses/BitTorrent-1.0.html#licenseText", - Name = "BitTorrent Open Source License v1.0", - OsiApproved = false, - SPDX = "BitTorrent-1.0" - }, - new - { - Id = 42, - FsfApproved = true, - Link = "https://spdx.org/licenses/BitTorrent-1.1.html#licenseText", - Name = "BitTorrent Open Source License v1.1", - OsiApproved = false, - SPDX = "BitTorrent-1.1" - }, - new - { - Id = 43, - FsfApproved = false, - Link = "https://spdx.org/licenses/Borceux.html#licenseText", - Name = "Borceux license", - OsiApproved = false, - SPDX = "Borceux" - }, - new - { - Id = 44, - FsfApproved = false, - Link = "https://spdx.org/licenses/BSD-1-Clause.html#licenseText", - Name = "BSD 1-Clause License", - OsiApproved = false, - SPDX = "BSD-1-Clause" - }, - new - { - Id = 45, - FsfApproved = false, - Link = "https://spdx.org/licenses/BSD-2-Clause.html#licenseText", - Name = "BSD 2-Clause \"Simplified\" License", - OsiApproved = true, - SPDX = "BSD-2-Clause" - }, - new - { - Id = 46, - FsfApproved = true, - Link = "https://spdx.org/licenses/BSD-2-Clause-FreeBSD.html#licenseText", - Name = "BSD 2-Clause FreeBSD License", - OsiApproved = false, - SPDX = "BSD-2-Clause-FreeBSD" - }, - new - { - Id = 47, - FsfApproved = false, - Link = "https://spdx.org/licenses/BSD-2-Clause-NetBSD.html#licenseText", - Name = "BSD 2-Clause NetBSD License", - OsiApproved = false, - SPDX = "BSD-2-Clause-NetBSD" - }, - new - { - Id = 48, - FsfApproved = false, - Link = "https://spdx.org/licenses/BSD-2-Clause-Patent.html#licenseText", - Name = "BSD-2-Clause Plus Patent License", - OsiApproved = true, - SPDX = "BSD-2-Clause-Patent" - }, - new - { - Id = 49, - FsfApproved = true, - Link = "https://spdx.org/licenses/BSD-3-Clause.html#licenseText", - Name = "BSD 3-Clause \"New\" or \"Revised\" License", - OsiApproved = true, - SPDX = "BSD-3-Clause" - }, - new - { - Id = 50, - FsfApproved = false, - Link = "https://spdx.org/licenses/BSD-3-Clause-Attribution.html#licenseText", - Name = "BSD with attribution", - OsiApproved = false, - SPDX = "BSD-3-Clause-Attribution" - }, - new - { - Id = 51, - FsfApproved = true, - Link = "https://spdx.org/licenses/BSD-3-Clause-Clear.html#licenseText", - Name = "BSD 3-Clause Clear License", - OsiApproved = false, - SPDX = "BSD-3-Clause-Clear" - }, - new - { - Id = 52, - FsfApproved = false, - Link = "https://spdx.org/licenses/BSD-3-Clause-LBNL.html#licenseText", - Name = "Lawrence Berkeley National Labs BSD variant license", - OsiApproved = false, - SPDX = "BSD-3-Clause-LBNL" - }, - new - { - Id = 53, - FsfApproved = false, - Link = - "https://spdx.org/licenses/BSD-3-Clause-No-Nuclear-License.html#licenseText", - Name = "BSD 3-Clause No Nuclear License", - OsiApproved = false, - SPDX = "BSD-3-Clause-No-Nuclear-License" - }, - new - { - Id = 54, - FsfApproved = false, - Link = - "https://spdx.org/licenses/BSD-3-Clause-No-Nuclear-License-2014.html#licenseText", - Name = "BSD 3-Clause No Nuclear License 2014", - OsiApproved = false, - SPDX = "BSD-3-Clause-No-Nuclear-License-2014" - }, - new - { - Id = 55, - FsfApproved = false, - Link = - "https://spdx.org/licenses/BSD-3-Clause-No-Nuclear-Warranty.html#licenseText", - Name = "BSD 3-Clause No Nuclear Warranty", - OsiApproved = false, - SPDX = "BSD-3-Clause-No-Nuclear-Warranty" - }, - new - { - Id = 56, - FsfApproved = true, - Link = "https://spdx.org/licenses/BSD-4-Clause.html#licenseText", - Name = "BSD 4-Clause \"Original\" or \"Old\" License", - OsiApproved = false, - SPDX = "BSD-4-Clause" - }, - new - { - Id = 57, - FsfApproved = false, - Link = "https://spdx.org/licenses/BSD-4-Clause-UC.html#licenseText", - Name = "BSD-4-Clause (University of California-Specific)", - OsiApproved = false, - SPDX = "BSD-4-Clause-UC" - }, - new - { - Id = 58, - FsfApproved = false, - Link = "https://spdx.org/licenses/BSD-Protection.html#licenseText", - Name = "BSD Protection License", - OsiApproved = false, - SPDX = "BSD-Protection" - }, - new - { - Id = 59, - FsfApproved = false, - Link = "https://spdx.org/licenses/BSD-Source-Code.html#licenseText", - Name = "BSD Source Code Attribution", - OsiApproved = false, - SPDX = "BSD-Source-Code" - }, - new - { - Id = 60, - FsfApproved = true, - Link = "https://spdx.org/licenses/BSL-1.0.html#licenseText", - Name = "Boost Software License 1.0", - OsiApproved = true, - SPDX = "BSL-1.0" - }, - new - { - Id = 61, - FsfApproved = false, - Link = "https://spdx.org/licenses/bzip2-1.0.5.html#licenseText", - Name = "bzip2 and libbzip2 License v1.0.5", - OsiApproved = false, - SPDX = "bzip2-1.0.5" - }, - new - { - Id = 62, - FsfApproved = false, - Link = "https://spdx.org/licenses/bzip2-1.0.6.html#licenseText", - Name = "bzip2 and libbzip2 License v1.0.6", - OsiApproved = false, - SPDX = "bzip2-1.0.6" - }, - new - { - Id = 63, - FsfApproved = false, - Link = "https://spdx.org/licenses/Caldera.html#licenseText", - Name = "Caldera License", - OsiApproved = false, - SPDX = "Caldera" - }, - new - { - Id = 64, - FsfApproved = false, - Link = "https://spdx.org/licenses/CATOSL-1.1.html#licenseText", - Name = "Computer Associates Trusted Open Source License 1.1", - OsiApproved = true, - SPDX = "CATOSL-1.1" - }, - new - { - Id = 65, - FsfApproved = false, - Link = "https://spdx.org/licenses/CC-BY-1.0.html#licenseText", - Name = "Creative Commons Attribution 1.0 Generic", - OsiApproved = false, - SPDX = "CC-BY-1.0" - }, - new - { - Id = 66, - FsfApproved = false, - Link = "https://spdx.org/licenses/CC-BY-2.0.html#licenseText", - Name = "Creative Commons Attribution 2.0 Generic", - OsiApproved = false, - SPDX = "CC-BY-2.0" - }, - new - { - Id = 67, - FsfApproved = false, - Link = "https://spdx.org/licenses/CC-BY-2.5.html#licenseText", - Name = "Creative Commons Attribution 2.5 Generic", - OsiApproved = false, - SPDX = "CC-BY-2.5" - }, - new - { - Id = 68, - FsfApproved = false, - Link = "https://spdx.org/licenses/CC-BY-3.0.html#licenseText", - Name = "Creative Commons Attribution 3.0 Unported", - OsiApproved = false, - SPDX = "CC-BY-3.0" - }, - new - { - Id = 69, - FsfApproved = true, - Link = "https://spdx.org/licenses/CC-BY-4.0.html#licenseText", - Name = "Creative Commons Attribution 4.0 International", - OsiApproved = false, - SPDX = "CC-BY-4.0" - }, - new - { - Id = 70, - FsfApproved = false, - Link = "https://spdx.org/licenses/CC-BY-NC-1.0.html#licenseText", - Name = "Creative Commons Attribution Non Commercial 1.0 Generic", - OsiApproved = false, - SPDX = "CC-BY-NC-1.0" - }, - new - { - Id = 71, - FsfApproved = false, - Link = "https://spdx.org/licenses/CC-BY-NC-2.0.html#licenseText", - Name = "Creative Commons Attribution Non Commercial 2.0 Generic", - OsiApproved = false, - SPDX = "CC-BY-NC-2.0" - }, - new - { - Id = 72, - FsfApproved = false, - Link = "https://spdx.org/licenses/CC-BY-NC-2.5.html#licenseText", - Name = "Creative Commons Attribution Non Commercial 2.5 Generic", - OsiApproved = false, - SPDX = "CC-BY-NC-2.5" - }, - new - { - Id = 73, - FsfApproved = false, - Link = "https://spdx.org/licenses/CC-BY-NC-3.0.html#licenseText", - Name = "Creative Commons Attribution Non Commercial 3.0 Unported", - OsiApproved = false, - SPDX = "CC-BY-NC-3.0" - }, - new - { - Id = 74, - FsfApproved = false, - Link = "https://spdx.org/licenses/CC-BY-NC-4.0.html#licenseText", - Name = "Creative Commons Attribution Non Commercial 4.0 International", - OsiApproved = false, - SPDX = "CC-BY-NC-4.0" - }, - new - { - Id = 75, - FsfApproved = false, - Link = "https://spdx.org/licenses/CC-BY-NC-ND-1.0.html#licenseText", - Name = "Creative Commons Attribution Non Commercial No Derivatives 1.0 Generic", - OsiApproved = false, - SPDX = "CC-BY-NC-ND-1.0" - }, - new - { - Id = 76, - FsfApproved = false, - Link = "https://spdx.org/licenses/CC-BY-NC-ND-2.0.html#licenseText", - Name = "Creative Commons Attribution Non Commercial No Derivatives 2.0 Generic", - OsiApproved = false, - SPDX = "CC-BY-NC-ND-2.0" - }, - new - { - Id = 77, - FsfApproved = false, - Link = "https://spdx.org/licenses/CC-BY-NC-ND-2.5.html#licenseText", - Name = "Creative Commons Attribution Non Commercial No Derivatives 2.5 Generic", - OsiApproved = false, - SPDX = "CC-BY-NC-ND-2.5" - }, - new - { - Id = 78, - FsfApproved = false, - Link = "https://spdx.org/licenses/CC-BY-NC-ND-3.0.html#licenseText", - Name = "Creative Commons Attribution Non Commercial No Derivatives 3.0 Unported", - OsiApproved = false, - SPDX = "CC-BY-NC-ND-3.0" - }, - new - { - Id = 79, - FsfApproved = false, - Link = "https://spdx.org/licenses/CC-BY-NC-ND-4.0.html#licenseText", - Name = - "Creative Commons Attribution Non Commercial No Derivatives 4.0 International", - OsiApproved = false, - SPDX = "CC-BY-NC-ND-4.0" - }, - new - { - Id = 80, - FsfApproved = false, - Link = "https://spdx.org/licenses/CC-BY-NC-SA-1.0.html#licenseText", - Name = "Creative Commons Attribution Non Commercial Share Alike 1.0 Generic", - OsiApproved = false, - SPDX = "CC-BY-NC-SA-1.0" - }, - new - { - Id = 81, - FsfApproved = false, - Link = "https://spdx.org/licenses/CC-BY-NC-SA-2.0.html#licenseText", - Name = "Creative Commons Attribution Non Commercial Share Alike 2.0 Generic", - OsiApproved = false, - SPDX = "CC-BY-NC-SA-2.0" - }, - new - { - Id = 82, - FsfApproved = false, - Link = "https://spdx.org/licenses/CC-BY-NC-SA-2.5.html#licenseText", - Name = "Creative Commons Attribution Non Commercial Share Alike 2.5 Generic", - OsiApproved = false, - SPDX = "CC-BY-NC-SA-2.5" - }, - new - { - Id = 83, - FsfApproved = false, - Link = "https://spdx.org/licenses/CC-BY-NC-SA-3.0.html#licenseText", - Name = "Creative Commons Attribution Non Commercial Share Alike 3.0 Unported", - OsiApproved = false, - SPDX = "CC-BY-NC-SA-3.0" - }, - new - { - Id = 84, - FsfApproved = false, - Link = "https://spdx.org/licenses/CC-BY-NC-SA-4.0.html#licenseText", - Name = "Creative Commons Attribution Non Commercial Share Alike 4.0 International", - OsiApproved = false, - SPDX = "CC-BY-NC-SA-4.0" - }, - new - { - Id = 85, - FsfApproved = false, - Link = "https://spdx.org/licenses/CC-BY-ND-1.0.html#licenseText", - Name = "Creative Commons Attribution No Derivatives 1.0 Generic", - OsiApproved = false, - SPDX = "CC-BY-ND-1.0" - }, - new - { - Id = 86, - FsfApproved = false, - Link = "https://spdx.org/licenses/CC-BY-ND-2.0.html#licenseText", - Name = "Creative Commons Attribution No Derivatives 2.0 Generic", - OsiApproved = false, - SPDX = "CC-BY-ND-2.0" - }, - new - { - Id = 87, - FsfApproved = false, - Link = "https://spdx.org/licenses/CC-BY-ND-2.5.html#licenseText", - Name = "Creative Commons Attribution No Derivatives 2.5 Generic", - OsiApproved = false, - SPDX = "CC-BY-ND-2.5" - }, - new - { - Id = 88, - FsfApproved = false, - Link = "https://spdx.org/licenses/CC-BY-ND-3.0.html#licenseText", - Name = "Creative Commons Attribution No Derivatives 3.0 Unported", - OsiApproved = false, - SPDX = "CC-BY-ND-3.0" - }, - new - { - Id = 89, - FsfApproved = false, - Link = "https://spdx.org/licenses/CC-BY-ND-4.0.html#licenseText", - Name = "Creative Commons Attribution No Derivatives 4.0 International", - OsiApproved = false, - SPDX = "CC-BY-ND-4.0" - }, - new - { - Id = 90, - FsfApproved = false, - Link = "https://spdx.org/licenses/CC-BY-SA-1.0.html#licenseText", - Name = "Creative Commons Attribution Share Alike 1.0 Generic", - OsiApproved = false, - SPDX = "CC-BY-SA-1.0" - }, - new - { - Id = 91, - FsfApproved = false, - Link = "https://spdx.org/licenses/CC-BY-SA-2.0.html#licenseText", - Name = "Creative Commons Attribution Share Alike 2.0 Generic", - OsiApproved = false, - SPDX = "CC-BY-SA-2.0" - }, - new - { - Id = 92, - FsfApproved = false, - Link = "https://spdx.org/licenses/CC-BY-SA-2.5.html#licenseText", - Name = "Creative Commons Attribution Share Alike 2.5 Generic", - OsiApproved = false, - SPDX = "CC-BY-SA-2.5" - }, - new - { - Id = 93, - FsfApproved = false, - Link = "https://spdx.org/licenses/CC-BY-SA-3.0.html#licenseText", - Name = "Creative Commons Attribution Share Alike 3.0 Unported", - OsiApproved = false, - SPDX = "CC-BY-SA-3.0" - }, - new - { - Id = 94, - FsfApproved = true, - Link = "https://spdx.org/licenses/CC-BY-SA-4.0.html#licenseText", - Name = "Creative Commons Attribution Share Alike 4.0 International", - OsiApproved = false, - SPDX = "CC-BY-SA-4.0" - }, - new - { - Id = 95, - FsfApproved = true, - Link = "https://spdx.org/licenses/CC0-1.0.html#licenseText", - Name = "Creative Commons Zero v1.0 Universal", - OsiApproved = false, - SPDX = "CC0-1.0" - }, - new - { - Id = 96, - FsfApproved = true, - Link = "https://spdx.org/licenses/CDDL-1.0.html#licenseText", - Name = "Common Development and Distribution License 1.0", - OsiApproved = true, - SPDX = "CDDL-1.0" - }, - new - { - Id = 97, - FsfApproved = false, - Link = "https://spdx.org/licenses/CDDL-1.1.html#licenseText", - Name = "Common Development and Distribution License 1.1", - OsiApproved = false, - SPDX = "CDDL-1.1" - }, - new - { - Id = 98, - FsfApproved = false, - Link = "https://spdx.org/licenses/CDLA-Permissive-1.0.html#licenseText", - Name = "Community Data License Agreement Permissive 1.0", - OsiApproved = false, - SPDX = "CDLA-Permissive-1.0" - }, - new - { - Id = 99, - FsfApproved = false, - Link = "https://spdx.org/licenses/CDLA-Sharing-1.0.html#licenseText", - Name = "Community Data License Agreement Sharing 1.0", - OsiApproved = false, - SPDX = "CDLA-Sharing-1.0" - }, - new - { - Id = 100, - FsfApproved = false, - Link = "https://spdx.org/licenses/CECILL-1.0.html#licenseText", - Name = "CeCILL Free Software License Agreement v1.0", - OsiApproved = false, - SPDX = "CECILL-1.0" - }, - new - { - Id = 101, - FsfApproved = false, - Link = "https://spdx.org/licenses/CECILL-1.1.html#licenseText", - Name = "CeCILL Free Software License Agreement v1.1", - OsiApproved = false, - SPDX = "CECILL-1.1" - }, - new - { - Id = 102, - FsfApproved = true, - Link = "https://spdx.org/licenses/CECILL-2.0.html#licenseText", - Name = "CeCILL Free Software License Agreement v2.0", - OsiApproved = false, - SPDX = "CECILL-2.0" - }, - new - { - Id = 103, - FsfApproved = false, - Link = "https://spdx.org/licenses/CECILL-2.1.html#licenseText", - Name = "CeCILL Free Software License Agreement v2.1", - OsiApproved = true, - SPDX = "CECILL-2.1" - }, - new - { - Id = 104, - FsfApproved = true, - Link = "https://spdx.org/licenses/CECILL-B.html#licenseText", - Name = "CeCILL-B Free Software License Agreement", - OsiApproved = false, - SPDX = "CECILL-B" - }, - new - { - Id = 105, - FsfApproved = true, - Link = "https://spdx.org/licenses/CECILL-C.html#licenseText", - Name = "CeCILL-C Free Software License Agreement", - OsiApproved = false, - SPDX = "CECILL-C" - }, - new - { - Id = 106, - FsfApproved = false, - Link = "https://spdx.org/licenses/CERN-OHL-1.1.html#licenseText", - Name = "CERN Open Hardware License v1.1", - OsiApproved = false, - SPDX = "CERN-OHL-1.1" - }, - new - { - Id = 107, - FsfApproved = false, - Link = "https://spdx.org/licenses/CERN-OHL-1.2.html#licenseText", - Name = "CERN Open Hardware Licence v1.2", - OsiApproved = false, - SPDX = "CERN-OHL-1.2" - }, - new - { - Id = 108, - FsfApproved = true, - Link = "https://spdx.org/licenses/ClArtistic.html#licenseText", - Name = "Clarified Artistic License", - OsiApproved = false, - SPDX = "ClArtistic" - }, - new - { - Id = 109, - FsfApproved = false, - Link = "https://spdx.org/licenses/CNRI-Jython.html#licenseText", - Name = "CNRI Jython License", - OsiApproved = false, - SPDX = "CNRI-Jython" - }, - new - { - Id = 110, - FsfApproved = false, - Link = "https://spdx.org/licenses/CNRI-Python.html#licenseText", - Name = "CNRI Python License", - OsiApproved = true, - SPDX = "CNRI-Python" - }, - new - { - Id = 111, - FsfApproved = false, - Link = "https://spdx.org/licenses/CNRI-Python-GPL-Compatible.html#licenseText", - Name = "CNRI Python Open Source GPL Compatible License Agreement", - OsiApproved = false, - SPDX = "CNRI-Python-GPL-Compatible" - }, - new - { - Id = 112, - FsfApproved = true, - Link = "https://spdx.org/licenses/Condor-1.1.html#licenseText", - Name = "Condor Public License v1.1", - OsiApproved = false, - SPDX = "Condor-1.1" - }, - new - { - Id = 113, - FsfApproved = false, - Link = "https://spdx.org/licenses/copyleft-next-0.3.0.html#licenseText", - Name = "copyleft-next 0.3.0", - OsiApproved = false, - SPDX = "copyleft-next-0.3.0" - }, - new - { - Id = 114, - FsfApproved = false, - Link = "https://spdx.org/licenses/copyleft-next-0.3.1.html#licenseText", - Name = "copyleft-next 0.3.1", - OsiApproved = false, - SPDX = "copyleft-next-0.3.1" - }, - new - { - Id = 115, - FsfApproved = true, - Link = "https://spdx.org/licenses/CPAL-1.0.html#licenseText", - Name = "Common Public Attribution License 1.0", - OsiApproved = true, - SPDX = "CPAL-1.0" - }, - new - { - Id = 116, - FsfApproved = true, - Link = "https://spdx.org/licenses/CPL-1.0.html#licenseText", - Name = "Common Public License 1.0", - OsiApproved = true, - SPDX = "CPL-1.0" - }, - new - { - Id = 117, - FsfApproved = false, - Link = "https://spdx.org/licenses/CPOL-1.02.html#licenseText", - Name = "Code Project Open License 1.02", - OsiApproved = false, - SPDX = "CPOL-1.02" - }, - new - { - Id = 118, - FsfApproved = false, - Link = "https://spdx.org/licenses/Crossword.html#licenseText", - Name = "Crossword License", - OsiApproved = false, - SPDX = "Crossword" - }, - new - { - Id = 119, - FsfApproved = false, - Link = "https://spdx.org/licenses/CrystalStacker.html#licenseText", - Name = "CrystalStacker License", - OsiApproved = false, - SPDX = "CrystalStacker" - }, - new - { - Id = 120, - FsfApproved = false, - Link = "https://spdx.org/licenses/CUA-OPL-1.0.html#licenseText", - Name = "CUA Office Public License v1.0", - OsiApproved = true, - SPDX = "CUA-OPL-1.0" - }, - new - { - Id = 121, - FsfApproved = false, - Link = "https://spdx.org/licenses/Cube.html#licenseText", - Name = "Cube License", - OsiApproved = false, - SPDX = "Cube" - }, - new - { - Id = 122, - FsfApproved = false, - Link = "https://spdx.org/licenses/curl.html#licenseText", - Name = "curl License", - OsiApproved = false, - SPDX = "curl" - }, - new - { - Id = 123, - FsfApproved = false, - Link = "https://spdx.org/licenses/D-FSL-1.0.html#licenseText", - Name = "Deutsche Freie Software Lizenz", - OsiApproved = false, - SPDX = "D-FSL-1.0" - }, - new - { - Id = 124, - FsfApproved = false, - Link = "https://spdx.org/licenses/diffmark.html#licenseText", - Name = "diffmark license", - OsiApproved = false, - SPDX = "diffmark" - }, - new - { - Id = 125, - FsfApproved = false, - Link = "https://spdx.org/licenses/DOC.html#licenseText", - Name = "DOC License", - OsiApproved = false, - SPDX = "DOC" - }, - new - { - Id = 126, - FsfApproved = false, - Link = "https://spdx.org/licenses/Dotseqn.html#licenseText", - Name = "Dotseqn License", - OsiApproved = false, - SPDX = "Dotseqn" - }, - new - { - Id = 127, - FsfApproved = false, - Link = "https://spdx.org/licenses/DSDP.html#licenseText", - Name = "DSDP License", - OsiApproved = false, - SPDX = "DSDP" - }, - new - { - Id = 128, - FsfApproved = false, - Link = "https://spdx.org/licenses/dvipdfm.html#licenseText", - Name = "dvipdfm License", - OsiApproved = false, - SPDX = "dvipdfm" - }, - new - { - Id = 129, - FsfApproved = false, - Link = "https://spdx.org/licenses/ECL-1.0.html#licenseText", - Name = "Educational Community License v1.0", - OsiApproved = true, - SPDX = "ECL-1.0" - }, - new - { - Id = 130, - FsfApproved = true, - Link = "https://spdx.org/licenses/ECL-2.0.html#licenseText", - Name = "Educational Community License v2.0", - OsiApproved = true, - SPDX = "ECL-2.0" - }, - new - { - Id = 131, - FsfApproved = false, - Link = "https://spdx.org/licenses/EFL-1.0.html#licenseText", - Name = "Eiffel Forum License v1.0", - OsiApproved = true, - SPDX = "EFL-1.0" - }, - new - { - Id = 132, - FsfApproved = true, - Link = "https://spdx.org/licenses/EFL-2.0.html#licenseText", - Name = "Eiffel Forum License v2.0", - OsiApproved = true, - SPDX = "EFL-2.0" - }, - new - { - Id = 133, - FsfApproved = false, - Link = "https://spdx.org/licenses/eGenix.html#licenseText", - Name = "eGenix.com Public License 1.1.0", - OsiApproved = false, - SPDX = "eGenix" - }, - new - { - Id = 134, - FsfApproved = false, - Link = "https://spdx.org/licenses/Entessa.html#licenseText", - Name = "Entessa Public License v1.0", - OsiApproved = true, - SPDX = "Entessa" - }, - new - { - Id = 135, - FsfApproved = true, - Link = "https://spdx.org/licenses/EPL-1.0.html#licenseText", - Name = "Eclipse Public License 1.0", - OsiApproved = true, - SPDX = "EPL-1.0" - }, - new - { - Id = 136, - FsfApproved = true, - Link = "https://spdx.org/licenses/EPL-2.0.html#licenseText", - Name = "Eclipse Public License 2.0", - OsiApproved = true, - SPDX = "EPL-2.0" - }, - new - { - Id = 137, - FsfApproved = false, - Link = "https://spdx.org/licenses/ErlPL-1.1.html#licenseText", - Name = "Erlang Public License v1.1", - OsiApproved = false, - SPDX = "ErlPL-1.1" - }, - new - { - Id = 138, - FsfApproved = true, - Link = "https://spdx.org/licenses/EUDatagrid.html#licenseText", - Name = "EU DataGrid Software License", - OsiApproved = true, - SPDX = "EUDatagrid" - }, - new - { - Id = 139, - FsfApproved = false, - Link = "https://spdx.org/licenses/EUPL-1.0.html#licenseText", - Name = "European Union Public License 1.0", - OsiApproved = false, - SPDX = "EUPL-1.0" - }, - new - { - Id = 140, - FsfApproved = true, - Link = "https://spdx.org/licenses/EUPL-1.1.html#licenseText", - Name = "European Union Public License 1.1", - OsiApproved = true, - SPDX = "EUPL-1.1" - }, - new - { - Id = 141, - FsfApproved = true, - Link = "https://spdx.org/licenses/EUPL-1.2.html#licenseText", - Name = "European Union Public License 1.2", - OsiApproved = true, - SPDX = "EUPL-1.2" - }, - new - { - Id = 142, - FsfApproved = false, - Link = "https://spdx.org/licenses/Eurosym.html#licenseText", - Name = "Eurosym License", - OsiApproved = false, - SPDX = "Eurosym" - }, - new - { - Id = 143, - FsfApproved = false, - Link = "https://spdx.org/licenses/Fair.html#licenseText", - Name = "Fair License", - OsiApproved = true, - SPDX = "Fair" - }, - new - { - Id = 144, - FsfApproved = false, - Link = "https://spdx.org/licenses/Frameworx-1.0.html#licenseText", - Name = "Frameworx Open License 1.0", - OsiApproved = true, - SPDX = "Frameworx-1.0" - }, - new - { - Id = 145, - FsfApproved = false, - Link = "https://spdx.org/licenses/FreeImage.html#licenseText", - Name = "FreeImage Public License v1.0", - OsiApproved = false, - SPDX = "FreeImage" - }, - new - { - Id = 146, - FsfApproved = true, - Link = "https://spdx.org/licenses/FSFAP.html#licenseText", - Name = "FSF All Permissive License", - OsiApproved = false, - SPDX = "FSFAP" - }, - new - { - Id = 147, - FsfApproved = false, - Link = "https://spdx.org/licenses/FSFUL.html#licenseText", - Name = "FSF Unlimited License", - OsiApproved = false, - SPDX = "FSFUL" - }, - new - { - Id = 148, - FsfApproved = false, - Link = "https://spdx.org/licenses/FSFULLR.html#licenseText", - Name = "FSF Unlimited License (with License Retention)", - OsiApproved = false, - SPDX = "FSFULLR" - }, - new - { - Id = 149, - FsfApproved = true, - Link = "https://spdx.org/licenses/FTL.html#licenseText", - Name = "Freetype Project License", - OsiApproved = false, - SPDX = "FTL" - }, - new - { - Id = 150, - FsfApproved = true, - Link = "https://spdx.org/licenses/GFDL-1.1-only.html#licenseText", - Name = "GNU Free Documentation License v1.1 only", - OsiApproved = false, - SPDX = "GFDL-1.1-only" - }, - new - { - Id = 151, - FsfApproved = true, - Link = "https://spdx.org/licenses/GFDL-1.1-or-later.html#licenseText", - Name = "GNU Free Documentation License v1.1 or later", - OsiApproved = false, - SPDX = "GFDL-1.1-or-later" - }, - new - { - Id = 152, - FsfApproved = true, - Link = "https://spdx.org/licenses/GFDL-1.2-only.html#licenseText", - Name = "GNU Free Documentation License v1.2 only", - OsiApproved = false, - SPDX = "GFDL-1.2-only" - }, - new - { - Id = 153, - FsfApproved = true, - Link = "https://spdx.org/licenses/GFDL-1.2-or-later.html#licenseText", - Name = "GNU Free Documentation License v1.2 or later", - OsiApproved = false, - SPDX = "GFDL-1.2-or-later" - }, - new - { - Id = 154, - FsfApproved = true, - Link = "https://spdx.org/licenses/GFDL-1.3-only.html#licenseText", - Name = "GNU Free Documentation License v1.3 only", - OsiApproved = false, - SPDX = "GFDL-1.3-only" - }, - new - { - Id = 155, - FsfApproved = true, - Link = "https://spdx.org/licenses/GFDL-1.3-or-later.html#licenseText", - Name = "GNU Free Documentation License v1.3 or later", - OsiApproved = false, - SPDX = "GFDL-1.3-or-later" - }, - new - { - Id = 156, - FsfApproved = false, - Link = "https://spdx.org/licenses/Giftware.html#licenseText", - Name = "Giftware License", - OsiApproved = false, - SPDX = "Giftware" - }, - new - { - Id = 157, - FsfApproved = false, - Link = "https://spdx.org/licenses/GL2PS.html#licenseText", - Name = "GL2PS License", - OsiApproved = false, - SPDX = "GL2PS" - }, - new - { - Id = 158, - FsfApproved = false, - Link = "https://spdx.org/licenses/Glide.html#licenseText", - Name = "3dfx Glide License", - OsiApproved = false, - SPDX = "Glide" - }, - new - { - Id = 159, - FsfApproved = false, - Link = "https://spdx.org/licenses/Glulxe.html#licenseText", - Name = "Glulxe License", - OsiApproved = false, - SPDX = "Glulxe" - }, - new - { - Id = 160, - FsfApproved = true, - Link = "https://spdx.org/licenses/gnuplot.html#licenseText", - Name = "gnuplot License", - OsiApproved = false, - SPDX = "gnuplot" - }, - new - { - Id = 161, - FsfApproved = false, - Link = "https://spdx.org/licenses/GPL-1.0-only.html#licenseText", - Name = "GNU General Public License v1.0 only", - OsiApproved = false, - SPDX = "GPL-1.0-only" - }, - new - { - Id = 162, - FsfApproved = false, - Link = "https://spdx.org/licenses/GPL-1.0-or-later.html#licenseText", - Name = "GNU General Public License v1.0 or later", - OsiApproved = false, - SPDX = "GPL-1.0-or-later" - }, - new - { - Id = 163, - FsfApproved = true, - Link = "https://spdx.org/licenses/GPL-2.0-only.html#licenseText", - Name = "GNU General Public License v2.0 only", - OsiApproved = true, - SPDX = "GPL-2.0-only" - }, - new - { - Id = 164, - FsfApproved = true, - Link = "https://spdx.org/licenses/GPL-2.0-or-later.html#licenseText", - Name = "GNU General Public License v2.0 or later", - OsiApproved = true, - SPDX = "GPL-2.0-or-later" - }, - new - { - Id = 165, - FsfApproved = true, - Link = "https://spdx.org/licenses/GPL-3.0-only.html#licenseText", - Name = "GNU General Public License v3.0 only", - OsiApproved = true, - SPDX = "GPL-3.0-only" - }, - new - { - Id = 166, - FsfApproved = true, - Link = "https://spdx.org/licenses/GPL-3.0-or-later.html#licenseText", - Name = "GNU General Public License v3.0 or later", - OsiApproved = true, - SPDX = "GPL-3.0-or-later" - }, - new - { - Id = 167, - FsfApproved = false, - Link = "https://spdx.org/licenses/gSOAP-1.3b.html#licenseText", - Name = "gSOAP Public License v1.3b", - OsiApproved = false, - SPDX = "gSOAP-1.3b" - }, - new - { - Id = 168, - FsfApproved = false, - Link = "https://spdx.org/licenses/HaskellReport.html#licenseText", - Name = "Haskell Language Report License", - OsiApproved = false, - SPDX = "HaskellReport" - }, - new - { - Id = 169, - FsfApproved = true, - Link = "https://spdx.org/licenses/HPND.html#licenseText", - Name = "Historical Permission Notice and Disclaimer", - OsiApproved = true, - SPDX = "HPND" - }, - new - { - Id = 170, - FsfApproved = false, - Link = "https://spdx.org/licenses/HPND-sell-variant.html#licenseText", - Name = "Historical Permission Notice and Disclaimer - sell variant", - OsiApproved = false, - SPDX = "HPND-sell-variant" - }, - new - { - Id = 171, - FsfApproved = false, - Link = "https://spdx.org/licenses/IBM-pibs.html#licenseText", - Name = "IBM PowerPC Initialization and Boot Software", - OsiApproved = false, - SPDX = "IBM-pibs" - }, - new - { - Id = 172, - FsfApproved = false, - Link = "https://spdx.org/licenses/ICU.html#licenseText", - Name = "ICU License", - OsiApproved = false, - SPDX = "ICU" - }, - new - { - Id = 173, - FsfApproved = true, - Link = "https://spdx.org/licenses/IJG.html#licenseText", - Name = "Independent JPEG Group License", - OsiApproved = false, - SPDX = "IJG" - }, - new - { - Id = 174, - FsfApproved = false, - Link = "https://spdx.org/licenses/ImageMagick.html#licenseText", - Name = "ImageMagick License", - OsiApproved = false, - SPDX = "ImageMagick" - }, - new - { - Id = 175, - FsfApproved = true, - Link = "https://spdx.org/licenses/iMatix.html#licenseText", - Name = "iMatix Standard Function Library Agreement", - OsiApproved = false, - SPDX = "iMatix" - }, - new - { - Id = 176, - FsfApproved = true, - Link = "https://spdx.org/licenses/Imlib2.html#licenseText", - Name = "Imlib2 License", - OsiApproved = false, - SPDX = "Imlib2" - }, - new - { - Id = 177, - FsfApproved = false, - Link = "https://spdx.org/licenses/Info-ZIP.html#licenseText", - Name = "Info-ZIP License", - OsiApproved = false, - SPDX = "Info-ZIP" - }, - new - { - Id = 178, - FsfApproved = true, - Link = "https://spdx.org/licenses/Intel.html#licenseText", - Name = "Intel Open Source License", - OsiApproved = true, - SPDX = "Intel" - }, - new - { - Id = 179, - FsfApproved = false, - Link = "https://spdx.org/licenses/Intel-ACPI.html#licenseText", - Name = "Intel ACPI Software License Agreement", - OsiApproved = false, - SPDX = "Intel-ACPI" - }, - new - { - Id = 180, - FsfApproved = false, - Link = "https://spdx.org/licenses/Interbase-1.0.html#licenseText", - Name = "Interbase Public License v1.0", - OsiApproved = false, - SPDX = "Interbase-1.0" - }, - new - { - Id = 181, - FsfApproved = true, - Link = "https://spdx.org/licenses/IPA.html#licenseText", - Name = "IPA Font License", - OsiApproved = true, - SPDX = "IPA" - }, - new - { - Id = 182, - FsfApproved = true, - Link = "https://spdx.org/licenses/IPL-1.0.html#licenseText", - Name = "IBM Public License v1.0", - OsiApproved = true, - SPDX = "IPL-1.0" - }, - new - { - Id = 183, - FsfApproved = true, - Link = "https://spdx.org/licenses/ISC.html#licenseText", - Name = "ISC License", - OsiApproved = true, - SPDX = "ISC" - }, - new - { - Id = 184, - FsfApproved = false, - Link = "https://spdx.org/licenses/JasPer-2.0.html#licenseText", - Name = "JasPer License", - OsiApproved = false, - SPDX = "JasPer-2.0" - }, - new - { - Id = 185, - FsfApproved = false, - Link = "https://spdx.org/licenses/JPNIC.html#licenseText", - Name = "Japan Network Information Center License", - OsiApproved = false, - SPDX = "JPNIC" - }, - new - { - Id = 186, - FsfApproved = false, - Link = "https://spdx.org/licenses/JSON.html#licenseText", - Name = "JSON License", - OsiApproved = false, - SPDX = "JSON" - }, - new - { - Id = 187, - FsfApproved = false, - Link = "https://spdx.org/licenses/LAL-1.2.html#licenseText", - Name = "Licence Art Libre 1.2", - OsiApproved = false, - SPDX = "LAL-1.2" - }, - new - { - Id = 188, - FsfApproved = false, - Link = "https://spdx.org/licenses/LAL-1.3.html#licenseText", - Name = "Licence Art Libre 1.3", - OsiApproved = false, - SPDX = "LAL-1.3" - }, - new - { - Id = 189, - FsfApproved = false, - Link = "https://spdx.org/licenses/Latex2e.html#licenseText", - Name = "Latex2e License", - OsiApproved = false, - SPDX = "Latex2e" - }, - new - { - Id = 190, - FsfApproved = false, - Link = "https://spdx.org/licenses/Leptonica.html#licenseText", - Name = "Leptonica License", - OsiApproved = false, - SPDX = "Leptonica" - }, - new - { - Id = 191, - FsfApproved = false, - Link = "https://spdx.org/licenses/LGPL-2.0-only.html#licenseText", - Name = "GNU Library General Public License v2 only", - OsiApproved = true, - SPDX = "LGPL-2.0-only" - }, - new - { - Id = 192, - FsfApproved = false, - Link = "https://spdx.org/licenses/LGPL-2.0-or-later.html#licenseText", - Name = "GNU Library General Public License v2 or later", - OsiApproved = true, - SPDX = "LGPL-2.0-or-later" - }, - new - { - Id = 193, - FsfApproved = true, - Link = "https://spdx.org/licenses/LGPL-2.1-only.html#licenseText", - Name = "GNU Lesser General Public License v2.1 only", - OsiApproved = true, - SPDX = "LGPL-2.1-only" - }, - new - { - Id = 194, - FsfApproved = true, - Link = "https://spdx.org/licenses/LGPL-2.1-or-later.html#licenseText", - Name = "GNU Lesser General Public License v2.1 or later", - OsiApproved = true, - SPDX = "LGPL-2.1-or-later" - }, - new - { - Id = 195, - FsfApproved = true, - Link = "https://spdx.org/licenses/LGPL-3.0-only.html#licenseText", - Name = "GNU Lesser General Public License v3.0 only", - OsiApproved = true, - SPDX = "LGPL-3.0-only" - }, - new - { - Id = 196, - FsfApproved = true, - Link = "https://spdx.org/licenses/LGPL-3.0-or-later.html#licenseText", - Name = "GNU Lesser General Public License v3.0 or later", - OsiApproved = true, - SPDX = "LGPL-3.0-or-later" - }, - new - { - Id = 197, - FsfApproved = false, - Link = "https://spdx.org/licenses/LGPLLR.html#licenseText", - Name = "Lesser General Public License For Linguistic Resources", - OsiApproved = false, - SPDX = "LGPLLR" - }, - new - { - Id = 198, - FsfApproved = false, - Link = "https://spdx.org/licenses/Libpng.html#licenseText", - Name = "libpng License", - OsiApproved = false, - SPDX = "Libpng" - }, - new - { - Id = 199, - FsfApproved = false, - Link = "https://spdx.org/licenses/libpng-2.0.html#licenseText", - Name = "PNG Reference Library version 2", - OsiApproved = false, - SPDX = "libpng-2.0" - }, - new - { - Id = 200, - FsfApproved = false, - Link = "https://spdx.org/licenses/libtiff.html#licenseText", - Name = "libtiff License", - OsiApproved = false, - SPDX = "libtiff" - }, - new - { - Id = 201, - FsfApproved = false, - Link = "https://spdx.org/licenses/LiLiQ-P-1.1.html#licenseText", - Name = "Licence Libre du Québec – Permissive version 1.1", - OsiApproved = true, - SPDX = "LiLiQ-P-1.1" - }, - new - { - Id = 202, - FsfApproved = false, - Link = "https://spdx.org/licenses/LiLiQ-R-1.1.html#licenseText", - Name = "Licence Libre du Québec – Réciprocité version 1.1", - OsiApproved = true, - SPDX = "LiLiQ-R-1.1" - }, - new - { - Id = 203, - FsfApproved = false, - Link = "https://spdx.org/licenses/LiLiQ-Rplus-1.1.html#licenseText", - Name = "Licence Libre du Québec – Réciprocité forte version 1.1", - OsiApproved = true, - SPDX = "LiLiQ-Rplus-1.1" - }, - new - { - Id = 204, - FsfApproved = false, - Link = "https://spdx.org/licenses/Linux-OpenIB.html#licenseText", - Name = "Linux Kernel Variant of OpenIB.org license", - OsiApproved = false, - SPDX = "Linux-OpenIB" - }, - new - { - Id = 205, - FsfApproved = false, - Link = "https://spdx.org/licenses/LPL-1.0.html#licenseText", - Name = "Lucent Public License Version 1.0", - OsiApproved = true, - SPDX = "LPL-1.0" - }, - new - { - Id = 206, - FsfApproved = true, - Link = "https://spdx.org/licenses/LPL-1.02.html#licenseText", - Name = "Lucent Public License v1.02", - OsiApproved = true, - SPDX = "LPL-1.02" - }, - new - { - Id = 207, - FsfApproved = false, - Link = "https://spdx.org/licenses/LPPL-1.0.html#licenseText", - Name = "LaTeX Project Public License v1.0", - OsiApproved = false, - SPDX = "LPPL-1.0" - }, - new - { - Id = 208, - FsfApproved = false, - Link = "https://spdx.org/licenses/LPPL-1.1.html#licenseText", - Name = "LaTeX Project Public License v1.1", - OsiApproved = false, - SPDX = "LPPL-1.1" - }, - new - { - Id = 209, - FsfApproved = true, - Link = "https://spdx.org/licenses/LPPL-1.2.html#licenseText", - Name = "LaTeX Project Public License v1.2", - OsiApproved = false, - SPDX = "LPPL-1.2" - }, - new - { - Id = 210, - FsfApproved = true, - Link = "https://spdx.org/licenses/LPPL-1.3a.html#licenseText", - Name = "LaTeX Project Public License v1.3a", - OsiApproved = false, - SPDX = "LPPL-1.3a" - }, - new - { - Id = 211, - FsfApproved = false, - Link = "https://spdx.org/licenses/LPPL-1.3c.html#licenseText", - Name = "LaTeX Project Public License v1.3c", - OsiApproved = true, - SPDX = "LPPL-1.3c" - }, - new - { - Id = 212, - FsfApproved = false, - Link = "https://spdx.org/licenses/MakeIndex.html#licenseText", - Name = "MakeIndex License", - OsiApproved = false, - SPDX = "MakeIndex" - }, - new - { - Id = 213, - FsfApproved = false, - Link = "https://spdx.org/licenses/MirOS.html#licenseText", - Name = "MirOS License", - OsiApproved = true, - SPDX = "MirOS" - }, - new - { - Id = 214, - FsfApproved = true, - Link = "https://spdx.org/licenses/MIT.html#licenseText", - Name = "MIT License", - OsiApproved = true, - SPDX = "MIT" - }, - new - { - Id = 215, - FsfApproved = false, - Link = "https://spdx.org/licenses/MIT-0.html#licenseText", - Name = "MIT No Attribution", - OsiApproved = true, - SPDX = "MIT-0" - }, - new - { - Id = 216, - FsfApproved = false, - Link = "https://spdx.org/licenses/MIT-advertising.html#licenseText", - Name = "Enlightenment License (e16)", - OsiApproved = false, - SPDX = "MIT-advertising" - }, - new - { - Id = 217, - FsfApproved = false, - Link = "https://spdx.org/licenses/MIT-CMU.html#licenseText", - Name = "CMU License", - OsiApproved = false, - SPDX = "MIT-CMU" - }, - new - { - Id = 218, - FsfApproved = false, - Link = "https://spdx.org/licenses/MIT-enna.html#licenseText", - Name = "enna License", - OsiApproved = false, - SPDX = "MIT-enna" - }, - new - { - Id = 219, - FsfApproved = false, - Link = "https://spdx.org/licenses/MIT-feh.html#licenseText", - Name = "feh License", - OsiApproved = false, - SPDX = "MIT-feh" - }, - new - { - Id = 220, - FsfApproved = false, - Link = "https://spdx.org/licenses/MITNFA.html#licenseText", - Name = "MIT +no-false-attribs license", - OsiApproved = false, - SPDX = "MITNFA" - }, - new - { - Id = 221, - FsfApproved = false, - Link = "https://spdx.org/licenses/Motosoto.html#licenseText", - Name = "Motosoto License", - OsiApproved = true, - SPDX = "Motosoto" - }, - new - { - Id = 222, - FsfApproved = false, - Link = "https://spdx.org/licenses/mpich2.html#licenseText", - Name = "mpich2 License", - OsiApproved = false, - SPDX = "mpich2" - }, - new - { - Id = 223, - FsfApproved = false, - Link = "https://spdx.org/licenses/MPL-1.0.html#licenseText", - Name = "Mozilla Public License 1.0", - OsiApproved = true, - SPDX = "MPL-1.0" - }, - new - { - Id = 224, - FsfApproved = true, - Link = "https://spdx.org/licenses/MPL-1.1.html#licenseText", - Name = "Mozilla Public License 1.1", - OsiApproved = true, - SPDX = "MPL-1.1" - }, - new - { - Id = 225, - FsfApproved = true, - Link = "https://spdx.org/licenses/MPL-2.0.html#licenseText", - Name = "Mozilla Public License 2.0", - OsiApproved = true, - SPDX = "MPL-2.0" - }, - new - { - Id = 226, - FsfApproved = false, - Link = "https://spdx.org/licenses/MPL-2.0-no-copyleft-exception.html#licenseText", - Name = "Mozilla Public License 2.0 (no copyleft exception)", - OsiApproved = true, - SPDX = "MPL-2.0-no-copyleft-exception" - }, - new - { - Id = 227, - FsfApproved = true, - Link = "https://spdx.org/licenses/MS-PL.html#licenseText", - Name = "Microsoft Public License", - OsiApproved = true, - SPDX = "MS-PL" - }, - new - { - Id = 228, - FsfApproved = true, - Link = "https://spdx.org/licenses/MS-RL.html#licenseText", - Name = "Microsoft Reciprocal License", - OsiApproved = true, - SPDX = "MS-RL" - }, - new - { - Id = 229, - FsfApproved = false, - Link = "https://spdx.org/licenses/MTLL.html#licenseText", - Name = "Matrix Template Library License", - OsiApproved = false, - SPDX = "MTLL" - }, - new - { - Id = 230, - FsfApproved = false, - Link = "https://spdx.org/licenses/Multics.html#licenseText", - Name = "Multics License", - OsiApproved = true, - SPDX = "Multics" - }, - new - { - Id = 231, - FsfApproved = false, - Link = "https://spdx.org/licenses/Mup.html#licenseText", - Name = "Mup License", - OsiApproved = false, - SPDX = "Mup" - }, - new - { - Id = 232, - FsfApproved = false, - Link = "https://spdx.org/licenses/NASA-1.3.html#licenseText", - Name = "NASA Open Source Agreement 1.3", - OsiApproved = true, - SPDX = "NASA-1.3" - }, - new - { - Id = 233, - FsfApproved = false, - Link = "https://spdx.org/licenses/Naumen.html#licenseText", - Name = "Naumen Public License", - OsiApproved = true, - SPDX = "Naumen" - }, - new - { - Id = 234, - FsfApproved = false, - Link = "https://spdx.org/licenses/NBPL-1.0.html#licenseText", - Name = "Net Boolean Public License v1", - OsiApproved = false, - SPDX = "NBPL-1.0" - }, - new - { - Id = 235, - FsfApproved = true, - Link = "https://spdx.org/licenses/NCSA.html#licenseText", - Name = "University of Illinois/NCSA Open Source License", - OsiApproved = true, - SPDX = "NCSA" - }, - new - { - Id = 236, - FsfApproved = false, - Link = "https://spdx.org/licenses/Net-SNMP.html#licenseText", - Name = "Net-SNMP License", - OsiApproved = false, - SPDX = "Net-SNMP" - }, - new - { - Id = 237, - FsfApproved = false, - Link = "https://spdx.org/licenses/NetCDF.html#licenseText", - Name = "NetCDF license", - OsiApproved = false, - SPDX = "NetCDF" - }, - new - { - Id = 238, - FsfApproved = false, - Link = "https://spdx.org/licenses/Newsletr.html#licenseText", - Name = "Newsletr License", - OsiApproved = false, - SPDX = "Newsletr" - }, - new - { - Id = 239, - FsfApproved = false, - Link = "https://spdx.org/licenses/NGPL.html#licenseText", - Name = "Nethack General Public License", - OsiApproved = true, - SPDX = "NGPL" - }, - new - { - Id = 240, - FsfApproved = false, - Link = "https://spdx.org/licenses/NLOD-1.0.html#licenseText", - Name = "Norwegian Licence for Open Government Data", - OsiApproved = false, - SPDX = "NLOD-1.0" - }, - new - { - Id = 241, - FsfApproved = false, - Link = "https://spdx.org/licenses/NLPL.html#licenseText", - Name = "No Limit Public License", - OsiApproved = false, - SPDX = "NLPL" - }, - new - { - Id = 242, - FsfApproved = true, - Link = "https://spdx.org/licenses/Nokia.html#licenseText", - Name = "Nokia Open Source License", - OsiApproved = true, - SPDX = "Nokia" - }, - new - { - Id = 243, - FsfApproved = true, - Link = "https://spdx.org/licenses/NOSL.html#licenseText", - Name = "Netizen Open Source License", - OsiApproved = false, - SPDX = "NOSL" - }, - new - { - Id = 244, - FsfApproved = false, - Link = "https://spdx.org/licenses/Noweb.html#licenseText", - Name = "Noweb License", - OsiApproved = false, - SPDX = "Noweb" - }, - new - { - Id = 245, - FsfApproved = true, - Link = "https://spdx.org/licenses/NPL-1.0.html#licenseText", - Name = "Netscape Public License v1.0", - OsiApproved = false, - SPDX = "NPL-1.0" - }, - new - { - Id = 246, - FsfApproved = true, - Link = "https://spdx.org/licenses/NPL-1.1.html#licenseText", - Name = "Netscape Public License v1.1", - OsiApproved = false, - SPDX = "NPL-1.1" - }, - new - { - Id = 247, - FsfApproved = false, - Link = "https://spdx.org/licenses/NPOSL-3.0.html#licenseText", - Name = "Non-Profit Open Software License 3.0", - OsiApproved = true, - SPDX = "NPOSL-3.0" - }, - new - { - Id = 248, - FsfApproved = false, - Link = "https://spdx.org/licenses/NRL.html#licenseText", - Name = "NRL License", - OsiApproved = false, - SPDX = "NRL" - }, - new - { - Id = 249, - FsfApproved = false, - Link = "https://spdx.org/licenses/NTP.html#licenseText", - Name = "NTP License", - OsiApproved = true, - SPDX = "NTP" - }, - new - { - Id = 250, - FsfApproved = false, - Link = "https://spdx.org/licenses/OCCT-PL.html#licenseText", - Name = "Open CASCADE Technology Public License", - OsiApproved = false, - SPDX = "OCCT-PL" - }, - new - { - Id = 251, - FsfApproved = false, - Link = "https://spdx.org/licenses/OCLC-2.0.html#licenseText", - Name = "OCLC Research Public License 2.0", - OsiApproved = true, - SPDX = "OCLC-2.0" - }, - new - { - Id = 252, - FsfApproved = true, - Link = "https://spdx.org/licenses/ODbL-1.0.html#licenseText", - Name = "ODC Open Database License v1.0", - OsiApproved = false, - SPDX = "ODbL-1.0" - }, - new - { - Id = 253, - FsfApproved = false, - Link = "https://spdx.org/licenses/ODC-By-1.0.html#licenseText", - Name = "Open Data Commons Attribution License v1.0", - OsiApproved = false, - SPDX = "ODC-By-1.0" - }, - new - { - Id = 254, - FsfApproved = true, - Link = "https://spdx.org/licenses/OFL-1.0.html#licenseText", - Name = "SIL Open Font License 1.0", - OsiApproved = false, - SPDX = "OFL-1.0" - }, - new - { - Id = 255, - FsfApproved = true, - Link = "https://spdx.org/licenses/OFL-1.1.html#licenseText", - Name = "SIL Open Font License 1.1", - OsiApproved = true, - SPDX = "OFL-1.1" - }, - new - { - Id = 256, - FsfApproved = false, - Link = "https://spdx.org/licenses/OGL-UK-1.0.html#licenseText", - Name = "Open Government Licence v1.0", - OsiApproved = false, - SPDX = "OGL-UK-1.0" - }, - new - { - Id = 257, - FsfApproved = false, - Link = "https://spdx.org/licenses/OGL-UK-2.0.html#licenseText", - Name = "Open Government Licence v2.0", - OsiApproved = false, - SPDX = "OGL-UK-2.0" - }, - new - { - Id = 258, - FsfApproved = false, - Link = "https://spdx.org/licenses/OGL-UK-3.0.html#licenseText", - Name = "Open Government Licence v3.0", - OsiApproved = false, - SPDX = "OGL-UK-3.0" - }, - new - { - Id = 259, - FsfApproved = false, - Link = "https://spdx.org/licenses/OGTSL.html#licenseText", - Name = "Open Group Test Suite License", - OsiApproved = true, - SPDX = "OGTSL" - }, - new - { - Id = 260, - FsfApproved = false, - Link = "https://spdx.org/licenses/OLDAP-1.1.html#licenseText", - Name = "Open LDAP Public License v1.1", - OsiApproved = false, - SPDX = "OLDAP-1.1" - }, - new - { - Id = 261, - FsfApproved = false, - Link = "https://spdx.org/licenses/OLDAP-1.2.html#licenseText", - Name = "Open LDAP Public License v1.2", - OsiApproved = false, - SPDX = "OLDAP-1.2" - }, - new - { - Id = 262, - FsfApproved = false, - Link = "https://spdx.org/licenses/OLDAP-1.3.html#licenseText", - Name = "Open LDAP Public License v1.3", - OsiApproved = false, - SPDX = "OLDAP-1.3" - }, - new - { - Id = 263, - FsfApproved = false, - Link = "https://spdx.org/licenses/OLDAP-1.4.html#licenseText", - Name = "Open LDAP Public License v1.4", - OsiApproved = false, - SPDX = "OLDAP-1.4" - }, - new - { - Id = 264, - FsfApproved = false, - Link = "https://spdx.org/licenses/OLDAP-2.0.html#licenseText", - Name = "Open LDAP Public License v2.0 (or possibly 2.0A and 2.0B)", - OsiApproved = false, - SPDX = "OLDAP-2.0" - }, - new - { - Id = 265, - FsfApproved = false, - Link = "https://spdx.org/licenses/OLDAP-2.0.1.html#licenseText", - Name = "Open LDAP Public License v2.0.1", - OsiApproved = false, - SPDX = "OLDAP-2.0.1" - }, - new - { - Id = 266, - FsfApproved = false, - Link = "https://spdx.org/licenses/OLDAP-2.1.html#licenseText", - Name = "Open LDAP Public License v2.1", - OsiApproved = false, - SPDX = "OLDAP-2.1" - }, - new - { - Id = 267, - FsfApproved = false, - Link = "https://spdx.org/licenses/OLDAP-2.2.html#licenseText", - Name = "Open LDAP Public License v2.2", - OsiApproved = false, - SPDX = "OLDAP-2.2" - }, - new - { - Id = 268, - FsfApproved = false, - Link = "https://spdx.org/licenses/OLDAP-2.2.1.html#licenseText", - Name = "Open LDAP Public License v2.2.1", - OsiApproved = false, - SPDX = "OLDAP-2.2.1" - }, - new - { - Id = 269, - FsfApproved = false, - Link = "https://spdx.org/licenses/OLDAP-2.2.2.html#licenseText", - Name = "Open LDAP Public License 2.2.2", - OsiApproved = false, - SPDX = "OLDAP-2.2.2" - }, - new - { - Id = 270, - FsfApproved = true, - Link = "https://spdx.org/licenses/OLDAP-2.3.html#licenseText", - Name = "Open LDAP Public License v2.3", - OsiApproved = false, - SPDX = "OLDAP-2.3" - }, - new - { - Id = 271, - FsfApproved = false, - Link = "https://spdx.org/licenses/OLDAP-2.4.html#licenseText", - Name = "Open LDAP Public License v2.4", - OsiApproved = false, - SPDX = "OLDAP-2.4" - }, - new - { - Id = 272, - FsfApproved = false, - Link = "https://spdx.org/licenses/OLDAP-2.5.html#licenseText", - Name = "Open LDAP Public License v2.5", - OsiApproved = false, - SPDX = "OLDAP-2.5" - }, - new - { - Id = 273, - FsfApproved = false, - Link = "https://spdx.org/licenses/OLDAP-2.6.html#licenseText", - Name = "Open LDAP Public License v2.6", - OsiApproved = false, - SPDX = "OLDAP-2.6" - }, - new - { - Id = 274, - FsfApproved = true, - Link = "https://spdx.org/licenses/OLDAP-2.7.html#licenseText", - Name = "Open LDAP Public License v2.7", - OsiApproved = false, - SPDX = "OLDAP-2.7" - }, - new - { - Id = 275, - FsfApproved = false, - Link = "https://spdx.org/licenses/OLDAP-2.8.html#licenseText", - Name = "Open LDAP Public License v2.8", - OsiApproved = false, - SPDX = "OLDAP-2.8" - }, - new - { - Id = 276, - FsfApproved = false, - Link = "https://spdx.org/licenses/OML.html#licenseText", - Name = "Open Market License", - OsiApproved = false, - SPDX = "OML" - }, - new - { - Id = 277, - FsfApproved = true, - Link = "https://spdx.org/licenses/OpenSSL.html#licenseText", - Name = "OpenSSL License", - OsiApproved = false, - SPDX = "OpenSSL" - }, - new - { - Id = 278, - FsfApproved = false, - Link = "https://spdx.org/licenses/OPL-1.0.html#licenseText", - Name = "Open Public License v1.0", - OsiApproved = false, - SPDX = "OPL-1.0" - }, - new - { - Id = 279, - FsfApproved = false, - Link = "https://spdx.org/licenses/OSET-PL-2.1.html#licenseText", - Name = "OSET Public License version 2.1", - OsiApproved = true, - SPDX = "OSET-PL-2.1" - }, - new - { - Id = 280, - FsfApproved = true, - Link = "https://spdx.org/licenses/OSL-1.0.html#licenseText", - Name = "Open Software License 1.0", - OsiApproved = true, - SPDX = "OSL-1.0" - }, - new - { - Id = 281, - FsfApproved = true, - Link = "https://spdx.org/licenses/OSL-1.1.html#licenseText", - Name = "Open Software License 1.1", - OsiApproved = false, - SPDX = "OSL-1.1" - }, - new - { - Id = 282, - FsfApproved = true, - Link = "https://spdx.org/licenses/OSL-2.0.html#licenseText", - Name = "Open Software License 2.0", - OsiApproved = true, - SPDX = "OSL-2.0" - }, - new - { - Id = 283, - FsfApproved = true, - Link = "https://spdx.org/licenses/OSL-2.1.html#licenseText", - Name = "Open Software License 2.1", - OsiApproved = true, - SPDX = "OSL-2.1" - }, - new - { - Id = 284, - FsfApproved = true, - Link = "https://spdx.org/licenses/OSL-3.0.html#licenseText", - Name = "Open Software License 3.0", - OsiApproved = true, - SPDX = "OSL-3.0" - }, - new - { - Id = 285, - FsfApproved = false, - Link = "https://spdx.org/licenses/PDDL-1.0.html#licenseText", - Name = "ODC Public Domain Dedication & License 1.0", - OsiApproved = false, - SPDX = "PDDL-1.0" - }, - new - { - Id = 286, - FsfApproved = false, - Link = "https://spdx.org/licenses/PHP-3.0.html#licenseText", - Name = "PHP License v3.0", - OsiApproved = true, - SPDX = "PHP-3.0" - }, - new - { - Id = 287, - FsfApproved = true, - Link = "https://spdx.org/licenses/PHP-3.01.html#licenseText", - Name = "PHP License v3.01", - OsiApproved = false, - SPDX = "PHP-3.01" - }, - new - { - Id = 288, - FsfApproved = false, - Link = "https://spdx.org/licenses/Plexus.html#licenseText", - Name = "Plexus Classworlds License", - OsiApproved = false, - SPDX = "Plexus" - }, - new - { - Id = 289, - FsfApproved = false, - Link = "https://spdx.org/licenses/PostgreSQL.html#licenseText", - Name = "PostgreSQL License", - OsiApproved = true, - SPDX = "PostgreSQL" - }, - new - { - Id = 290, - FsfApproved = false, - Link = "https://spdx.org/licenses/psfrag.html#licenseText", - Name = "psfrag License", - OsiApproved = false, - SPDX = "psfrag" - }, - new - { - Id = 291, - FsfApproved = false, - Link = "https://spdx.org/licenses/psutils.html#licenseText", - Name = "psutils License", - OsiApproved = false, - SPDX = "psutils" - }, - new - { - Id = 292, - FsfApproved = true, - Link = "https://spdx.org/licenses/Python-2.0.html#licenseText", - Name = "Python License 2.0", - OsiApproved = true, - SPDX = "Python-2.0" - }, - new - { - Id = 293, - FsfApproved = false, - Link = "https://spdx.org/licenses/Qhull.html#licenseText", - Name = "Qhull License", - OsiApproved = false, - SPDX = "Qhull" - }, - new - { - Id = 294, - FsfApproved = true, - Link = "https://spdx.org/licenses/QPL-1.0.html#licenseText", - Name = "Q Public License 1.0", - OsiApproved = true, - SPDX = "QPL-1.0" - }, - new - { - Id = 295, - FsfApproved = false, - Link = "https://spdx.org/licenses/Rdisc.html#licenseText", - Name = "Rdisc License", - OsiApproved = false, - SPDX = "Rdisc" - }, - new - { - Id = 296, - FsfApproved = false, - Link = "https://spdx.org/licenses/RHeCos-1.1.html#licenseText", - Name = "Red Hat eCos Public License v1.1", - OsiApproved = false, - SPDX = "RHeCos-1.1" - }, - new - { - Id = 297, - FsfApproved = false, - Link = "https://spdx.org/licenses/RPL-1.1.html#licenseText", - Name = "Reciprocal Public License 1.1", - OsiApproved = true, - SPDX = "RPL-1.1" - }, - new - { - Id = 298, - FsfApproved = false, - Link = "https://spdx.org/licenses/RPL-1.5.html#licenseText", - Name = "Reciprocal Public License 1.5", - OsiApproved = true, - SPDX = "RPL-1.5" - }, - new - { - Id = 299, - FsfApproved = true, - Link = "https://spdx.org/licenses/RPSL-1.0.html#licenseText", - Name = "RealNetworks Public Source License v1.0", - OsiApproved = true, - SPDX = "RPSL-1.0" - }, - new - { - Id = 300, - FsfApproved = false, - Link = "https://spdx.org/licenses/RSA-MD.html#licenseText", - Name = "RSA Message-Digest License", - OsiApproved = false, - SPDX = "RSA-MD" - }, - new - { - Id = 301, - FsfApproved = false, - Link = "https://spdx.org/licenses/RSCPL.html#licenseText", - Name = "Ricoh Source Code Public License", - OsiApproved = true, - SPDX = "RSCPL" - }, - new - { - Id = 302, - FsfApproved = true, - Link = "https://spdx.org/licenses/Ruby.html#licenseText", - Name = "Ruby License", - OsiApproved = false, - SPDX = "Ruby" - }, - new - { - Id = 303, - FsfApproved = false, - Link = "https://spdx.org/licenses/SAX-PD.html#licenseText", - Name = "Sax Public Domain Notice", - OsiApproved = false, - SPDX = "SAX-PD" - }, - new - { - Id = 304, - FsfApproved = false, - Link = "https://spdx.org/licenses/Saxpath.html#licenseText", - Name = "Saxpath License", - OsiApproved = false, - SPDX = "Saxpath" - }, - new - { - Id = 305, - FsfApproved = false, - Link = "https://spdx.org/licenses/SCEA.html#licenseText", - Name = "SCEA Shared Source License", - OsiApproved = false, - SPDX = "SCEA" - }, - new - { - Id = 306, - FsfApproved = false, - Link = "https://spdx.org/licenses/Sendmail.html#licenseText", - Name = "Sendmail License", - OsiApproved = false, - SPDX = "Sendmail" - }, - new - { - Id = 307, - FsfApproved = false, - Link = "https://spdx.org/licenses/Sendmail-8.23.html#licenseText", - Name = "Sendmail License 8.23", - OsiApproved = false, - SPDX = "Sendmail-8.23" - }, - new - { - Id = 308, - FsfApproved = false, - Link = "https://spdx.org/licenses/SGI-B-1.0.html#licenseText", - Name = "SGI Free Software License B v1.0", - OsiApproved = false, - SPDX = "SGI-B-1.0" - }, - new - { - Id = 309, - FsfApproved = false, - Link = "https://spdx.org/licenses/SGI-B-1.1.html#licenseText", - Name = "SGI Free Software License B v1.1", - OsiApproved = false, - SPDX = "SGI-B-1.1" - }, - new - { - Id = 310, - FsfApproved = true, - Link = "https://spdx.org/licenses/SGI-B-2.0.html#licenseText", - Name = "SGI Free Software License B v2.0", - OsiApproved = false, - SPDX = "SGI-B-2.0" - }, - new - { - Id = 311, - FsfApproved = false, - Link = "https://spdx.org/licenses/SimPL-2.0.html#licenseText", - Name = "Simple Public License 2.0", - OsiApproved = true, - SPDX = "SimPL-2.0" - }, - new - { - Id = 312, - FsfApproved = true, - Link = "https://spdx.org/licenses/SISSL.html#licenseText", - Name = "Sun Industry Standards Source License v1.1", - OsiApproved = true, - SPDX = "SISSL" - }, - new - { - Id = 313, - FsfApproved = false, - Link = "https://spdx.org/licenses/SISSL-1.2.html#licenseText", - Name = "Sun Industry Standards Source License v1.2", - OsiApproved = false, - SPDX = "SISSL-1.2" - }, - new - { - Id = 314, - FsfApproved = true, - Link = "https://spdx.org/licenses/Sleepycat.html#licenseText", - Name = "Sleepycat License", - OsiApproved = true, - SPDX = "Sleepycat" - }, - new - { - Id = 315, - FsfApproved = true, - Link = "https://spdx.org/licenses/SMLNJ.html#licenseText", - Name = "Standard ML of New Jersey License", - OsiApproved = false, - SPDX = "SMLNJ" - }, - new - { - Id = 316, - FsfApproved = false, - Link = "https://spdx.org/licenses/SMPPL.html#licenseText", - Name = "Secure Messaging Protocol Public License", - OsiApproved = false, - SPDX = "SMPPL" - }, - new - { - Id = 317, - FsfApproved = false, - Link = "https://spdx.org/licenses/SNIA.html#licenseText", - Name = "SNIA Public License 1.1", - OsiApproved = false, - SPDX = "SNIA" - }, - new - { - Id = 318, - FsfApproved = false, - Link = "https://spdx.org/licenses/Spencer-86.html#licenseText", - Name = "Spencer License 86", - OsiApproved = false, - SPDX = "Spencer-86" - }, - new - { - Id = 319, - FsfApproved = false, - Link = "https://spdx.org/licenses/Spencer-94.html#licenseText", - Name = "Spencer License 94", - OsiApproved = false, - SPDX = "Spencer-94" - }, - new - { - Id = 320, - FsfApproved = false, - Link = "https://spdx.org/licenses/Spencer-99.html#licenseText", - Name = "Spencer License 99", - OsiApproved = false, - SPDX = "Spencer-99" - }, - new - { - Id = 321, - FsfApproved = true, - Link = "https://spdx.org/licenses/SPL-1.0.html#licenseText", - Name = "Sun Public License v1.0", - OsiApproved = true, - SPDX = "SPL-1.0" - }, - new - { - Id = 322, - FsfApproved = false, - Link = "https://spdx.org/licenses/SugarCRM-1.1.3.html#licenseText", - Name = "SugarCRM Public License v1.1.3", - OsiApproved = false, - SPDX = "SugarCRM-1.1.3" - }, - new - { - Id = 323, - FsfApproved = false, - Link = "https://spdx.org/licenses/SWL.html#licenseText", - Name = "Scheme Widget Library (SWL) Software License Agreement", - OsiApproved = false, - SPDX = "SWL" - }, - new - { - Id = 324, - FsfApproved = false, - Link = "https://spdx.org/licenses/TAPR-OHL-1.0.html#licenseText", - Name = "TAPR Open Hardware License v1.0", - OsiApproved = false, - SPDX = "TAPR-OHL-1.0" - }, - new - { - Id = 325, - FsfApproved = false, - Link = "https://spdx.org/licenses/TCL.html#licenseText", - Name = "TCL/TK License", - OsiApproved = false, - SPDX = "TCL" - }, - new - { - Id = 326, - FsfApproved = false, - Link = "https://spdx.org/licenses/TCP-wrappers.html#licenseText", - Name = "TCP Wrappers License", - OsiApproved = false, - SPDX = "TCP-wrappers" - }, - new - { - Id = 327, - FsfApproved = false, - Link = "https://spdx.org/licenses/TMate.html#licenseText", - Name = "TMate Open Source License", - OsiApproved = false, - SPDX = "TMate" - }, - new - { - Id = 328, - FsfApproved = false, - Link = "https://spdx.org/licenses/TORQUE-1.1.html#licenseText", - Name = "TORQUE v2.5+ Software License v1.1", - OsiApproved = false, - SPDX = "TORQUE-1.1" - }, - new - { - Id = 329, - FsfApproved = false, - Link = "https://spdx.org/licenses/TOSL.html#licenseText", - Name = "Trusster Open Source License", - OsiApproved = false, - SPDX = "TOSL" - }, - new - { - Id = 330, - FsfApproved = false, - Link = "https://spdx.org/licenses/TU-Berlin-1.0.html#licenseText", - Name = "Technische Universitaet Berlin License 1.0", - OsiApproved = false, - SPDX = "TU-Berlin-1.0" - }, - new - { - Id = 331, - FsfApproved = false, - Link = "https://spdx.org/licenses/TU-Berlin-2.0.html#licenseText", - Name = "Technische Universitaet Berlin License 2.0", - OsiApproved = false, - SPDX = "TU-Berlin-2.0" - }, - new - { - Id = 332, - FsfApproved = false, - Link = "https://spdx.org/licenses/Unicode-DFS-2015.html#licenseText", - Name = "Unicode License Agreement - Data Files and Software (2015)", - OsiApproved = false, - SPDX = "Unicode-DFS-2015" - }, - new - { - Id = 333, - FsfApproved = false, - Link = "https://spdx.org/licenses/Unicode-DFS-2016.html#licenseText", - Name = "Unicode License Agreement - Data Files and Software (2016)", - OsiApproved = false, - SPDX = "Unicode-DFS-2016" - }, - new - { - Id = 334, - FsfApproved = false, - Link = "https://spdx.org/licenses/Unicode-TOU.html#licenseText", - Name = "Unicode Terms of Use", - OsiApproved = false, - SPDX = "Unicode-TOU" - }, - new - { - Id = 335, - FsfApproved = true, - Link = "https://spdx.org/licenses/Unlicense.html#licenseText", - Name = "The Unlicense", - OsiApproved = false, - SPDX = "Unlicense" - }, - new - { - Id = 336, - FsfApproved = true, - Link = "https://spdx.org/licenses/UPL-1.0.html#licenseText", - Name = "Universal Permissive License v1.0", - OsiApproved = true, - SPDX = "UPL-1.0" - }, - new - { - Id = 337, - FsfApproved = true, - Link = "https://spdx.org/licenses/Vim.html#licenseText", - Name = "Vim License", - OsiApproved = false, - SPDX = "Vim" - }, - new - { - Id = 338, - FsfApproved = false, - Link = "https://spdx.org/licenses/VOSTROM.html#licenseText", - Name = "VOSTROM Public License for Open Source", - OsiApproved = false, - SPDX = "VOSTROM" - }, - new - { - Id = 339, - FsfApproved = false, - Link = "https://spdx.org/licenses/VSL-1.0.html#licenseText", - Name = "Vovida Software License v1.0", - OsiApproved = true, - SPDX = "VSL-1.0" - }, - new - { - Id = 340, - FsfApproved = true, - Link = "https://spdx.org/licenses/W3C.html#licenseText", - Name = "W3C Software Notice and License (2002-12-31)", - OsiApproved = true, - SPDX = "W3C" - }, - new - { - Id = 341, - FsfApproved = false, - Link = "https://spdx.org/licenses/W3C-19980720.html#licenseText", - Name = "W3C Software Notice and License (1998-07-20)", - OsiApproved = false, - SPDX = "W3C-19980720" - }, - new - { - Id = 342, - FsfApproved = false, - Link = "https://spdx.org/licenses/W3C-20150513.html#licenseText", - Name = "W3C Software Notice and Document License (2015-05-13)", - OsiApproved = false, - SPDX = "W3C-20150513" - }, - new - { - Id = 343, - FsfApproved = false, - Link = "https://spdx.org/licenses/Watcom-1.0.html#licenseText", - Name = "Sybase Open Watcom Public License 1.0", - OsiApproved = true, - SPDX = "Watcom-1.0" - }, - new - { - Id = 344, - FsfApproved = false, - Link = "https://spdx.org/licenses/Wsuipa.html#licenseText", - Name = "Wsuipa License", - OsiApproved = false, - SPDX = "Wsuipa" - }, - new - { - Id = 345, - FsfApproved = true, - Link = "https://spdx.org/licenses/WTFPL.html#licenseText", - Name = "Do What The F*ck You Want To Public License", - OsiApproved = false, - SPDX = "WTFPL" - }, - new - { - Id = 346, - FsfApproved = true, - Link = "https://spdx.org/licenses/X11.html#licenseText", - Name = "X11 License", - OsiApproved = false, - SPDX = "X11" - }, - new - { - Id = 347, - FsfApproved = false, - Link = "https://spdx.org/licenses/Xerox.html#licenseText", - Name = "Xerox License", - OsiApproved = false, - SPDX = "Xerox" - }, - new - { - Id = 348, - FsfApproved = true, - Link = "https://spdx.org/licenses/XFree86-1.1.html#licenseText", - Name = "XFree86 License 1.1", - OsiApproved = false, - SPDX = "XFree86-1.1" - }, - new - { - Id = 349, - FsfApproved = true, - Link = "https://spdx.org/licenses/xinetd.html#licenseText", - Name = "xinetd License", - OsiApproved = false, - SPDX = "xinetd" - }, - new - { - Id = 350, - FsfApproved = false, - Link = "https://spdx.org/licenses/Xnet.html#licenseText", - Name = "X.Net License", - OsiApproved = true, - SPDX = "Xnet" - }, - new - { - Id = 351, - FsfApproved = false, - Link = "https://spdx.org/licenses/xpp.html#licenseText", - Name = "XPP License", - OsiApproved = false, - SPDX = "xpp" - }, - new - { - Id = 352, - FsfApproved = false, - Link = "https://spdx.org/licenses/XSkat.html#licenseText", - Name = "XSkat License", - OsiApproved = false, - SPDX = "XSkat" - }, - new - { - Id = 353, - FsfApproved = false, - Link = "https://spdx.org/licenses/YPL-1.0.html#licenseText", - Name = "Yahoo! Public License v1.0", - OsiApproved = false, - SPDX = "YPL-1.0" - }, - new - { - Id = 354, - FsfApproved = true, - Link = "https://spdx.org/licenses/YPL-1.1.html#licenseText", - Name = "Yahoo! Public License v1.1", - OsiApproved = false, - SPDX = "YPL-1.1" - }, - new - { - Id = 355, - FsfApproved = false, - Link = "https://spdx.org/licenses/Zed.html#licenseText", - Name = "Zed License", - OsiApproved = false, - SPDX = "Zed" - }, - new - { - Id = 356, - FsfApproved = true, - Link = "https://spdx.org/licenses/Zend-2.0.html#licenseText", - Name = "Zend License v2.0", - OsiApproved = false, - SPDX = "Zend-2.0" - }, - new - { - Id = 357, - FsfApproved = true, - Link = "https://spdx.org/licenses/Zimbra-1.3.html#licenseText", - Name = "Zimbra Public License v1.3", - OsiApproved = false, - SPDX = "Zimbra-1.3" - }, - new - { - Id = 358, - FsfApproved = false, - Link = "https://spdx.org/licenses/Zimbra-1.4.html#licenseText", - Name = "Zimbra Public License v1.4", - OsiApproved = false, - SPDX = "Zimbra-1.4" - }, - new - { - Id = 359, - FsfApproved = true, - Link = "https://spdx.org/licenses/Zlib.html#licenseText", - Name = "zlib License", - OsiApproved = true, - SPDX = "Zlib" - }, - new - { - Id = 360, - FsfApproved = false, - Link = "https://spdx.org/licenses/zlib-acknowledgement.html#licenseText", - Name = "zlib/libpng License with Acknowledgement", - OsiApproved = false, - SPDX = "zlib-acknowledgement" - }, - new - { - Id = 361, - FsfApproved = false, - Link = "https://spdx.org/licenses/ZPL-1.1.html#licenseText", - Name = "Zope Public License 1.1", - OsiApproved = false, - SPDX = "ZPL-1.1" - }, - new - { - Id = 362, - FsfApproved = true, - Link = "https://spdx.org/licenses/ZPL-2.0.html#licenseText", - Name = "Zope Public License 2.0", - OsiApproved = true, - SPDX = "ZPL-2.0" - }, - new - { - Id = 363, - FsfApproved = true, - Link = "https://spdx.org/licenses/ZPL-2.1.html#licenseText", - Name = "Zope Public License 2.1", - OsiApproved = false, - SPDX = "ZPL-2.1" - }); + b.HasData(new + { + Id = 1, FsfApproved = false, Name = "Fair use", OsiApproved = false + }, new + { + Id = 2, FsfApproved = false, Name = "Advertisement use", OsiApproved = false + }, new + { + Id = 3, FsfApproved = false, Name = "All rights reserved", OsiApproved = false + }, new + { + Id = 4, FsfApproved = false, + Link = "https://spdx.org/licenses/0BSD.html#licenseText", + Name = "BSD Zero Clause License", OsiApproved = true, SPDX = "0BSD" + }, new + { + Id = 5, FsfApproved = false, + Link = "https://spdx.org/licenses/AAL.html#licenseText", + Name = "Attribution Assurance License", OsiApproved = true, SPDX = "AAL" + }, new + { + Id = 6, FsfApproved = false, + Link = "https://spdx.org/licenses/Abstyles.html#licenseText", + Name = "Abstyles License", OsiApproved = false, SPDX = "Abstyles" + }, new + { + Id = 7, FsfApproved = false, + Link = "https://spdx.org/licenses/Adobe-2006.html#licenseText", + Name = "Adobe Systems Incorporated Source Code License Agreement", OsiApproved = false, + SPDX = "Adobe-2006" + }, new + { + Id = 8, FsfApproved = false, + Link = "https://spdx.org/licenses/Adobe-Glyph.html#licenseText", + Name = "Adobe Glyph List License", OsiApproved = false, SPDX = "Adobe-Glyph" + }, new + { + Id = 9, FsfApproved = false, + Link = "https://spdx.org/licenses/ADSL.html#licenseText", + Name = "Amazon Digital Services License", OsiApproved = false, SPDX = "ADSL" + }, new + { + Id = 10, FsfApproved = true, + Link = "https://spdx.org/licenses/AFL-1.1.html#licenseText", + Name = "Academic Free License v1.1", OsiApproved = true, SPDX = "AFL-1.1" + }, new + { + Id = 11, FsfApproved = true, + Link = "https://spdx.org/licenses/AFL-1.2.html#licenseText", + Name = "Academic Free License v1.2", OsiApproved = true, SPDX = "AFL-1.2" + }, new + { + Id = 12, FsfApproved = true, + Link = "https://spdx.org/licenses/AFL-2.0.html#licenseText", + Name = "Academic Free License v2.0", OsiApproved = true, SPDX = "AFL-2.0" + }, new + { + Id = 13, FsfApproved = true, + Link = "https://spdx.org/licenses/AFL-2.1.html#licenseText", + Name = "Academic Free License v2.1", OsiApproved = true, SPDX = "AFL-2.1" + }, new + { + Id = 14, FsfApproved = true, + Link = "https://spdx.org/licenses/AFL-3.0.html#licenseText", + Name = "Academic Free License v3.0", OsiApproved = true, SPDX = "AFL-3.0" + }, new + { + Id = 15, FsfApproved = false, + Link = "https://spdx.org/licenses/Afmparse.html#licenseText", + Name = "Afmparse License", OsiApproved = false, SPDX = "Afmparse" + }, new + { + Id = 16, FsfApproved = false, + Link = "https://spdx.org/licenses/AGPL-1.0-only.html#licenseText", + Name = "Affero General Public License v1.0 only", OsiApproved = false, SPDX = "AGPL-1.0-only" + }, new + { + Id = 17, FsfApproved = false, + Link = "https://spdx.org/licenses/AGPL-1.0-or-later.html#licenseText", + Name = "Affero General Public License v1.0 or later", OsiApproved = false, + SPDX = "AGPL-1.0-or-later" + }, new + { + Id = 18, FsfApproved = true, + Link = "https://spdx.org/licenses/AGPL-3.0-only.html#licenseText", + Name = "GNU Affero General Public License v3.0 only", OsiApproved = true, SPDX = "AGPL-3.0-only" + }, new + { + Id = 19, FsfApproved = true, + Link = "https://spdx.org/licenses/AGPL-3.0-or-later.html#licenseText", + Name = "GNU Affero General Public License v3.0 or later", OsiApproved = true, + SPDX = "AGPL-3.0-or-later" + }, new + { + Id = 20, FsfApproved = false, + Link = "https://spdx.org/licenses/Aladdin.html#licenseText", + Name = "Aladdin Free Public License", OsiApproved = false, SPDX = "Aladdin" + }, new + { + Id = 21, FsfApproved = false, + Link = "https://spdx.org/licenses/AMDPLPA.html#licenseText", + Name = "AMD's plpa_map.c License", OsiApproved = false, SPDX = "AMDPLPA" + }, new + { + Id = 22, FsfApproved = false, + Link = "https://spdx.org/licenses/AML.html#licenseText", + Name = "Apple MIT License", OsiApproved = false, SPDX = "AML" + }, new + { + Id = 23, FsfApproved = false, + Link = "https://spdx.org/licenses/AMPAS.html#licenseText", + Name = "Academy of Motion Picture Arts and Sciences BSD", OsiApproved = false, SPDX = "AMPAS" + }, new + { + Id = 24, FsfApproved = false, + Link = "https://spdx.org/licenses/ANTLR-PD.html#licenseText", + Name = "ANTLR Software Rights Notice", OsiApproved = false, SPDX = "ANTLR-PD" + }, new + { + Id = 25, FsfApproved = true, + Link = "https://spdx.org/licenses/Apache-1.0.html#licenseText", + Name = "Apache License 1.0", OsiApproved = false, SPDX = "Apache-1.0" + }, new + { + Id = 26, FsfApproved = true, + Link = "https://spdx.org/licenses/Apache-1.1.html#licenseText", + Name = "Apache License 1.1", OsiApproved = true, SPDX = "Apache-1.1" + }, new + { + Id = 27, FsfApproved = true, + Link = "https://spdx.org/licenses/Apache-2.0.html#licenseText", + Name = "Apache License 2.0", OsiApproved = true, SPDX = "Apache-2.0" + }, new + { + Id = 28, FsfApproved = false, + Link = "https://spdx.org/licenses/APAFML.html#licenseText", + Name = "Adobe Postscript AFM License", OsiApproved = false, SPDX = "APAFML" + }, new + { + Id = 29, FsfApproved = false, + Link = "https://spdx.org/licenses/APL-1.0.html#licenseText", + Name = "Adaptive Public License 1.0", OsiApproved = true, SPDX = "APL-1.0" + }, new + { + Id = 30, FsfApproved = false, + Link = "https://spdx.org/licenses/APSL-1.0.html#licenseText", + Name = "Apple Public Source License 1.0", OsiApproved = true, SPDX = "APSL-1.0" + }, new + { + Id = 31, FsfApproved = false, + Link = "https://spdx.org/licenses/APSL-1.1.html#licenseText", + Name = "Apple Public Source License 1.1", OsiApproved = true, SPDX = "APSL-1.1" + }, new + { + Id = 32, FsfApproved = false, + Link = "https://spdx.org/licenses/APSL-1.2.html#licenseText", + Name = "Apple Public Source License 1.2", OsiApproved = true, SPDX = "APSL-1.2" + }, new + { + Id = 33, FsfApproved = true, + Link = "https://spdx.org/licenses/APSL-2.0.html#licenseText", + Name = "Apple Public Source License 2.0", OsiApproved = true, SPDX = "APSL-2.0" + }, new + { + Id = 34, FsfApproved = false, + Link = "https://spdx.org/licenses/Artistic-1.0.html#licenseText", + Name = "Artistic License 1.0", OsiApproved = true, SPDX = "Artistic-1.0" + }, new + { + Id = 35, FsfApproved = false, + Link = "https://spdx.org/licenses/Artistic-1.0-cl8.html#licenseText", + Name = "Artistic License 1.0 w/clause 8", OsiApproved = true, SPDX = "Artistic-1.0-cl8" + }, new + { + Id = 36, FsfApproved = false, + Link = "https://spdx.org/licenses/Artistic-1.0-Perl.html#licenseText", + Name = "Artistic License 1.0 (Perl)", OsiApproved = true, SPDX = "Artistic-1.0-Perl" + }, new + { + Id = 37, FsfApproved = true, + Link = "https://spdx.org/licenses/Artistic-2.0.html#licenseText", + Name = "Artistic License 2.0", OsiApproved = true, SPDX = "Artistic-2.0" + }, new + { + Id = 38, FsfApproved = false, + Link = "https://spdx.org/licenses/Bahyph.html#licenseText", + Name = "Bahyph License", OsiApproved = false, SPDX = "Bahyph" + }, new + { + Id = 39, FsfApproved = false, + Link = "https://spdx.org/licenses/Barr.html#licenseText", + Name = "Barr License", OsiApproved = false, SPDX = "Barr" + }, new + { + Id = 40, FsfApproved = false, + Link = "https://spdx.org/licenses/Beerware.html#licenseText", + Name = "Beerware License", OsiApproved = false, SPDX = "Beerware" + }, new + { + Id = 41, FsfApproved = false, + Link = "https://spdx.org/licenses/BitTorrent-1.0.html#licenseText", + Name = "BitTorrent Open Source License v1.0", OsiApproved = false, SPDX = "BitTorrent-1.0" + }, new + { + Id = 42, FsfApproved = true, + Link = "https://spdx.org/licenses/BitTorrent-1.1.html#licenseText", + Name = "BitTorrent Open Source License v1.1", OsiApproved = false, SPDX = "BitTorrent-1.1" + }, new + { + Id = 43, FsfApproved = false, + Link = "https://spdx.org/licenses/Borceux.html#licenseText", + Name = "Borceux license", OsiApproved = false, SPDX = "Borceux" + }, new + { + Id = 44, FsfApproved = false, + Link = "https://spdx.org/licenses/BSD-1-Clause.html#licenseText", + Name = "BSD 1-Clause License", OsiApproved = false, SPDX = "BSD-1-Clause" + }, new + { + Id = 45, FsfApproved = false, + Link = "https://spdx.org/licenses/BSD-2-Clause.html#licenseText", + Name = "BSD 2-Clause \"Simplified\" License", OsiApproved = true, SPDX = "BSD-2-Clause" + }, new + { + Id = 46, FsfApproved = true, + Link = "https://spdx.org/licenses/BSD-2-Clause-FreeBSD.html#licenseText", + Name = "BSD 2-Clause FreeBSD License", OsiApproved = false, SPDX = "BSD-2-Clause-FreeBSD" + }, new + { + Id = 47, FsfApproved = false, + Link = "https://spdx.org/licenses/BSD-2-Clause-NetBSD.html#licenseText", + Name = "BSD 2-Clause NetBSD License", OsiApproved = false, SPDX = "BSD-2-Clause-NetBSD" + }, new + { + Id = 48, FsfApproved = false, + Link = "https://spdx.org/licenses/BSD-2-Clause-Patent.html#licenseText", + Name = "BSD-2-Clause Plus Patent License", OsiApproved = true, SPDX = "BSD-2-Clause-Patent" + }, new + { + Id = 49, FsfApproved = true, + Link = "https://spdx.org/licenses/BSD-3-Clause.html#licenseText", + Name = "BSD 3-Clause \"New\" or \"Revised\" License", OsiApproved = true, SPDX = "BSD-3-Clause" + }, new + { + Id = 50, FsfApproved = false, + Link = "https://spdx.org/licenses/BSD-3-Clause-Attribution.html#licenseText", + Name = "BSD with attribution", OsiApproved = false, SPDX = "BSD-3-Clause-Attribution" + }, new + { + Id = 51, FsfApproved = true, + Link = "https://spdx.org/licenses/BSD-3-Clause-Clear.html#licenseText", + Name = "BSD 3-Clause Clear License", OsiApproved = false, SPDX = "BSD-3-Clause-Clear" + }, new + { + Id = 52, FsfApproved = false, + Link = "https://spdx.org/licenses/BSD-3-Clause-LBNL.html#licenseText", + Name = "Lawrence Berkeley National Labs BSD variant license", OsiApproved = false, + SPDX = "BSD-3-Clause-LBNL" + }, new + { + Id = 53, FsfApproved = false, + Link = "https://spdx.org/licenses/BSD-3-Clause-No-Nuclear-License.html#licenseText", + Name = "BSD 3-Clause No Nuclear License", OsiApproved = false, + SPDX = "BSD-3-Clause-No-Nuclear-License" + }, new + { + Id = 54, FsfApproved = false, + Link = "https://spdx.org/licenses/BSD-3-Clause-No-Nuclear-License-2014.html#licenseText", + Name = "BSD 3-Clause No Nuclear License 2014", OsiApproved = false, + SPDX = "BSD-3-Clause-No-Nuclear-License-2014" + }, new + { + Id = 55, FsfApproved = false, + Link = "https://spdx.org/licenses/BSD-3-Clause-No-Nuclear-Warranty.html#licenseText", + Name = "BSD 3-Clause No Nuclear Warranty", OsiApproved = false, + SPDX = "BSD-3-Clause-No-Nuclear-Warranty" + }, new + { + Id = 56, FsfApproved = true, + Link = "https://spdx.org/licenses/BSD-4-Clause.html#licenseText", + Name = "BSD 4-Clause \"Original\" or \"Old\" License", OsiApproved = false, SPDX = "BSD-4-Clause" + }, new + { + Id = 57, FsfApproved = false, + Link = "https://spdx.org/licenses/BSD-4-Clause-UC.html#licenseText", + Name = "BSD-4-Clause (University of California-Specific)", OsiApproved = false, + SPDX = "BSD-4-Clause-UC" + }, new + { + Id = 58, FsfApproved = false, + Link = "https://spdx.org/licenses/BSD-Protection.html#licenseText", + Name = "BSD Protection License", OsiApproved = false, SPDX = "BSD-Protection" + }, new + { + Id = 59, FsfApproved = false, + Link = "https://spdx.org/licenses/BSD-Source-Code.html#licenseText", + Name = "BSD Source Code Attribution", OsiApproved = false, SPDX = "BSD-Source-Code" + }, new + { + Id = 60, FsfApproved = true, + Link = "https://spdx.org/licenses/BSL-1.0.html#licenseText", + Name = "Boost Software License 1.0", OsiApproved = true, SPDX = "BSL-1.0" + }, new + { + Id = 61, FsfApproved = false, + Link = "https://spdx.org/licenses/bzip2-1.0.5.html#licenseText", + Name = "bzip2 and libbzip2 License v1.0.5", OsiApproved = false, SPDX = "bzip2-1.0.5" + }, new + { + Id = 62, FsfApproved = false, + Link = "https://spdx.org/licenses/bzip2-1.0.6.html#licenseText", + Name = "bzip2 and libbzip2 License v1.0.6", OsiApproved = false, SPDX = "bzip2-1.0.6" + }, new + { + Id = 63, FsfApproved = false, + Link = "https://spdx.org/licenses/Caldera.html#licenseText", + Name = "Caldera License", OsiApproved = false, SPDX = "Caldera" + }, new + { + Id = 64, FsfApproved = false, + Link = "https://spdx.org/licenses/CATOSL-1.1.html#licenseText", + Name = "Computer Associates Trusted Open Source License 1.1", OsiApproved = true, + SPDX = "CATOSL-1.1" + }, new + { + Id = 65, FsfApproved = false, + Link = "https://spdx.org/licenses/CC-BY-1.0.html#licenseText", + Name = "Creative Commons Attribution 1.0 Generic", OsiApproved = false, SPDX = "CC-BY-1.0" + }, new + { + Id = 66, FsfApproved = false, + Link = "https://spdx.org/licenses/CC-BY-2.0.html#licenseText", + Name = "Creative Commons Attribution 2.0 Generic", OsiApproved = false, SPDX = "CC-BY-2.0" + }, new + { + Id = 67, FsfApproved = false, + Link = "https://spdx.org/licenses/CC-BY-2.5.html#licenseText", + Name = "Creative Commons Attribution 2.5 Generic", OsiApproved = false, SPDX = "CC-BY-2.5" + }, new + { + Id = 68, FsfApproved = false, + Link = "https://spdx.org/licenses/CC-BY-3.0.html#licenseText", + Name = "Creative Commons Attribution 3.0 Unported", OsiApproved = false, SPDX = "CC-BY-3.0" + }, new + { + Id = 69, FsfApproved = true, + Link = "https://spdx.org/licenses/CC-BY-4.0.html#licenseText", + Name = "Creative Commons Attribution 4.0 International", OsiApproved = false, SPDX = "CC-BY-4.0" + }, new + { + Id = 70, FsfApproved = false, + Link = "https://spdx.org/licenses/CC-BY-NC-1.0.html#licenseText", + Name = "Creative Commons Attribution Non Commercial 1.0 Generic", OsiApproved = false, + SPDX = "CC-BY-NC-1.0" + }, new + { + Id = 71, FsfApproved = false, + Link = "https://spdx.org/licenses/CC-BY-NC-2.0.html#licenseText", + Name = "Creative Commons Attribution Non Commercial 2.0 Generic", OsiApproved = false, + SPDX = "CC-BY-NC-2.0" + }, new + { + Id = 72, FsfApproved = false, + Link = "https://spdx.org/licenses/CC-BY-NC-2.5.html#licenseText", + Name = "Creative Commons Attribution Non Commercial 2.5 Generic", OsiApproved = false, + SPDX = "CC-BY-NC-2.5" + }, new + { + Id = 73, FsfApproved = false, + Link = "https://spdx.org/licenses/CC-BY-NC-3.0.html#licenseText", + Name = "Creative Commons Attribution Non Commercial 3.0 Unported", OsiApproved = false, + SPDX = "CC-BY-NC-3.0" + }, new + { + Id = 74, FsfApproved = false, + Link = "https://spdx.org/licenses/CC-BY-NC-4.0.html#licenseText", + Name = "Creative Commons Attribution Non Commercial 4.0 International", OsiApproved = false, + SPDX = "CC-BY-NC-4.0" + }, new + { + Id = 75, FsfApproved = false, + Link = "https://spdx.org/licenses/CC-BY-NC-ND-1.0.html#licenseText", + Name = "Creative Commons Attribution Non Commercial No Derivatives 1.0 Generic", + OsiApproved = false, SPDX = "CC-BY-NC-ND-1.0" + }, new + { + Id = 76, FsfApproved = false, + Link = "https://spdx.org/licenses/CC-BY-NC-ND-2.0.html#licenseText", + Name = "Creative Commons Attribution Non Commercial No Derivatives 2.0 Generic", + OsiApproved = false, SPDX = "CC-BY-NC-ND-2.0" + }, new + { + Id = 77, FsfApproved = false, + Link = "https://spdx.org/licenses/CC-BY-NC-ND-2.5.html#licenseText", + Name = "Creative Commons Attribution Non Commercial No Derivatives 2.5 Generic", + OsiApproved = false, SPDX = "CC-BY-NC-ND-2.5" + }, new + { + Id = 78, FsfApproved = false, + Link = "https://spdx.org/licenses/CC-BY-NC-ND-3.0.html#licenseText", + Name = "Creative Commons Attribution Non Commercial No Derivatives 3.0 Unported", + OsiApproved = false, SPDX = "CC-BY-NC-ND-3.0" + }, new + { + Id = 79, FsfApproved = false, + Link = "https://spdx.org/licenses/CC-BY-NC-ND-4.0.html#licenseText", + Name = "Creative Commons Attribution Non Commercial No Derivatives 4.0 International", + OsiApproved = false, SPDX = "CC-BY-NC-ND-4.0" + }, new + { + Id = 80, FsfApproved = false, + Link = "https://spdx.org/licenses/CC-BY-NC-SA-1.0.html#licenseText", + Name = "Creative Commons Attribution Non Commercial Share Alike 1.0 Generic", OsiApproved = false, + SPDX = "CC-BY-NC-SA-1.0" + }, new + { + Id = 81, FsfApproved = false, + Link = "https://spdx.org/licenses/CC-BY-NC-SA-2.0.html#licenseText", + Name = "Creative Commons Attribution Non Commercial Share Alike 2.0 Generic", OsiApproved = false, + SPDX = "CC-BY-NC-SA-2.0" + }, new + { + Id = 82, FsfApproved = false, + Link = "https://spdx.org/licenses/CC-BY-NC-SA-2.5.html#licenseText", + Name = "Creative Commons Attribution Non Commercial Share Alike 2.5 Generic", OsiApproved = false, + SPDX = "CC-BY-NC-SA-2.5" + }, new + { + Id = 83, FsfApproved = false, + Link = "https://spdx.org/licenses/CC-BY-NC-SA-3.0.html#licenseText", + Name = "Creative Commons Attribution Non Commercial Share Alike 3.0 Unported", OsiApproved = false, + SPDX = "CC-BY-NC-SA-3.0" + }, new + { + Id = 84, FsfApproved = false, + Link = "https://spdx.org/licenses/CC-BY-NC-SA-4.0.html#licenseText", + Name = "Creative Commons Attribution Non Commercial Share Alike 4.0 International", + OsiApproved = false, SPDX = "CC-BY-NC-SA-4.0" + }, new + { + Id = 85, FsfApproved = false, + Link = "https://spdx.org/licenses/CC-BY-ND-1.0.html#licenseText", + Name = "Creative Commons Attribution No Derivatives 1.0 Generic", OsiApproved = false, + SPDX = "CC-BY-ND-1.0" + }, new + { + Id = 86, FsfApproved = false, + Link = "https://spdx.org/licenses/CC-BY-ND-2.0.html#licenseText", + Name = "Creative Commons Attribution No Derivatives 2.0 Generic", OsiApproved = false, + SPDX = "CC-BY-ND-2.0" + }, new + { + Id = 87, FsfApproved = false, + Link = "https://spdx.org/licenses/CC-BY-ND-2.5.html#licenseText", + Name = "Creative Commons Attribution No Derivatives 2.5 Generic", OsiApproved = false, + SPDX = "CC-BY-ND-2.5" + }, new + { + Id = 88, FsfApproved = false, + Link = "https://spdx.org/licenses/CC-BY-ND-3.0.html#licenseText", + Name = "Creative Commons Attribution No Derivatives 3.0 Unported", OsiApproved = false, + SPDX = "CC-BY-ND-3.0" + }, new + { + Id = 89, FsfApproved = false, + Link = "https://spdx.org/licenses/CC-BY-ND-4.0.html#licenseText", + Name = "Creative Commons Attribution No Derivatives 4.0 International", OsiApproved = false, + SPDX = "CC-BY-ND-4.0" + }, new + { + Id = 90, FsfApproved = false, + Link = "https://spdx.org/licenses/CC-BY-SA-1.0.html#licenseText", + Name = "Creative Commons Attribution Share Alike 1.0 Generic", OsiApproved = false, + SPDX = "CC-BY-SA-1.0" + }, new + { + Id = 91, FsfApproved = false, + Link = "https://spdx.org/licenses/CC-BY-SA-2.0.html#licenseText", + Name = "Creative Commons Attribution Share Alike 2.0 Generic", OsiApproved = false, + SPDX = "CC-BY-SA-2.0" + }, new + { + Id = 92, FsfApproved = false, + Link = "https://spdx.org/licenses/CC-BY-SA-2.5.html#licenseText", + Name = "Creative Commons Attribution Share Alike 2.5 Generic", OsiApproved = false, + SPDX = "CC-BY-SA-2.5" + }, new + { + Id = 93, FsfApproved = false, + Link = "https://spdx.org/licenses/CC-BY-SA-3.0.html#licenseText", + Name = "Creative Commons Attribution Share Alike 3.0 Unported", OsiApproved = false, + SPDX = "CC-BY-SA-3.0" + }, new + { + Id = 94, FsfApproved = true, + Link = "https://spdx.org/licenses/CC-BY-SA-4.0.html#licenseText", + Name = "Creative Commons Attribution Share Alike 4.0 International", OsiApproved = false, + SPDX = "CC-BY-SA-4.0" + }, new + { + Id = 95, FsfApproved = true, + Link = "https://spdx.org/licenses/CC0-1.0.html#licenseText", + Name = "Creative Commons Zero v1.0 Universal", OsiApproved = false, SPDX = "CC0-1.0" + }, new + { + Id = 96, FsfApproved = true, + Link = "https://spdx.org/licenses/CDDL-1.0.html#licenseText", + Name = "Common Development and Distribution License 1.0", OsiApproved = true, SPDX = "CDDL-1.0" + }, new + { + Id = 97, FsfApproved = false, + Link = "https://spdx.org/licenses/CDDL-1.1.html#licenseText", + Name = "Common Development and Distribution License 1.1", OsiApproved = false, SPDX = "CDDL-1.1" + }, new + { + Id = 98, FsfApproved = false, + Link = "https://spdx.org/licenses/CDLA-Permissive-1.0.html#licenseText", + Name = "Community Data License Agreement Permissive 1.0", OsiApproved = false, + SPDX = "CDLA-Permissive-1.0" + }, new + { + Id = 99, FsfApproved = false, + Link = "https://spdx.org/licenses/CDLA-Sharing-1.0.html#licenseText", + Name = "Community Data License Agreement Sharing 1.0", OsiApproved = false, + SPDX = "CDLA-Sharing-1.0" + }, new + { + Id = 100, FsfApproved = false, + Link = "https://spdx.org/licenses/CECILL-1.0.html#licenseText", + Name = "CeCILL Free Software License Agreement v1.0", OsiApproved = false, SPDX = "CECILL-1.0" + }, new + { + Id = 101, FsfApproved = false, + Link = "https://spdx.org/licenses/CECILL-1.1.html#licenseText", + Name = "CeCILL Free Software License Agreement v1.1", OsiApproved = false, SPDX = "CECILL-1.1" + }, new + { + Id = 102, FsfApproved = true, + Link = "https://spdx.org/licenses/CECILL-2.0.html#licenseText", + Name = "CeCILL Free Software License Agreement v2.0", OsiApproved = false, SPDX = "CECILL-2.0" + }, new + { + Id = 103, FsfApproved = false, + Link = "https://spdx.org/licenses/CECILL-2.1.html#licenseText", + Name = "CeCILL Free Software License Agreement v2.1", OsiApproved = true, SPDX = "CECILL-2.1" + }, new + { + Id = 104, FsfApproved = true, + Link = "https://spdx.org/licenses/CECILL-B.html#licenseText", + Name = "CeCILL-B Free Software License Agreement", OsiApproved = false, SPDX = "CECILL-B" + }, new + { + Id = 105, FsfApproved = true, + Link = "https://spdx.org/licenses/CECILL-C.html#licenseText", + Name = "CeCILL-C Free Software License Agreement", OsiApproved = false, SPDX = "CECILL-C" + }, new + { + Id = 106, FsfApproved = false, + Link = "https://spdx.org/licenses/CERN-OHL-1.1.html#licenseText", + Name = "CERN Open Hardware License v1.1", OsiApproved = false, SPDX = "CERN-OHL-1.1" + }, new + { + Id = 107, FsfApproved = false, + Link = "https://spdx.org/licenses/CERN-OHL-1.2.html#licenseText", + Name = "CERN Open Hardware Licence v1.2", OsiApproved = false, SPDX = "CERN-OHL-1.2" + }, new + { + Id = 108, FsfApproved = true, + Link = "https://spdx.org/licenses/ClArtistic.html#licenseText", + Name = "Clarified Artistic License", OsiApproved = false, SPDX = "ClArtistic" + }, new + { + Id = 109, FsfApproved = false, + Link = "https://spdx.org/licenses/CNRI-Jython.html#licenseText", + Name = "CNRI Jython License", OsiApproved = false, SPDX = "CNRI-Jython" + }, new + { + Id = 110, FsfApproved = false, + Link = "https://spdx.org/licenses/CNRI-Python.html#licenseText", + Name = "CNRI Python License", OsiApproved = true, SPDX = "CNRI-Python" + }, new + { + Id = 111, FsfApproved = false, + Link = "https://spdx.org/licenses/CNRI-Python-GPL-Compatible.html#licenseText", + Name = "CNRI Python Open Source GPL Compatible License Agreement", OsiApproved = false, + SPDX = "CNRI-Python-GPL-Compatible" + }, new + { + Id = 112, FsfApproved = true, + Link = "https://spdx.org/licenses/Condor-1.1.html#licenseText", + Name = "Condor Public License v1.1", OsiApproved = false, SPDX = "Condor-1.1" + }, new + { + Id = 113, FsfApproved = false, + Link = "https://spdx.org/licenses/copyleft-next-0.3.0.html#licenseText", + Name = "copyleft-next 0.3.0", OsiApproved = false, SPDX = "copyleft-next-0.3.0" + }, new + { + Id = 114, FsfApproved = false, + Link = "https://spdx.org/licenses/copyleft-next-0.3.1.html#licenseText", + Name = "copyleft-next 0.3.1", OsiApproved = false, SPDX = "copyleft-next-0.3.1" + }, new + { + Id = 115, FsfApproved = true, + Link = "https://spdx.org/licenses/CPAL-1.0.html#licenseText", + Name = "Common Public Attribution License 1.0", OsiApproved = true, SPDX = "CPAL-1.0" + }, new + { + Id = 116, FsfApproved = true, + Link = "https://spdx.org/licenses/CPL-1.0.html#licenseText", + Name = "Common Public License 1.0", OsiApproved = true, SPDX = "CPL-1.0" + }, new + { + Id = 117, FsfApproved = false, + Link = "https://spdx.org/licenses/CPOL-1.02.html#licenseText", + Name = "Code Project Open License 1.02", OsiApproved = false, SPDX = "CPOL-1.02" + }, new + { + Id = 118, FsfApproved = false, + Link = "https://spdx.org/licenses/Crossword.html#licenseText", + Name = "Crossword License", OsiApproved = false, SPDX = "Crossword" + }, new + { + Id = 119, FsfApproved = false, + Link = "https://spdx.org/licenses/CrystalStacker.html#licenseText", + Name = "CrystalStacker License", OsiApproved = false, SPDX = "CrystalStacker" + }, new + { + Id = 120, FsfApproved = false, + Link = "https://spdx.org/licenses/CUA-OPL-1.0.html#licenseText", + Name = "CUA Office Public License v1.0", OsiApproved = true, SPDX = "CUA-OPL-1.0" + }, new + { + Id = 121, FsfApproved = false, + Link = "https://spdx.org/licenses/Cube.html#licenseText", + Name = "Cube License", OsiApproved = false, SPDX = "Cube" + }, new + { + Id = 122, FsfApproved = false, + Link = "https://spdx.org/licenses/curl.html#licenseText", + Name = "curl License", OsiApproved = false, SPDX = "curl" + }, new + { + Id = 123, FsfApproved = false, + Link = "https://spdx.org/licenses/D-FSL-1.0.html#licenseText", + Name = "Deutsche Freie Software Lizenz", OsiApproved = false, SPDX = "D-FSL-1.0" + }, new + { + Id = 124, FsfApproved = false, + Link = "https://spdx.org/licenses/diffmark.html#licenseText", + Name = "diffmark license", OsiApproved = false, SPDX = "diffmark" + }, new + { + Id = 125, FsfApproved = false, Link = "https://spdx.org/licenses/DOC.html#licenseText", + Name = "DOC License", OsiApproved = false, SPDX = "DOC" + }, new + { + Id = 126, FsfApproved = false, + Link = "https://spdx.org/licenses/Dotseqn.html#licenseText", + Name = "Dotseqn License", OsiApproved = false, SPDX = "Dotseqn" + }, new + { + Id = 127, FsfApproved = false, + Link = "https://spdx.org/licenses/DSDP.html#licenseText", + Name = "DSDP License", OsiApproved = false, SPDX = "DSDP" + }, new + { + Id = 128, FsfApproved = false, + Link = "https://spdx.org/licenses/dvipdfm.html#licenseText", + Name = "dvipdfm License", OsiApproved = false, SPDX = "dvipdfm" + }, new + { + Id = 129, FsfApproved = false, + Link = "https://spdx.org/licenses/ECL-1.0.html#licenseText", + Name = "Educational Community License v1.0", OsiApproved = true, SPDX = "ECL-1.0" + }, new + { + Id = 130, FsfApproved = true, + Link = "https://spdx.org/licenses/ECL-2.0.html#licenseText", + Name = "Educational Community License v2.0", OsiApproved = true, SPDX = "ECL-2.0" + }, new + { + Id = 131, FsfApproved = false, + Link = "https://spdx.org/licenses/EFL-1.0.html#licenseText", + Name = "Eiffel Forum License v1.0", OsiApproved = true, SPDX = "EFL-1.0" + }, new + { + Id = 132, FsfApproved = true, + Link = "https://spdx.org/licenses/EFL-2.0.html#licenseText", + Name = "Eiffel Forum License v2.0", OsiApproved = true, SPDX = "EFL-2.0" + }, new + { + Id = 133, FsfApproved = false, + Link = "https://spdx.org/licenses/eGenix.html#licenseText", + Name = "eGenix.com Public License 1.1.0", OsiApproved = false, SPDX = "eGenix" + }, new + { + Id = 134, FsfApproved = false, + Link = "https://spdx.org/licenses/Entessa.html#licenseText", + Name = "Entessa Public License v1.0", OsiApproved = true, SPDX = "Entessa" + }, new + { + Id = 135, FsfApproved = true, + Link = "https://spdx.org/licenses/EPL-1.0.html#licenseText", + Name = "Eclipse Public License 1.0", OsiApproved = true, SPDX = "EPL-1.0" + }, new + { + Id = 136, FsfApproved = true, + Link = "https://spdx.org/licenses/EPL-2.0.html#licenseText", + Name = "Eclipse Public License 2.0", OsiApproved = true, SPDX = "EPL-2.0" + }, new + { + Id = 137, FsfApproved = false, + Link = "https://spdx.org/licenses/ErlPL-1.1.html#licenseText", + Name = "Erlang Public License v1.1", OsiApproved = false, SPDX = "ErlPL-1.1" + }, new + { + Id = 138, FsfApproved = true, + Link = "https://spdx.org/licenses/EUDatagrid.html#licenseText", + Name = "EU DataGrid Software License", OsiApproved = true, SPDX = "EUDatagrid" + }, new + { + Id = 139, FsfApproved = false, + Link = "https://spdx.org/licenses/EUPL-1.0.html#licenseText", + Name = "European Union Public License 1.0", OsiApproved = false, SPDX = "EUPL-1.0" + }, new + { + Id = 140, FsfApproved = true, + Link = "https://spdx.org/licenses/EUPL-1.1.html#licenseText", + Name = "European Union Public License 1.1", OsiApproved = true, SPDX = "EUPL-1.1" + }, new + { + Id = 141, FsfApproved = true, + Link = "https://spdx.org/licenses/EUPL-1.2.html#licenseText", + Name = "European Union Public License 1.2", OsiApproved = true, SPDX = "EUPL-1.2" + }, new + { + Id = 142, FsfApproved = false, + Link = "https://spdx.org/licenses/Eurosym.html#licenseText", + Name = "Eurosym License", OsiApproved = false, SPDX = "Eurosym" + }, new + { + Id = 143, FsfApproved = false, + Link = "https://spdx.org/licenses/Fair.html#licenseText", + Name = "Fair License", OsiApproved = true, SPDX = "Fair" + }, new + { + Id = 144, FsfApproved = false, + Link = "https://spdx.org/licenses/Frameworx-1.0.html#licenseText", + Name = "Frameworx Open License 1.0", OsiApproved = true, SPDX = "Frameworx-1.0" + }, new + { + Id = 145, FsfApproved = false, + Link = "https://spdx.org/licenses/FreeImage.html#licenseText", + Name = "FreeImage Public License v1.0", OsiApproved = false, SPDX = "FreeImage" + }, new + { + Id = 146, FsfApproved = true, + Link = "https://spdx.org/licenses/FSFAP.html#licenseText", + Name = "FSF All Permissive License", OsiApproved = false, SPDX = "FSFAP" + }, new + { + Id = 147, FsfApproved = false, + Link = "https://spdx.org/licenses/FSFUL.html#licenseText", + Name = "FSF Unlimited License", OsiApproved = false, SPDX = "FSFUL" + }, new + { + Id = 148, FsfApproved = false, + Link = "https://spdx.org/licenses/FSFULLR.html#licenseText", + Name = "FSF Unlimited License (with License Retention)", OsiApproved = false, SPDX = "FSFULLR" + }, new + { + Id = 149, FsfApproved = true, + Link = "https://spdx.org/licenses/FTL.html#licenseText", + Name = "Freetype Project License", OsiApproved = false, SPDX = "FTL" + }, new + { + Id = 150, FsfApproved = true, + Link = "https://spdx.org/licenses/GFDL-1.1-only.html#licenseText", + Name = "GNU Free Documentation License v1.1 only", OsiApproved = false, SPDX = "GFDL-1.1-only" + }, new + { + Id = 151, FsfApproved = true, + Link = "https://spdx.org/licenses/GFDL-1.1-or-later.html#licenseText", + Name = "GNU Free Documentation License v1.1 or later", OsiApproved = false, + SPDX = "GFDL-1.1-or-later" + }, new + { + Id = 152, FsfApproved = true, + Link = "https://spdx.org/licenses/GFDL-1.2-only.html#licenseText", + Name = "GNU Free Documentation License v1.2 only", OsiApproved = false, SPDX = "GFDL-1.2-only" + }, new + { + Id = 153, FsfApproved = true, + Link = "https://spdx.org/licenses/GFDL-1.2-or-later.html#licenseText", + Name = "GNU Free Documentation License v1.2 or later", OsiApproved = false, + SPDX = "GFDL-1.2-or-later" + }, new + { + Id = 154, FsfApproved = true, + Link = "https://spdx.org/licenses/GFDL-1.3-only.html#licenseText", + Name = "GNU Free Documentation License v1.3 only", OsiApproved = false, SPDX = "GFDL-1.3-only" + }, new + { + Id = 155, FsfApproved = true, + Link = "https://spdx.org/licenses/GFDL-1.3-or-later.html#licenseText", + Name = "GNU Free Documentation License v1.3 or later", OsiApproved = false, + SPDX = "GFDL-1.3-or-later" + }, new + { + Id = 156, FsfApproved = false, + Link = "https://spdx.org/licenses/Giftware.html#licenseText", + Name = "Giftware License", OsiApproved = false, SPDX = "Giftware" + }, new + { + Id = 157, FsfApproved = false, + Link = "https://spdx.org/licenses/GL2PS.html#licenseText", + Name = "GL2PS License", OsiApproved = false, SPDX = "GL2PS" + }, new + { + Id = 158, FsfApproved = false, + Link = "https://spdx.org/licenses/Glide.html#licenseText", + Name = "3dfx Glide License", OsiApproved = false, SPDX = "Glide" + }, new + { + Id = 159, FsfApproved = false, + Link = "https://spdx.org/licenses/Glulxe.html#licenseText", + Name = "Glulxe License", OsiApproved = false, SPDX = "Glulxe" + }, new + { + Id = 160, FsfApproved = true, + Link = "https://spdx.org/licenses/gnuplot.html#licenseText", + Name = "gnuplot License", OsiApproved = false, SPDX = "gnuplot" + }, new + { + Id = 161, FsfApproved = false, + Link = "https://spdx.org/licenses/GPL-1.0-only.html#licenseText", + Name = "GNU General Public License v1.0 only", OsiApproved = false, SPDX = "GPL-1.0-only" + }, new + { + Id = 162, FsfApproved = false, + Link = "https://spdx.org/licenses/GPL-1.0-or-later.html#licenseText", + Name = "GNU General Public License v1.0 or later", OsiApproved = false, SPDX = "GPL-1.0-or-later" + }, new + { + Id = 163, FsfApproved = true, + Link = "https://spdx.org/licenses/GPL-2.0-only.html#licenseText", + Name = "GNU General Public License v2.0 only", OsiApproved = true, SPDX = "GPL-2.0-only" + }, new + { + Id = 164, FsfApproved = true, + Link = "https://spdx.org/licenses/GPL-2.0-or-later.html#licenseText", + Name = "GNU General Public License v2.0 or later", OsiApproved = true, SPDX = "GPL-2.0-or-later" + }, new + { + Id = 165, FsfApproved = true, + Link = "https://spdx.org/licenses/GPL-3.0-only.html#licenseText", + Name = "GNU General Public License v3.0 only", OsiApproved = true, SPDX = "GPL-3.0-only" + }, new + { + Id = 166, FsfApproved = true, + Link = "https://spdx.org/licenses/GPL-3.0-or-later.html#licenseText", + Name = "GNU General Public License v3.0 or later", OsiApproved = true, SPDX = "GPL-3.0-or-later" + }, new + { + Id = 167, FsfApproved = false, + Link = "https://spdx.org/licenses/gSOAP-1.3b.html#licenseText", + Name = "gSOAP Public License v1.3b", OsiApproved = false, SPDX = "gSOAP-1.3b" + }, new + { + Id = 168, FsfApproved = false, + Link = "https://spdx.org/licenses/HaskellReport.html#licenseText", + Name = "Haskell Language Report License", OsiApproved = false, SPDX = "HaskellReport" + }, new + { + Id = 169, FsfApproved = true, + Link = "https://spdx.org/licenses/HPND.html#licenseText", + Name = "Historical Permission Notice and Disclaimer", OsiApproved = true, SPDX = "HPND" + }, new + { + Id = 170, FsfApproved = false, + Link = "https://spdx.org/licenses/HPND-sell-variant.html#licenseText", + Name = "Historical Permission Notice and Disclaimer - sell variant", OsiApproved = false, + SPDX = "HPND-sell-variant" + }, new + { + Id = 171, FsfApproved = false, + Link = "https://spdx.org/licenses/IBM-pibs.html#licenseText", + Name = "IBM PowerPC Initialization and Boot Software", OsiApproved = false, SPDX = "IBM-pibs" + }, new + { + Id = 172, FsfApproved = false, Link = "https://spdx.org/licenses/ICU.html#licenseText", + Name = "ICU License", OsiApproved = false, SPDX = "ICU" + }, new + { + Id = 173, FsfApproved = true, + Link = "https://spdx.org/licenses/IJG.html#licenseText", + Name = "Independent JPEG Group License", OsiApproved = false, SPDX = "IJG" + }, new + { + Id = 174, FsfApproved = false, + Link = "https://spdx.org/licenses/ImageMagick.html#licenseText", + Name = "ImageMagick License", OsiApproved = false, SPDX = "ImageMagick" + }, new + { + Id = 175, FsfApproved = true, + Link = "https://spdx.org/licenses/iMatix.html#licenseText", + Name = "iMatix Standard Function Library Agreement", OsiApproved = false, SPDX = "iMatix" + }, new + { + Id = 176, FsfApproved = true, + Link = "https://spdx.org/licenses/Imlib2.html#licenseText", + Name = "Imlib2 License", OsiApproved = false, SPDX = "Imlib2" + }, new + { + Id = 177, FsfApproved = false, + Link = "https://spdx.org/licenses/Info-ZIP.html#licenseText", + Name = "Info-ZIP License", OsiApproved = false, SPDX = "Info-ZIP" + }, new + { + Id = 178, FsfApproved = true, + Link = "https://spdx.org/licenses/Intel.html#licenseText", + Name = "Intel Open Source License", OsiApproved = true, SPDX = "Intel" + }, new + { + Id = 179, FsfApproved = false, + Link = "https://spdx.org/licenses/Intel-ACPI.html#licenseText", + Name = "Intel ACPI Software License Agreement", OsiApproved = false, SPDX = "Intel-ACPI" + }, new + { + Id = 180, FsfApproved = false, + Link = "https://spdx.org/licenses/Interbase-1.0.html#licenseText", + Name = "Interbase Public License v1.0", OsiApproved = false, SPDX = "Interbase-1.0" + }, new + { + Id = 181, FsfApproved = true, + Link = "https://spdx.org/licenses/IPA.html#licenseText", + Name = "IPA Font License", OsiApproved = true, SPDX = "IPA" + }, new + { + Id = 182, FsfApproved = true, + Link = "https://spdx.org/licenses/IPL-1.0.html#licenseText", + Name = "IBM Public License v1.0", OsiApproved = true, SPDX = "IPL-1.0" + }, new + { + Id = 183, FsfApproved = true, Link = "https://spdx.org/licenses/ISC.html#licenseText", + Name = "ISC License", OsiApproved = true, SPDX = "ISC" + }, new + { + Id = 184, FsfApproved = false, + Link = "https://spdx.org/licenses/JasPer-2.0.html#licenseText", + Name = "JasPer License", OsiApproved = false, SPDX = "JasPer-2.0" + }, new + { + Id = 185, FsfApproved = false, + Link = "https://spdx.org/licenses/JPNIC.html#licenseText", + Name = "Japan Network Information Center License", OsiApproved = false, SPDX = "JPNIC" + }, new + { + Id = 186, FsfApproved = false, + Link = "https://spdx.org/licenses/JSON.html#licenseText", + Name = "JSON License", OsiApproved = false, SPDX = "JSON" + }, new + { + Id = 187, FsfApproved = false, + Link = "https://spdx.org/licenses/LAL-1.2.html#licenseText", + Name = "Licence Art Libre 1.2", OsiApproved = false, SPDX = "LAL-1.2" + }, new + { + Id = 188, FsfApproved = false, + Link = "https://spdx.org/licenses/LAL-1.3.html#licenseText", + Name = "Licence Art Libre 1.3", OsiApproved = false, SPDX = "LAL-1.3" + }, new + { + Id = 189, FsfApproved = false, + Link = "https://spdx.org/licenses/Latex2e.html#licenseText", + Name = "Latex2e License", OsiApproved = false, SPDX = "Latex2e" + }, new + { + Id = 190, FsfApproved = false, + Link = "https://spdx.org/licenses/Leptonica.html#licenseText", + Name = "Leptonica License", OsiApproved = false, SPDX = "Leptonica" + }, new + { + Id = 191, FsfApproved = false, + Link = "https://spdx.org/licenses/LGPL-2.0-only.html#licenseText", + Name = "GNU Library General Public License v2 only", OsiApproved = true, SPDX = "LGPL-2.0-only" + }, new + { + Id = 192, FsfApproved = false, + Link = "https://spdx.org/licenses/LGPL-2.0-or-later.html#licenseText", + Name = "GNU Library General Public License v2 or later", OsiApproved = true, + SPDX = "LGPL-2.0-or-later" + }, new + { + Id = 193, FsfApproved = true, + Link = "https://spdx.org/licenses/LGPL-2.1-only.html#licenseText", + Name = "GNU Lesser General Public License v2.1 only", OsiApproved = true, SPDX = "LGPL-2.1-only" + }, new + { + Id = 194, FsfApproved = true, + Link = "https://spdx.org/licenses/LGPL-2.1-or-later.html#licenseText", + Name = "GNU Lesser General Public License v2.1 or later", OsiApproved = true, + SPDX = "LGPL-2.1-or-later" + }, new + { + Id = 195, FsfApproved = true, + Link = "https://spdx.org/licenses/LGPL-3.0-only.html#licenseText", + Name = "GNU Lesser General Public License v3.0 only", OsiApproved = true, SPDX = "LGPL-3.0-only" + }, new + { + Id = 196, FsfApproved = true, + Link = "https://spdx.org/licenses/LGPL-3.0-or-later.html#licenseText", + Name = "GNU Lesser General Public License v3.0 or later", OsiApproved = true, + SPDX = "LGPL-3.0-or-later" + }, new + { + Id = 197, FsfApproved = false, + Link = "https://spdx.org/licenses/LGPLLR.html#licenseText", + Name = "Lesser General Public License For Linguistic Resources", OsiApproved = false, + SPDX = "LGPLLR" + }, new + { + Id = 198, FsfApproved = false, + Link = "https://spdx.org/licenses/Libpng.html#licenseText", + Name = "libpng License", OsiApproved = false, SPDX = "Libpng" + }, new + { + Id = 199, FsfApproved = false, + Link = "https://spdx.org/licenses/libpng-2.0.html#licenseText", + Name = "PNG Reference Library version 2", OsiApproved = false, SPDX = "libpng-2.0" + }, new + { + Id = 200, FsfApproved = false, + Link = "https://spdx.org/licenses/libtiff.html#licenseText", + Name = "libtiff License", OsiApproved = false, SPDX = "libtiff" + }, new + { + Id = 201, FsfApproved = false, + Link = "https://spdx.org/licenses/LiLiQ-P-1.1.html#licenseText", + Name = "Licence Libre du Québec – Permissive version 1.1", OsiApproved = true, SPDX = "LiLiQ-P-1.1" + }, new + { + Id = 202, FsfApproved = false, + Link = "https://spdx.org/licenses/LiLiQ-R-1.1.html#licenseText", + Name = "Licence Libre du Québec – Réciprocité version 1.1", OsiApproved = true, + SPDX = "LiLiQ-R-1.1" + }, new + { + Id = 203, FsfApproved = false, + Link = "https://spdx.org/licenses/LiLiQ-Rplus-1.1.html#licenseText", + Name = "Licence Libre du Québec – Réciprocité forte version 1.1", OsiApproved = true, + SPDX = "LiLiQ-Rplus-1.1" + }, new + { + Id = 204, FsfApproved = false, + Link = "https://spdx.org/licenses/Linux-OpenIB.html#licenseText", + Name = "Linux Kernel Variant of OpenIB.org license", OsiApproved = false, SPDX = "Linux-OpenIB" + }, new + { + Id = 205, FsfApproved = false, + Link = "https://spdx.org/licenses/LPL-1.0.html#licenseText", + Name = "Lucent Public License Version 1.0", OsiApproved = true, SPDX = "LPL-1.0" + }, new + { + Id = 206, FsfApproved = true, + Link = "https://spdx.org/licenses/LPL-1.02.html#licenseText", + Name = "Lucent Public License v1.02", OsiApproved = true, SPDX = "LPL-1.02" + }, new + { + Id = 207, FsfApproved = false, + Link = "https://spdx.org/licenses/LPPL-1.0.html#licenseText", + Name = "LaTeX Project Public License v1.0", OsiApproved = false, SPDX = "LPPL-1.0" + }, new + { + Id = 208, FsfApproved = false, + Link = "https://spdx.org/licenses/LPPL-1.1.html#licenseText", + Name = "LaTeX Project Public License v1.1", OsiApproved = false, SPDX = "LPPL-1.1" + }, new + { + Id = 209, FsfApproved = true, + Link = "https://spdx.org/licenses/LPPL-1.2.html#licenseText", + Name = "LaTeX Project Public License v1.2", OsiApproved = false, SPDX = "LPPL-1.2" + }, new + { + Id = 210, FsfApproved = true, + Link = "https://spdx.org/licenses/LPPL-1.3a.html#licenseText", + Name = "LaTeX Project Public License v1.3a", OsiApproved = false, SPDX = "LPPL-1.3a" + }, new + { + Id = 211, FsfApproved = false, + Link = "https://spdx.org/licenses/LPPL-1.3c.html#licenseText", + Name = "LaTeX Project Public License v1.3c", OsiApproved = true, SPDX = "LPPL-1.3c" + }, new + { + Id = 212, FsfApproved = false, + Link = "https://spdx.org/licenses/MakeIndex.html#licenseText", + Name = "MakeIndex License", OsiApproved = false, SPDX = "MakeIndex" + }, new + { + Id = 213, FsfApproved = false, + Link = "https://spdx.org/licenses/MirOS.html#licenseText", + Name = "MirOS License", OsiApproved = true, SPDX = "MirOS" + }, new + { + Id = 214, FsfApproved = true, Link = "https://spdx.org/licenses/MIT.html#licenseText", + Name = "MIT License", OsiApproved = true, SPDX = "MIT" + }, new + { + Id = 215, FsfApproved = false, + Link = "https://spdx.org/licenses/MIT-0.html#licenseText", + Name = "MIT No Attribution", OsiApproved = true, SPDX = "MIT-0" + }, new + { + Id = 216, FsfApproved = false, + Link = "https://spdx.org/licenses/MIT-advertising.html#licenseText", + Name = "Enlightenment License (e16)", OsiApproved = false, SPDX = "MIT-advertising" + }, new + { + Id = 217, FsfApproved = false, + Link = "https://spdx.org/licenses/MIT-CMU.html#licenseText", + Name = "CMU License", OsiApproved = false, SPDX = "MIT-CMU" + }, new + { + Id = 218, FsfApproved = false, + Link = "https://spdx.org/licenses/MIT-enna.html#licenseText", + Name = "enna License", OsiApproved = false, SPDX = "MIT-enna" + }, new + { + Id = 219, FsfApproved = false, + Link = "https://spdx.org/licenses/MIT-feh.html#licenseText", + Name = "feh License", OsiApproved = false, SPDX = "MIT-feh" + }, new + { + Id = 220, FsfApproved = false, + Link = "https://spdx.org/licenses/MITNFA.html#licenseText", + Name = "MIT +no-false-attribs license", OsiApproved = false, SPDX = "MITNFA" + }, new + { + Id = 221, FsfApproved = false, + Link = "https://spdx.org/licenses/Motosoto.html#licenseText", + Name = "Motosoto License", OsiApproved = true, SPDX = "Motosoto" + }, new + { + Id = 222, FsfApproved = false, + Link = "https://spdx.org/licenses/mpich2.html#licenseText", + Name = "mpich2 License", OsiApproved = false, SPDX = "mpich2" + }, new + { + Id = 223, FsfApproved = false, + Link = "https://spdx.org/licenses/MPL-1.0.html#licenseText", + Name = "Mozilla Public License 1.0", OsiApproved = true, SPDX = "MPL-1.0" + }, new + { + Id = 224, FsfApproved = true, + Link = "https://spdx.org/licenses/MPL-1.1.html#licenseText", + Name = "Mozilla Public License 1.1", OsiApproved = true, SPDX = "MPL-1.1" + }, new + { + Id = 225, FsfApproved = true, + Link = "https://spdx.org/licenses/MPL-2.0.html#licenseText", + Name = "Mozilla Public License 2.0", OsiApproved = true, SPDX = "MPL-2.0" + }, new + { + Id = 226, FsfApproved = false, + Link = "https://spdx.org/licenses/MPL-2.0-no-copyleft-exception.html#licenseText", + Name = "Mozilla Public License 2.0 (no copyleft exception)", OsiApproved = true, + SPDX = "MPL-2.0-no-copyleft-exception" + }, new + { + Id = 227, FsfApproved = true, + Link = "https://spdx.org/licenses/MS-PL.html#licenseText", + Name = "Microsoft Public License", OsiApproved = true, SPDX = "MS-PL" + }, new + { + Id = 228, FsfApproved = true, + Link = "https://spdx.org/licenses/MS-RL.html#licenseText", + Name = "Microsoft Reciprocal License", OsiApproved = true, SPDX = "MS-RL" + }, new + { + Id = 229, FsfApproved = false, + Link = "https://spdx.org/licenses/MTLL.html#licenseText", + Name = "Matrix Template Library License", OsiApproved = false, SPDX = "MTLL" + }, new + { + Id = 230, FsfApproved = false, + Link = "https://spdx.org/licenses/Multics.html#licenseText", + Name = "Multics License", OsiApproved = true, SPDX = "Multics" + }, new + { + Id = 231, FsfApproved = false, Link = "https://spdx.org/licenses/Mup.html#licenseText", + Name = "Mup License", OsiApproved = false, SPDX = "Mup" + }, new + { + Id = 232, FsfApproved = false, + Link = "https://spdx.org/licenses/NASA-1.3.html#licenseText", + Name = "NASA Open Source Agreement 1.3", OsiApproved = true, SPDX = "NASA-1.3" + }, new + { + Id = 233, FsfApproved = false, + Link = "https://spdx.org/licenses/Naumen.html#licenseText", + Name = "Naumen Public License", OsiApproved = true, SPDX = "Naumen" + }, new + { + Id = 234, FsfApproved = false, + Link = "https://spdx.org/licenses/NBPL-1.0.html#licenseText", + Name = "Net Boolean Public License v1", OsiApproved = false, SPDX = "NBPL-1.0" + }, new + { + Id = 235, FsfApproved = true, + Link = "https://spdx.org/licenses/NCSA.html#licenseText", + Name = "University of Illinois/NCSA Open Source License", OsiApproved = true, SPDX = "NCSA" + }, new + { + Id = 236, FsfApproved = false, + Link = "https://spdx.org/licenses/Net-SNMP.html#licenseText", + Name = "Net-SNMP License", OsiApproved = false, SPDX = "Net-SNMP" + }, new + { + Id = 237, FsfApproved = false, + Link = "https://spdx.org/licenses/NetCDF.html#licenseText", + Name = "NetCDF license", OsiApproved = false, SPDX = "NetCDF" + }, new + { + Id = 238, FsfApproved = false, + Link = "https://spdx.org/licenses/Newsletr.html#licenseText", + Name = "Newsletr License", OsiApproved = false, SPDX = "Newsletr" + }, new + { + Id = 239, FsfApproved = false, + Link = "https://spdx.org/licenses/NGPL.html#licenseText", + Name = "Nethack General Public License", OsiApproved = true, SPDX = "NGPL" + }, new + { + Id = 240, FsfApproved = false, + Link = "https://spdx.org/licenses/NLOD-1.0.html#licenseText", + Name = "Norwegian Licence for Open Government Data", OsiApproved = false, SPDX = "NLOD-1.0" + }, new + { + Id = 241, FsfApproved = false, + Link = "https://spdx.org/licenses/NLPL.html#licenseText", + Name = "No Limit Public License", OsiApproved = false, SPDX = "NLPL" + }, new + { + Id = 242, FsfApproved = true, + Link = "https://spdx.org/licenses/Nokia.html#licenseText", + Name = "Nokia Open Source License", OsiApproved = true, SPDX = "Nokia" + }, new + { + Id = 243, FsfApproved = true, + Link = "https://spdx.org/licenses/NOSL.html#licenseText", + Name = "Netizen Open Source License", OsiApproved = false, SPDX = "NOSL" + }, new + { + Id = 244, FsfApproved = false, + Link = "https://spdx.org/licenses/Noweb.html#licenseText", + Name = "Noweb License", OsiApproved = false, SPDX = "Noweb" + }, new + { + Id = 245, FsfApproved = true, + Link = "https://spdx.org/licenses/NPL-1.0.html#licenseText", + Name = "Netscape Public License v1.0", OsiApproved = false, SPDX = "NPL-1.0" + }, new + { + Id = 246, FsfApproved = true, + Link = "https://spdx.org/licenses/NPL-1.1.html#licenseText", + Name = "Netscape Public License v1.1", OsiApproved = false, SPDX = "NPL-1.1" + }, new + { + Id = 247, FsfApproved = false, + Link = "https://spdx.org/licenses/NPOSL-3.0.html#licenseText", + Name = "Non-Profit Open Software License 3.0", OsiApproved = true, SPDX = "NPOSL-3.0" + }, new + { + Id = 248, FsfApproved = false, Link = "https://spdx.org/licenses/NRL.html#licenseText", + Name = "NRL License", OsiApproved = false, SPDX = "NRL" + }, new + { + Id = 249, FsfApproved = false, Link = "https://spdx.org/licenses/NTP.html#licenseText", + Name = "NTP License", OsiApproved = true, SPDX = "NTP" + }, new + { + Id = 250, FsfApproved = false, + Link = "https://spdx.org/licenses/OCCT-PL.html#licenseText", + Name = "Open CASCADE Technology Public License", OsiApproved = false, SPDX = "OCCT-PL" + }, new + { + Id = 251, FsfApproved = false, + Link = "https://spdx.org/licenses/OCLC-2.0.html#licenseText", + Name = "OCLC Research Public License 2.0", OsiApproved = true, SPDX = "OCLC-2.0" + }, new + { + Id = 252, FsfApproved = true, + Link = "https://spdx.org/licenses/ODbL-1.0.html#licenseText", + Name = "ODC Open Database License v1.0", OsiApproved = false, SPDX = "ODbL-1.0" + }, new + { + Id = 253, FsfApproved = false, + Link = "https://spdx.org/licenses/ODC-By-1.0.html#licenseText", + Name = "Open Data Commons Attribution License v1.0", OsiApproved = false, SPDX = "ODC-By-1.0" + }, new + { + Id = 254, FsfApproved = true, + Link = "https://spdx.org/licenses/OFL-1.0.html#licenseText", + Name = "SIL Open Font License 1.0", OsiApproved = false, SPDX = "OFL-1.0" + }, new + { + Id = 255, FsfApproved = true, + Link = "https://spdx.org/licenses/OFL-1.1.html#licenseText", + Name = "SIL Open Font License 1.1", OsiApproved = true, SPDX = "OFL-1.1" + }, new + { + Id = 256, FsfApproved = false, + Link = "https://spdx.org/licenses/OGL-UK-1.0.html#licenseText", + Name = "Open Government Licence v1.0", OsiApproved = false, SPDX = "OGL-UK-1.0" + }, new + { + Id = 257, FsfApproved = false, + Link = "https://spdx.org/licenses/OGL-UK-2.0.html#licenseText", + Name = "Open Government Licence v2.0", OsiApproved = false, SPDX = "OGL-UK-2.0" + }, new + { + Id = 258, FsfApproved = false, + Link = "https://spdx.org/licenses/OGL-UK-3.0.html#licenseText", + Name = "Open Government Licence v3.0", OsiApproved = false, SPDX = "OGL-UK-3.0" + }, new + { + Id = 259, FsfApproved = false, + Link = "https://spdx.org/licenses/OGTSL.html#licenseText", + Name = "Open Group Test Suite License", OsiApproved = true, SPDX = "OGTSL" + }, new + { + Id = 260, FsfApproved = false, + Link = "https://spdx.org/licenses/OLDAP-1.1.html#licenseText", + Name = "Open LDAP Public License v1.1", OsiApproved = false, SPDX = "OLDAP-1.1" + }, new + { + Id = 261, FsfApproved = false, + Link = "https://spdx.org/licenses/OLDAP-1.2.html#licenseText", + Name = "Open LDAP Public License v1.2", OsiApproved = false, SPDX = "OLDAP-1.2" + }, new + { + Id = 262, FsfApproved = false, + Link = "https://spdx.org/licenses/OLDAP-1.3.html#licenseText", + Name = "Open LDAP Public License v1.3", OsiApproved = false, SPDX = "OLDAP-1.3" + }, new + { + Id = 263, FsfApproved = false, + Link = "https://spdx.org/licenses/OLDAP-1.4.html#licenseText", + Name = "Open LDAP Public License v1.4", OsiApproved = false, SPDX = "OLDAP-1.4" + }, new + { + Id = 264, FsfApproved = false, + Link = "https://spdx.org/licenses/OLDAP-2.0.html#licenseText", + Name = "Open LDAP Public License v2.0 (or possibly 2.0A and 2.0B)", OsiApproved = false, + SPDX = "OLDAP-2.0" + }, new + { + Id = 265, FsfApproved = false, + Link = "https://spdx.org/licenses/OLDAP-2.0.1.html#licenseText", + Name = "Open LDAP Public License v2.0.1", OsiApproved = false, SPDX = "OLDAP-2.0.1" + }, new + { + Id = 266, FsfApproved = false, + Link = "https://spdx.org/licenses/OLDAP-2.1.html#licenseText", + Name = "Open LDAP Public License v2.1", OsiApproved = false, SPDX = "OLDAP-2.1" + }, new + { + Id = 267, FsfApproved = false, + Link = "https://spdx.org/licenses/OLDAP-2.2.html#licenseText", + Name = "Open LDAP Public License v2.2", OsiApproved = false, SPDX = "OLDAP-2.2" + }, new + { + Id = 268, FsfApproved = false, + Link = "https://spdx.org/licenses/OLDAP-2.2.1.html#licenseText", + Name = "Open LDAP Public License v2.2.1", OsiApproved = false, SPDX = "OLDAP-2.2.1" + }, new + { + Id = 269, FsfApproved = false, + Link = "https://spdx.org/licenses/OLDAP-2.2.2.html#licenseText", + Name = "Open LDAP Public License 2.2.2", OsiApproved = false, SPDX = "OLDAP-2.2.2" + }, new + { + Id = 270, FsfApproved = true, + Link = "https://spdx.org/licenses/OLDAP-2.3.html#licenseText", + Name = "Open LDAP Public License v2.3", OsiApproved = false, SPDX = "OLDAP-2.3" + }, new + { + Id = 271, FsfApproved = false, + Link = "https://spdx.org/licenses/OLDAP-2.4.html#licenseText", + Name = "Open LDAP Public License v2.4", OsiApproved = false, SPDX = "OLDAP-2.4" + }, new + { + Id = 272, FsfApproved = false, + Link = "https://spdx.org/licenses/OLDAP-2.5.html#licenseText", + Name = "Open LDAP Public License v2.5", OsiApproved = false, SPDX = "OLDAP-2.5" + }, new + { + Id = 273, FsfApproved = false, + Link = "https://spdx.org/licenses/OLDAP-2.6.html#licenseText", + Name = "Open LDAP Public License v2.6", OsiApproved = false, SPDX = "OLDAP-2.6" + }, new + { + Id = 274, FsfApproved = true, + Link = "https://spdx.org/licenses/OLDAP-2.7.html#licenseText", + Name = "Open LDAP Public License v2.7", OsiApproved = false, SPDX = "OLDAP-2.7" + }, new + { + Id = 275, FsfApproved = false, + Link = "https://spdx.org/licenses/OLDAP-2.8.html#licenseText", + Name = "Open LDAP Public License v2.8", OsiApproved = false, SPDX = "OLDAP-2.8" + }, new + { + Id = 276, FsfApproved = false, + Link = "https://spdx.org/licenses/OML.html#licenseText", + Name = "Open Market License", OsiApproved = false, SPDX = "OML" + }, new + { + Id = 277, FsfApproved = true, + Link = "https://spdx.org/licenses/OpenSSL.html#licenseText", + Name = "OpenSSL License", OsiApproved = false, SPDX = "OpenSSL" + }, new + { + Id = 278, FsfApproved = false, + Link = "https://spdx.org/licenses/OPL-1.0.html#licenseText", + Name = "Open Public License v1.0", OsiApproved = false, SPDX = "OPL-1.0" + }, new + { + Id = 279, FsfApproved = false, + Link = "https://spdx.org/licenses/OSET-PL-2.1.html#licenseText", + Name = "OSET Public License version 2.1", OsiApproved = true, SPDX = "OSET-PL-2.1" + }, new + { + Id = 280, FsfApproved = true, + Link = "https://spdx.org/licenses/OSL-1.0.html#licenseText", + Name = "Open Software License 1.0", OsiApproved = true, SPDX = "OSL-1.0" + }, new + { + Id = 281, FsfApproved = true, + Link = "https://spdx.org/licenses/OSL-1.1.html#licenseText", + Name = "Open Software License 1.1", OsiApproved = false, SPDX = "OSL-1.1" + }, new + { + Id = 282, FsfApproved = true, + Link = "https://spdx.org/licenses/OSL-2.0.html#licenseText", + Name = "Open Software License 2.0", OsiApproved = true, SPDX = "OSL-2.0" + }, new + { + Id = 283, FsfApproved = true, + Link = "https://spdx.org/licenses/OSL-2.1.html#licenseText", + Name = "Open Software License 2.1", OsiApproved = true, SPDX = "OSL-2.1" + }, new + { + Id = 284, FsfApproved = true, + Link = "https://spdx.org/licenses/OSL-3.0.html#licenseText", + Name = "Open Software License 3.0", OsiApproved = true, SPDX = "OSL-3.0" + }, new + { + Id = 285, FsfApproved = false, + Link = "https://spdx.org/licenses/PDDL-1.0.html#licenseText", + Name = "ODC Public Domain Dedication & License 1.0", OsiApproved = false, SPDX = "PDDL-1.0" + }, new + { + Id = 286, FsfApproved = false, + Link = "https://spdx.org/licenses/PHP-3.0.html#licenseText", + Name = "PHP License v3.0", OsiApproved = true, SPDX = "PHP-3.0" + }, new + { + Id = 287, FsfApproved = true, + Link = "https://spdx.org/licenses/PHP-3.01.html#licenseText", + Name = "PHP License v3.01", OsiApproved = false, SPDX = "PHP-3.01" + }, new + { + Id = 288, FsfApproved = false, + Link = "https://spdx.org/licenses/Plexus.html#licenseText", + Name = "Plexus Classworlds License", OsiApproved = false, SPDX = "Plexus" + }, new + { + Id = 289, FsfApproved = false, + Link = "https://spdx.org/licenses/PostgreSQL.html#licenseText", + Name = "PostgreSQL License", OsiApproved = true, SPDX = "PostgreSQL" + }, new + { + Id = 290, FsfApproved = false, + Link = "https://spdx.org/licenses/psfrag.html#licenseText", + Name = "psfrag License", OsiApproved = false, SPDX = "psfrag" + }, new + { + Id = 291, FsfApproved = false, + Link = "https://spdx.org/licenses/psutils.html#licenseText", + Name = "psutils License", OsiApproved = false, SPDX = "psutils" + }, new + { + Id = 292, FsfApproved = true, + Link = "https://spdx.org/licenses/Python-2.0.html#licenseText", + Name = "Python License 2.0", OsiApproved = true, SPDX = "Python-2.0" + }, new + { + Id = 293, FsfApproved = false, + Link = "https://spdx.org/licenses/Qhull.html#licenseText", + Name = "Qhull License", OsiApproved = false, SPDX = "Qhull" + }, new + { + Id = 294, FsfApproved = true, + Link = "https://spdx.org/licenses/QPL-1.0.html#licenseText", + Name = "Q Public License 1.0", OsiApproved = true, SPDX = "QPL-1.0" + }, new + { + Id = 295, FsfApproved = false, + Link = "https://spdx.org/licenses/Rdisc.html#licenseText", + Name = "Rdisc License", OsiApproved = false, SPDX = "Rdisc" + }, new + { + Id = 296, FsfApproved = false, + Link = "https://spdx.org/licenses/RHeCos-1.1.html#licenseText", + Name = "Red Hat eCos Public License v1.1", OsiApproved = false, SPDX = "RHeCos-1.1" + }, new + { + Id = 297, FsfApproved = false, + Link = "https://spdx.org/licenses/RPL-1.1.html#licenseText", + Name = "Reciprocal Public License 1.1", OsiApproved = true, SPDX = "RPL-1.1" + }, new + { + Id = 298, FsfApproved = false, + Link = "https://spdx.org/licenses/RPL-1.5.html#licenseText", + Name = "Reciprocal Public License 1.5", OsiApproved = true, SPDX = "RPL-1.5" + }, new + { + Id = 299, FsfApproved = true, + Link = "https://spdx.org/licenses/RPSL-1.0.html#licenseText", + Name = "RealNetworks Public Source License v1.0", OsiApproved = true, SPDX = "RPSL-1.0" + }, new + { + Id = 300, FsfApproved = false, + Link = "https://spdx.org/licenses/RSA-MD.html#licenseText", + Name = "RSA Message-Digest License", OsiApproved = false, SPDX = "RSA-MD" + }, new + { + Id = 301, FsfApproved = false, + Link = "https://spdx.org/licenses/RSCPL.html#licenseText", + Name = "Ricoh Source Code Public License", OsiApproved = true, SPDX = "RSCPL" + }, new + { + Id = 302, FsfApproved = true, + Link = "https://spdx.org/licenses/Ruby.html#licenseText", + Name = "Ruby License", OsiApproved = false, SPDX = "Ruby" + }, new + { + Id = 303, FsfApproved = false, + Link = "https://spdx.org/licenses/SAX-PD.html#licenseText", + Name = "Sax Public Domain Notice", OsiApproved = false, SPDX = "SAX-PD" + }, new + { + Id = 304, FsfApproved = false, + Link = "https://spdx.org/licenses/Saxpath.html#licenseText", + Name = "Saxpath License", OsiApproved = false, SPDX = "Saxpath" + }, new + { + Id = 305, FsfApproved = false, + Link = "https://spdx.org/licenses/SCEA.html#licenseText", + Name = "SCEA Shared Source License", OsiApproved = false, SPDX = "SCEA" + }, new + { + Id = 306, FsfApproved = false, + Link = "https://spdx.org/licenses/Sendmail.html#licenseText", + Name = "Sendmail License", OsiApproved = false, SPDX = "Sendmail" + }, new + { + Id = 307, FsfApproved = false, + Link = "https://spdx.org/licenses/Sendmail-8.23.html#licenseText", + Name = "Sendmail License 8.23", OsiApproved = false, SPDX = "Sendmail-8.23" + }, new + { + Id = 308, FsfApproved = false, + Link = "https://spdx.org/licenses/SGI-B-1.0.html#licenseText", + Name = "SGI Free Software License B v1.0", OsiApproved = false, SPDX = "SGI-B-1.0" + }, new + { + Id = 309, FsfApproved = false, + Link = "https://spdx.org/licenses/SGI-B-1.1.html#licenseText", + Name = "SGI Free Software License B v1.1", OsiApproved = false, SPDX = "SGI-B-1.1" + }, new + { + Id = 310, FsfApproved = true, + Link = "https://spdx.org/licenses/SGI-B-2.0.html#licenseText", + Name = "SGI Free Software License B v2.0", OsiApproved = false, SPDX = "SGI-B-2.0" + }, new + { + Id = 311, FsfApproved = false, + Link = "https://spdx.org/licenses/SimPL-2.0.html#licenseText", + Name = "Simple Public License 2.0", OsiApproved = true, SPDX = "SimPL-2.0" + }, new + { + Id = 312, FsfApproved = true, + Link = "https://spdx.org/licenses/SISSL.html#licenseText", + Name = "Sun Industry Standards Source License v1.1", OsiApproved = true, SPDX = "SISSL" + }, new + { + Id = 313, FsfApproved = false, + Link = "https://spdx.org/licenses/SISSL-1.2.html#licenseText", + Name = "Sun Industry Standards Source License v1.2", OsiApproved = false, SPDX = "SISSL-1.2" + }, new + { + Id = 314, FsfApproved = true, + Link = "https://spdx.org/licenses/Sleepycat.html#licenseText", + Name = "Sleepycat License", OsiApproved = true, SPDX = "Sleepycat" + }, new + { + Id = 315, FsfApproved = true, + Link = "https://spdx.org/licenses/SMLNJ.html#licenseText", + Name = "Standard ML of New Jersey License", OsiApproved = false, SPDX = "SMLNJ" + }, new + { + Id = 316, FsfApproved = false, + Link = "https://spdx.org/licenses/SMPPL.html#licenseText", + Name = "Secure Messaging Protocol Public License", OsiApproved = false, SPDX = "SMPPL" + }, new + { + Id = 317, FsfApproved = false, + Link = "https://spdx.org/licenses/SNIA.html#licenseText", + Name = "SNIA Public License 1.1", OsiApproved = false, SPDX = "SNIA" + }, new + { + Id = 318, FsfApproved = false, + Link = "https://spdx.org/licenses/Spencer-86.html#licenseText", + Name = "Spencer License 86", OsiApproved = false, SPDX = "Spencer-86" + }, new + { + Id = 319, FsfApproved = false, + Link = "https://spdx.org/licenses/Spencer-94.html#licenseText", + Name = "Spencer License 94", OsiApproved = false, SPDX = "Spencer-94" + }, new + { + Id = 320, FsfApproved = false, + Link = "https://spdx.org/licenses/Spencer-99.html#licenseText", + Name = "Spencer License 99", OsiApproved = false, SPDX = "Spencer-99" + }, new + { + Id = 321, FsfApproved = true, + Link = "https://spdx.org/licenses/SPL-1.0.html#licenseText", + Name = "Sun Public License v1.0", OsiApproved = true, SPDX = "SPL-1.0" + }, new + { + Id = 322, FsfApproved = false, + Link = "https://spdx.org/licenses/SugarCRM-1.1.3.html#licenseText", + Name = "SugarCRM Public License v1.1.3", OsiApproved = false, SPDX = "SugarCRM-1.1.3" + }, new + { + Id = 323, FsfApproved = false, + Link = "https://spdx.org/licenses/SWL.html#licenseText", + Name = "Scheme Widget Library (SWL) Software License Agreement", OsiApproved = false, SPDX = "SWL" + }, new + { + Id = 324, FsfApproved = false, + Link = "https://spdx.org/licenses/TAPR-OHL-1.0.html#licenseText", + Name = "TAPR Open Hardware License v1.0", OsiApproved = false, SPDX = "TAPR-OHL-1.0" + }, new + { + Id = 325, FsfApproved = false, + Link = "https://spdx.org/licenses/TCL.html#licenseText", + Name = "TCL/TK License", OsiApproved = false, SPDX = "TCL" + }, new + { + Id = 326, FsfApproved = false, + Link = "https://spdx.org/licenses/TCP-wrappers.html#licenseText", + Name = "TCP Wrappers License", OsiApproved = false, SPDX = "TCP-wrappers" + }, new + { + Id = 327, FsfApproved = false, + Link = "https://spdx.org/licenses/TMate.html#licenseText", + Name = "TMate Open Source License", OsiApproved = false, SPDX = "TMate" + }, new + { + Id = 328, FsfApproved = false, + Link = "https://spdx.org/licenses/TORQUE-1.1.html#licenseText", + Name = "TORQUE v2.5+ Software License v1.1", OsiApproved = false, SPDX = "TORQUE-1.1" + }, new + { + Id = 329, FsfApproved = false, + Link = "https://spdx.org/licenses/TOSL.html#licenseText", + Name = "Trusster Open Source License", OsiApproved = false, SPDX = "TOSL" + }, new + { + Id = 330, FsfApproved = false, + Link = "https://spdx.org/licenses/TU-Berlin-1.0.html#licenseText", + Name = "Technische Universitaet Berlin License 1.0", OsiApproved = false, SPDX = "TU-Berlin-1.0" + }, new + { + Id = 331, FsfApproved = false, + Link = "https://spdx.org/licenses/TU-Berlin-2.0.html#licenseText", + Name = "Technische Universitaet Berlin License 2.0", OsiApproved = false, SPDX = "TU-Berlin-2.0" + }, new + { + Id = 332, FsfApproved = false, + Link = "https://spdx.org/licenses/Unicode-DFS-2015.html#licenseText", + Name = "Unicode License Agreement - Data Files and Software (2015)", OsiApproved = false, + SPDX = "Unicode-DFS-2015" + }, new + { + Id = 333, FsfApproved = false, + Link = "https://spdx.org/licenses/Unicode-DFS-2016.html#licenseText", + Name = "Unicode License Agreement - Data Files and Software (2016)", OsiApproved = false, + SPDX = "Unicode-DFS-2016" + }, new + { + Id = 334, FsfApproved = false, + Link = "https://spdx.org/licenses/Unicode-TOU.html#licenseText", + Name = "Unicode Terms of Use", OsiApproved = false, SPDX = "Unicode-TOU" + }, new + { + Id = 335, FsfApproved = true, + Link = "https://spdx.org/licenses/Unlicense.html#licenseText", + Name = "The Unlicense", OsiApproved = false, SPDX = "Unlicense" + }, new + { + Id = 336, FsfApproved = true, + Link = "https://spdx.org/licenses/UPL-1.0.html#licenseText", + Name = "Universal Permissive License v1.0", OsiApproved = true, SPDX = "UPL-1.0" + }, new + { + Id = 337, FsfApproved = true, Link = "https://spdx.org/licenses/Vim.html#licenseText", + Name = "Vim License", OsiApproved = false, SPDX = "Vim" + }, new + { + Id = 338, FsfApproved = false, + Link = "https://spdx.org/licenses/VOSTROM.html#licenseText", + Name = "VOSTROM Public License for Open Source", OsiApproved = false, SPDX = "VOSTROM" + }, new + { + Id = 339, FsfApproved = false, + Link = "https://spdx.org/licenses/VSL-1.0.html#licenseText", + Name = "Vovida Software License v1.0", OsiApproved = true, SPDX = "VSL-1.0" + }, new + { + Id = 340, FsfApproved = true, + Link = "https://spdx.org/licenses/W3C.html#licenseText", + Name = "W3C Software Notice and License (2002-12-31)", OsiApproved = true, SPDX = "W3C" + }, new + { + Id = 341, FsfApproved = false, + Link = "https://spdx.org/licenses/W3C-19980720.html#licenseText", + Name = "W3C Software Notice and License (1998-07-20)", OsiApproved = false, SPDX = "W3C-19980720" + }, new + { + Id = 342, FsfApproved = false, + Link = "https://spdx.org/licenses/W3C-20150513.html#licenseText", + Name = "W3C Software Notice and Document License (2015-05-13)", OsiApproved = false, + SPDX = "W3C-20150513" + }, new + { + Id = 343, FsfApproved = false, + Link = "https://spdx.org/licenses/Watcom-1.0.html#licenseText", + Name = "Sybase Open Watcom Public License 1.0", OsiApproved = true, SPDX = "Watcom-1.0" + }, new + { + Id = 344, FsfApproved = false, + Link = "https://spdx.org/licenses/Wsuipa.html#licenseText", + Name = "Wsuipa License", OsiApproved = false, SPDX = "Wsuipa" + }, new + { + Id = 345, FsfApproved = true, + Link = "https://spdx.org/licenses/WTFPL.html#licenseText", + Name = "Do What The F*ck You Want To Public License", OsiApproved = false, SPDX = "WTFPL" + }, new + { + Id = 346, FsfApproved = true, Link = "https://spdx.org/licenses/X11.html#licenseText", + Name = "X11 License", OsiApproved = false, SPDX = "X11" + }, new + { + Id = 347, FsfApproved = false, + Link = "https://spdx.org/licenses/Xerox.html#licenseText", + Name = "Xerox License", OsiApproved = false, SPDX = "Xerox" + }, new + { + Id = 348, FsfApproved = true, + Link = "https://spdx.org/licenses/XFree86-1.1.html#licenseText", + Name = "XFree86 License 1.1", OsiApproved = false, SPDX = "XFree86-1.1" + }, new + { + Id = 349, FsfApproved = true, + Link = "https://spdx.org/licenses/xinetd.html#licenseText", + Name = "xinetd License", OsiApproved = false, SPDX = "xinetd" + }, new + { + Id = 350, FsfApproved = false, + Link = "https://spdx.org/licenses/Xnet.html#licenseText", + Name = "X.Net License", OsiApproved = true, SPDX = "Xnet" + }, new + { + Id = 351, FsfApproved = false, Link = "https://spdx.org/licenses/xpp.html#licenseText", + Name = "XPP License", OsiApproved = false, SPDX = "xpp" + }, new + { + Id = 352, FsfApproved = false, + Link = "https://spdx.org/licenses/XSkat.html#licenseText", + Name = "XSkat License", OsiApproved = false, SPDX = "XSkat" + }, new + { + Id = 353, FsfApproved = false, + Link = "https://spdx.org/licenses/YPL-1.0.html#licenseText", + Name = "Yahoo! Public License v1.0", OsiApproved = false, SPDX = "YPL-1.0" + }, new + { + Id = 354, FsfApproved = true, + Link = "https://spdx.org/licenses/YPL-1.1.html#licenseText", + Name = "Yahoo! Public License v1.1", OsiApproved = false, SPDX = "YPL-1.1" + }, new + { + Id = 355, FsfApproved = false, Link = "https://spdx.org/licenses/Zed.html#licenseText", + Name = "Zed License", OsiApproved = false, SPDX = "Zed" + }, new + { + Id = 356, FsfApproved = true, + Link = "https://spdx.org/licenses/Zend-2.0.html#licenseText", + Name = "Zend License v2.0", OsiApproved = false, SPDX = "Zend-2.0" + }, new + { + Id = 357, FsfApproved = true, + Link = "https://spdx.org/licenses/Zimbra-1.3.html#licenseText", + Name = "Zimbra Public License v1.3", OsiApproved = false, SPDX = "Zimbra-1.3" + }, new + { + Id = 358, FsfApproved = false, + Link = "https://spdx.org/licenses/Zimbra-1.4.html#licenseText", + Name = "Zimbra Public License v1.4", OsiApproved = false, SPDX = "Zimbra-1.4" + }, new + { + Id = 359, FsfApproved = true, Link = "https://spdx.org/licenses/Zlib.html#licenseText", + Name = "zlib License", OsiApproved = true, SPDX = "Zlib" + }, new + { + Id = 360, FsfApproved = false, + Link = "https://spdx.org/licenses/zlib-acknowledgement.html#licenseText", + Name = "zlib/libpng License with Acknowledgement", OsiApproved = false, + SPDX = "zlib-acknowledgement" + }, new + { + Id = 361, FsfApproved = false, + Link = "https://spdx.org/licenses/ZPL-1.1.html#licenseText", + Name = "Zope Public License 1.1", OsiApproved = false, SPDX = "ZPL-1.1" + }, new + { + Id = 362, FsfApproved = true, + Link = "https://spdx.org/licenses/ZPL-2.0.html#licenseText", + Name = "Zope Public License 2.0", OsiApproved = true, SPDX = "ZPL-2.0" + }, new + { + Id = 363, FsfApproved = true, + Link = "https://spdx.org/licenses/ZPL-2.1.html#licenseText", + Name = "Zope Public License 2.1", OsiApproved = false, SPDX = "ZPL-2.1" + }); }); modelBuilder.Entity("Marechai.Database.Models.Log", b => { b.Property("Id").ValueGeneratedOnAdd().HasColumnName("id").HasColumnType("int(11)"); - b.Property("Browser").IsRequired().ValueGeneratedOnAdd().HasColumnName("browser") - .HasColumnType("char(128)").HasDefaultValueSql("''"); + b.Property("Browser").IsRequired().ValueGeneratedOnAdd().HasColumnName("browser"). + HasColumnType("char(128)").HasDefaultValueSql("''"); - b.Property("Date").IsRequired().ValueGeneratedOnAdd().HasColumnName("date") - .HasColumnType("char(20)").HasDefaultValueSql("''"); + b.Property("Date").IsRequired().ValueGeneratedOnAdd().HasColumnName("date"). + HasColumnType("char(20)").HasDefaultValueSql("''"); - b.Property("Ip").IsRequired().ValueGeneratedOnAdd().HasColumnName("ip") - .HasColumnType("char(16)").HasDefaultValueSql("''"); + b.Property("Ip").IsRequired().ValueGeneratedOnAdd().HasColumnName("ip"). + HasColumnType("char(16)").HasDefaultValueSql("''"); - b.Property("Referer").IsRequired().ValueGeneratedOnAdd().HasColumnName("referer") - .HasColumnType("char(255)").HasDefaultValueSql("''"); + b.Property("Referer").IsRequired().ValueGeneratedOnAdd().HasColumnName("referer"). + HasColumnType("char(255)").HasDefaultValueSql("''"); b.HasKey("Id"); @@ -4259,8 +3406,8 @@ namespace Marechai.Database.Migrations { b.Property("Id").ValueGeneratedOnAdd().HasColumnName("id").HasColumnType("int(11)"); - b.Property("CompanyId").ValueGeneratedOnAdd().HasColumnName("company").HasColumnType("int(11)") - .HasDefaultValueSql("'0'"); + b.Property("CompanyId").ValueGeneratedOnAdd().HasColumnName("company").HasColumnType("int(11)"). + HasDefaultValueSql("'0'"); b.Property("FamilyId").HasColumnName("family").HasColumnType("int(11)"); @@ -4268,11 +3415,11 @@ namespace Marechai.Database.Migrations b.Property("Model").HasColumnName("model").HasColumnType("varchar(50)").HasMaxLength(50); - b.Property("Name").IsRequired().HasColumnName("name").HasColumnType("varchar(255)") - .HasMaxLength(255); + b.Property("Name").IsRequired().HasColumnName("name").HasColumnType("varchar(255)"). + HasMaxLength(255); - b.Property("Type").ValueGeneratedOnAdd().HasColumnName("type").HasColumnType("int(11)") - .HasDefaultValueSql("'0'"); + b.Property("Type").ValueGeneratedOnAdd().HasColumnName("type").HasColumnType("int(11)"). + HasDefaultValueSql("'0'"); b.HasKey("Id"); @@ -4297,8 +3444,8 @@ namespace Marechai.Database.Migrations b.Property("CompanyId").HasColumnName("company").HasColumnType("int(11)"); - b.Property("Name").IsRequired().HasColumnName("name").HasColumnType("varchar(255)") - .HasMaxLength(255); + b.Property("Name").IsRequired().HasColumnName("name").HasColumnType("varchar(255)"). + HasMaxLength(255); b.HasKey("Id"); @@ -4574,11 +3721,11 @@ namespace Marechai.Database.Migrations b.Property("Speed").HasColumnName("speed"); - b.Property("Type").ValueGeneratedOnAdd().HasColumnName("type").HasColumnType("int(11)") - .HasDefaultValueSql("'0'"); + b.Property("Type").ValueGeneratedOnAdd().HasColumnName("type").HasColumnType("int(11)"). + HasDefaultValueSql("'0'"); - b.Property("Usage").ValueGeneratedOnAdd().HasColumnName("usage").HasColumnType("int(11)") - .HasDefaultValueSql("'0'"); + b.Property("Usage").ValueGeneratedOnAdd().HasColumnName("usage").HasColumnType("int(11)"). + HasDefaultValueSql("'0'"); b.HasKey("Id"); @@ -4628,11 +3775,11 @@ namespace Marechai.Database.Migrations { b.Property("Id").ValueGeneratedOnAdd().HasColumnName("id").HasColumnType("int(11)"); - b.Property("Donator").IsRequired().ValueGeneratedOnAdd().HasColumnName("donator") - .HasColumnType("char(128)").HasDefaultValueSql("''"); + b.Property("Donator").IsRequired().ValueGeneratedOnAdd().HasColumnName("donator"). + HasColumnType("char(128)").HasDefaultValueSql("''"); - b.Property("Quantity").ValueGeneratedOnAdd().HasColumnName("quantity") - .HasColumnType("decimal(11,2)").HasDefaultValueSql("'0.00'"); + b.Property("Quantity").ValueGeneratedOnAdd().HasColumnName("quantity"). + HasColumnType("decimal(11,2)").HasDefaultValueSql("'0.00'"); b.HasKey("Id"); @@ -4647,13 +3794,13 @@ namespace Marechai.Database.Migrations { b.Property("Id").ValueGeneratedOnAdd().HasColumnName("id").HasColumnType("int(11)"); - b.Property("AddedId").ValueGeneratedOnAdd().HasColumnName("added_id").HasColumnType("int(11)") - .HasDefaultValueSql("'0'"); + b.Property("AddedId").ValueGeneratedOnAdd().HasColumnName("added_id").HasColumnType("int(11)"). + HasDefaultValueSql("'0'"); b.Property("Date").HasColumnName("date").HasColumnType("datetime"); - b.Property("Type").ValueGeneratedOnAdd().HasColumnName("type").HasColumnType("int(11)") - .HasDefaultValueSql("'0'"); + b.Property("Type").ValueGeneratedOnAdd().HasColumnName("type").HasColumnType("int(11)"). + HasDefaultValueSql("'0'"); b.HasKey("Id"); @@ -5051,11 +4198,11 @@ namespace Marechai.Database.Migrations b.Property("L3"); - b.Property("ModelCode").HasColumnName("model_code").HasColumnType("varchar(45)") - .HasMaxLength(45); + b.Property("ModelCode").HasColumnName("model_code").HasColumnType("varchar(45)"). + HasMaxLength(45); - b.Property("Name").IsRequired().ValueGeneratedOnAdd().HasColumnName("name") - .HasColumnType("char(50)").HasDefaultValueSql("''").HasMaxLength(50); + b.Property("Name").IsRequired().ValueGeneratedOnAdd().HasColumnName("name"). + HasColumnType("char(50)").HasDefaultValueSql("''").HasMaxLength(50); b.Property("Package").HasColumnName("package").HasColumnType("varchar(45)").HasMaxLength(45); @@ -5174,20 +4321,20 @@ namespace Marechai.Database.Migrations { b.Property("Id").ValueGeneratedOnAdd().HasColumnName("id").HasColumnType("int(11)"); - b.Property("Chars").ValueGeneratedOnAdd().HasColumnName("chars").HasColumnType("tinyint(1)") - .HasDefaultValueSql("'0'"); + b.Property("Chars").ValueGeneratedOnAdd().HasColumnName("chars").HasColumnType("tinyint(1)"). + HasDefaultValueSql("'0'"); b.Property("Colors").HasColumnName("colors").HasColumnType("bigint(20)"); b.Property("Grayscale"); - b.Property("Height").ValueGeneratedOnAdd().HasColumnName("height").HasColumnType("int(11)") - .HasDefaultValueSql("'0'"); + b.Property("Height").ValueGeneratedOnAdd().HasColumnName("height").HasColumnType("int(11)"). + HasDefaultValueSql("'0'"); b.Property("Palette").HasColumnName("palette").HasColumnType("bigint(20)"); - b.Property("Width").ValueGeneratedOnAdd().HasColumnName("width").HasColumnType("int(11)") - .HasDefaultValueSql("'0'"); + b.Property("Width").ValueGeneratedOnAdd().HasColumnName("width").HasColumnType("int(11)"). + HasDefaultValueSql("'0'"); b.HasKey("Id"); @@ -5203,8 +4350,8 @@ namespace Marechai.Database.Migrations b.HasIndex("Width", "Height", "Colors").HasName("idx_resolutions_resolution_with_color"); - b.HasIndex("Width", "Height", "Colors", "Palette") - .HasName("idx_resolutions_resolution_with_color_and_palette"); + b.HasIndex("Width", "Height", "Colors", "Palette"). + HasName("idx_resolutions_resolution_with_color_and_palette"); b.ToTable("resolutions"); }); @@ -5339,11 +4486,11 @@ namespace Marechai.Database.Migrations b.Property("Introduced").HasColumnName("introduced").HasColumnType("datetime"); - b.Property("ModelCode").HasColumnName("model_code").HasColumnType("varchar(45)") - .HasMaxLength(45); + b.Property("ModelCode").HasColumnName("model_code").HasColumnType("varchar(45)"). + HasMaxLength(45); - b.Property("Name").IsRequired().ValueGeneratedOnAdd().HasColumnName("name") - .HasColumnType("char(50)").HasDefaultValueSql("''").HasMaxLength(50); + b.Property("Name").IsRequired().ValueGeneratedOnAdd().HasColumnName("name"). + HasColumnType("char(50)").HasDefaultValueSql("''").HasMaxLength(50); b.Property("SquareWave").HasColumnName("square_wave").HasColumnType("int(11)"); @@ -5384,13 +4531,13 @@ namespace Marechai.Database.Migrations b.Property("Capacity").HasColumnName("capacity").HasColumnType("bigint(20)"); - b.Property("Interface").ValueGeneratedOnAdd().HasColumnName("interface").HasColumnType("int(11)") - .HasDefaultValueSql("'0'"); + b.Property("Interface").ValueGeneratedOnAdd().HasColumnName("interface").HasColumnType("int(11)"). + HasDefaultValueSql("'0'"); b.Property("MachineId").HasColumnName("machine").HasColumnType("int(11)"); - b.Property("Type").ValueGeneratedOnAdd().HasColumnName("type").HasColumnType("int(11)") - .HasDefaultValueSql("'0'"); + b.Property("Type").ValueGeneratedOnAdd().HasColumnName("type").HasColumnType("int(11)"). + HasDefaultValueSql("'0'"); b.HasKey("Id"); @@ -5580,457 +4727,435 @@ namespace Marechai.Database.Migrations modelBuilder.Entity("Marechai.Database.Models.Book", b => { - b.HasOne("Marechai.Database.Models.Iso31661Numeric", "Country").WithMany("Books") - .HasForeignKey("CountryId"); + b.HasOne("Marechai.Database.Models.Iso31661Numeric", "Country").WithMany("Books"). + HasForeignKey("CountryId"); - b.HasOne("Marechai.Database.Models.Book", "Previous").WithOne("Next") - .HasForeignKey("Marechai.Database.Models.Book", "PreviousId"); + b.HasOne("Marechai.Database.Models.Book", "Previous").WithOne("Next"). + HasForeignKey("Marechai.Database.Models.Book", "PreviousId"); b.HasOne("Marechai.Database.Models.Book", "Source").WithMany("Derivates").HasForeignKey("SourceId"); }); modelBuilder.Entity("Marechai.Database.Models.BooksByMachine", b => { - b.HasOne("Marechai.Database.Models.Book", "Book").WithMany("Machines").HasForeignKey("BookId") - .OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.Book", "Book").WithMany("Machines").HasForeignKey("BookId"). + OnDelete(DeleteBehavior.Cascade); - b.HasOne("Marechai.Database.Models.Machine", "Machine").WithMany("Books").HasForeignKey("MachineId") - .OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.Machine", "Machine").WithMany("Books").HasForeignKey("MachineId"). + OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Marechai.Database.Models.BooksByMachineFamily", b => { - b.HasOne("Marechai.Database.Models.Book", "Book").WithMany("MachineFamilies").HasForeignKey("BookId") - .OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.Book", "Book").WithMany("MachineFamilies").HasForeignKey("BookId"). + OnDelete(DeleteBehavior.Cascade); - b.HasOne("Marechai.Database.Models.MachineFamily", "MachineFamily").WithMany("Books") - .HasForeignKey("MachineFamilyId").OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.MachineFamily", "MachineFamily").WithMany("Books"). + HasForeignKey("MachineFamilyId").OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Marechai.Database.Models.CompaniesByBook", b => { - b.HasOne("Marechai.Database.Models.Book", "Book").WithMany("Companies").HasForeignKey("BookId") - .OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.Book", "Book").WithMany("Companies").HasForeignKey("BookId"). + OnDelete(DeleteBehavior.Cascade); - b.HasOne("Marechai.Database.Models.DocumentCompany", "Company").WithMany("Books").HasForeignKey("CompanyId") - .OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.DocumentCompany", "Company").WithMany("Books"). + HasForeignKey("CompanyId").OnDelete(DeleteBehavior.Cascade); - b.HasOne("Marechai.Database.Models.DocumentRole", "Role").WithMany().HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.DocumentRole", "Role").WithMany().HasForeignKey("RoleId"). + OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Marechai.Database.Models.CompaniesByDocument", b => { - b.HasOne("Marechai.Database.Models.DocumentCompany", "Company").WithMany("Documents") - .HasForeignKey("CompanyId").OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.DocumentCompany", "Company").WithMany("Documents"). + HasForeignKey("CompanyId").OnDelete(DeleteBehavior.Cascade); - b.HasOne("Marechai.Database.Models.Document", "Document").WithMany("Companies").HasForeignKey("DocumentId") - .OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.Document", "Document").WithMany("Companies"). + HasForeignKey("DocumentId").OnDelete(DeleteBehavior.Cascade); - b.HasOne("Marechai.Database.Models.DocumentRole", "Role").WithMany().HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.DocumentRole", "Role").WithMany().HasForeignKey("RoleId"). + OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Marechai.Database.Models.CompaniesByMagazine", b => { - b.HasOne("Marechai.Database.Models.DocumentCompany", "Company").WithMany("Magazines") - .HasForeignKey("CompanyId").OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.DocumentCompany", "Company").WithMany("Magazines"). + HasForeignKey("CompanyId").OnDelete(DeleteBehavior.Cascade); - b.HasOne("Marechai.Database.Models.Magazine", "Magazine").WithMany("Companies").HasForeignKey("MagazineId") - .OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.Magazine", "Magazine").WithMany("Companies"). + HasForeignKey("MagazineId").OnDelete(DeleteBehavior.Cascade); - b.HasOne("Marechai.Database.Models.DocumentRole", "Role").WithMany().HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.DocumentRole", "Role").WithMany().HasForeignKey("RoleId"). + OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Marechai.Database.Models.Company", b => { - b.HasOne("Marechai.Database.Models.Iso31661Numeric", "Country").WithMany("Companies") - .HasForeignKey("CountryId").HasConstraintName("fk_companies_country"); + b.HasOne("Marechai.Database.Models.Iso31661Numeric", "Country").WithMany("Companies"). + HasForeignKey("CountryId").HasConstraintName("fk_companies_country"); - b.HasOne("Marechai.Database.Models.Company", "SoldTo").WithMany("InverseSoldToNavigation") - .HasForeignKey("SoldToId").HasConstraintName("fk_companies_sold_to"); + b.HasOne("Marechai.Database.Models.Company", "SoldTo").WithMany("InverseSoldToNavigation"). + HasForeignKey("SoldToId").HasConstraintName("fk_companies_sold_to"); }); - modelBuilder.Entity("Marechai.Database.Models.CompanyDescription", - b => - { - b.HasOne("Marechai.Database.Models.Company", "Company").WithMany("Descriptions") - .HasForeignKey("CompanyId").OnDelete(DeleteBehavior.Cascade); - }); + modelBuilder.Entity("Marechai.Database.Models.CompanyDescription", b => + { + b.HasOne("Marechai.Database.Models.Company", "Company").WithMany("Descriptions"). + HasForeignKey("CompanyId").OnDelete(DeleteBehavior.Cascade); + }); - modelBuilder.Entity("Marechai.Database.Models.CompanyLogo", - b => - { - b.HasOne("Marechai.Database.Models.Company", "Company").WithMany("Logos") - .HasForeignKey("CompanyId").HasConstraintName("fk_company_logos_company1"); - }); + modelBuilder.Entity("Marechai.Database.Models.CompanyLogo", b => + { + b.HasOne("Marechai.Database.Models.Company", "Company").WithMany("Logos").HasForeignKey("CompanyId"). + HasConstraintName("fk_company_logos_company1"); + }); - modelBuilder.Entity("Marechai.Database.Models.Document", - b => - { - b.HasOne("Marechai.Database.Models.Iso31661Numeric", "Country").WithMany("Documents") - .HasForeignKey("CountryId"); - }); + modelBuilder.Entity("Marechai.Database.Models.Document", b => + { + b.HasOne("Marechai.Database.Models.Iso31661Numeric", "Country").WithMany("Documents"). + HasForeignKey("CountryId"); + }); - modelBuilder.Entity("Marechai.Database.Models.DocumentCompany", - b => - { - b.HasOne("Marechai.Database.Models.Company", "Company").WithOne("DocumentCompany") - .HasForeignKey("Marechai.Database.Models.DocumentCompany", "CompanyId") - .OnDelete(DeleteBehavior.SetNull); - }); + modelBuilder.Entity("Marechai.Database.Models.DocumentCompany", b => + { + b.HasOne("Marechai.Database.Models.Company", "Company").WithOne("DocumentCompany"). + HasForeignKey("Marechai.Database.Models.DocumentCompany", "CompanyId"). + OnDelete(DeleteBehavior.SetNull); + }); - modelBuilder.Entity("Marechai.Database.Models.DocumentPerson", - b => - { - b.HasOne("Marechai.Database.Models.Person", "Person").WithOne("DocumentPerson") - .HasForeignKey("Marechai.Database.Models.DocumentPerson", "PersonId") - .OnDelete(DeleteBehavior.SetNull); - }); + modelBuilder.Entity("Marechai.Database.Models.DocumentPerson", b => + { + b.HasOne("Marechai.Database.Models.Person", "Person").WithOne("DocumentPerson"). + HasForeignKey("Marechai.Database.Models.DocumentPerson", "PersonId").OnDelete(DeleteBehavior.SetNull); + }); modelBuilder.Entity("Marechai.Database.Models.DocumentsByMachine", b => { - b.HasOne("Marechai.Database.Models.Document", "Document").WithMany("Machines").HasForeignKey("DocumentId") - .OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.Document", "Document").WithMany("Machines"). + HasForeignKey("DocumentId").OnDelete(DeleteBehavior.Cascade); - b.HasOne("Marechai.Database.Models.Machine", "Machine").WithMany("Documents").HasForeignKey("MachineId") - .OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.Machine", "Machine").WithMany("Documents"). + HasForeignKey("MachineId").OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Marechai.Database.Models.DocumentsByMachineFamily", b => { - b.HasOne("Marechai.Database.Models.Document", "Document").WithMany("MachineFamilies") - .HasForeignKey("DocumentId").OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.Document", "Document").WithMany("MachineFamilies"). + HasForeignKey("DocumentId").OnDelete(DeleteBehavior.Cascade); - b.HasOne("Marechai.Database.Models.MachineFamily", "MachineFamily").WithMany("Documents") - .HasForeignKey("MachineFamilyId").OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.MachineFamily", "MachineFamily").WithMany("Documents"). + HasForeignKey("MachineFamilyId").OnDelete(DeleteBehavior.Cascade); }); - modelBuilder.Entity("Marechai.Database.Models.Gpu", - b => - { - b.HasOne("Marechai.Database.Models.Company", "Company").WithMany("Gpus") - .HasForeignKey("CompanyId").HasConstraintName("fk_gpus_company"); - }); + modelBuilder.Entity("Marechai.Database.Models.Gpu", b => + { + b.HasOne("Marechai.Database.Models.Company", "Company").WithMany("Gpus").HasForeignKey("CompanyId"). + HasConstraintName("fk_gpus_company"); + }); modelBuilder.Entity("Marechai.Database.Models.GpusByMachine", b => { - b.HasOne("Marechai.Database.Models.Gpu", "Gpu").WithMany("GpusByMachine").HasForeignKey("GpuId") - .HasConstraintName("fk_gpus_by_machine_gpu").OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.Gpu", "Gpu").WithMany("GpusByMachine").HasForeignKey("GpuId"). + HasConstraintName("fk_gpus_by_machine_gpu").OnDelete(DeleteBehavior.Cascade); - b.HasOne("Marechai.Database.Models.Machine", "Machine").WithMany("Gpus").HasForeignKey("MachineId") - .HasConstraintName("fk_gpus_by_machine_machine").OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.Machine", "Machine").WithMany("Gpus").HasForeignKey("MachineId"). + HasConstraintName("fk_gpus_by_machine_machine").OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Marechai.Database.Models.GpusByOwnedMachine", b => { - b.HasOne("Marechai.Database.Models.Gpu", "Gpu").WithMany().HasForeignKey("GpuId") - .OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.Gpu", "Gpu").WithMany().HasForeignKey("GpuId"). + OnDelete(DeleteBehavior.Cascade); - b.HasOne("Marechai.Database.Models.OwnedMachine", "OwnedMachine").WithMany("Gpus") - .HasForeignKey("OwnedMachineId").OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.OwnedMachine", "OwnedMachine").WithMany("Gpus"). + HasForeignKey("OwnedMachineId").OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Marechai.Database.Models.InstructionSetExtensionsByProcessor", b => { - b.HasOne("Marechai.Database.Models.InstructionSetExtension", "Extension") - .WithMany("InstructionSetExtensionsByProcessor").HasForeignKey("ExtensionId") - .HasConstraintName("fk_extension_extension_id"); + b.HasOne("Marechai.Database.Models.InstructionSetExtension", "Extension"). + WithMany("InstructionSetExtensionsByProcessor").HasForeignKey("ExtensionId"). + HasConstraintName("fk_extension_extension_id"); - b.HasOne("Marechai.Database.Models.Processor", "Processor").WithMany("InstructionSetExtensions") - .HasForeignKey("ProcessorId").HasConstraintName("fk_extension_processor_id"); + b.HasOne("Marechai.Database.Models.Processor", "Processor").WithMany("InstructionSetExtensions"). + HasForeignKey("ProcessorId").HasConstraintName("fk_extension_processor_id"); }); modelBuilder.Entity("Marechai.Database.Models.Machine", b => { - b.HasOne("Marechai.Database.Models.Company", "Company").WithMany("Machines").HasForeignKey("CompanyId") - .HasConstraintName("fk_machines_company"); + b.HasOne("Marechai.Database.Models.Company", "Company").WithMany("Machines").HasForeignKey("CompanyId"). + HasConstraintName("fk_machines_company"); - b.HasOne("Marechai.Database.Models.MachineFamily", "Family").WithMany("Machines").HasForeignKey("FamilyId") - .HasConstraintName("fk_machines_family"); + b.HasOne("Marechai.Database.Models.MachineFamily", "Family").WithMany("Machines"). + HasForeignKey("FamilyId").HasConstraintName("fk_machines_family"); }); - modelBuilder.Entity("Marechai.Database.Models.MachineFamily", - b => - { - b.HasOne("Marechai.Database.Models.Company", "Company").WithMany("MachineFamilies") - .HasForeignKey("CompanyId").HasConstraintName("fk_machine_families_company") - .OnDelete(DeleteBehavior.Cascade); - }); + modelBuilder.Entity("Marechai.Database.Models.MachineFamily", b => + { + b.HasOne("Marechai.Database.Models.Company", "Company").WithMany("MachineFamilies"). + HasForeignKey("CompanyId").HasConstraintName("fk_machine_families_company"). + OnDelete(DeleteBehavior.Cascade); + }); modelBuilder.Entity("Marechai.Database.Models.MachinePhoto", b => { - b.HasOne("Marechai.Database.Models.License", "License").WithMany("Photos").HasForeignKey("LicenseId") - .OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.License", "License").WithMany("Photos").HasForeignKey("LicenseId"). + OnDelete(DeleteBehavior.Cascade); - b.HasOne("Marechai.Database.Models.Machine", "Machine").WithMany("Photos").HasForeignKey("MachineId") - .OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.Machine", "Machine").WithMany("Photos").HasForeignKey("MachineId"). + OnDelete(DeleteBehavior.Cascade); - b.HasOne("Marechai.Database.Models.ApplicationUser", "User").WithMany("Photos").HasForeignKey("UserId") - .OnDelete(DeleteBehavior.SetNull); + b.HasOne("Marechai.Database.Models.ApplicationUser", "User").WithMany("Photos").HasForeignKey("UserId"). + OnDelete(DeleteBehavior.SetNull); }); - modelBuilder.Entity("Marechai.Database.Models.Magazine", - b => - { - b.HasOne("Marechai.Database.Models.Iso31661Numeric", "Country").WithMany("Magazines") - .HasForeignKey("CountryId"); - }); + modelBuilder.Entity("Marechai.Database.Models.Magazine", b => + { + b.HasOne("Marechai.Database.Models.Iso31661Numeric", "Country").WithMany("Magazines"). + HasForeignKey("CountryId"); + }); - modelBuilder.Entity("Marechai.Database.Models.MagazineIssue", - b => - { - b.HasOne("Marechai.Database.Models.Magazine", "Magazine").WithMany("Issues") - .HasForeignKey("MagazineId").OnDelete(DeleteBehavior.Cascade); - }); + modelBuilder.Entity("Marechai.Database.Models.MagazineIssue", b => + { + b.HasOne("Marechai.Database.Models.Magazine", "Magazine").WithMany("Issues"). + HasForeignKey("MagazineId").OnDelete(DeleteBehavior.Cascade); + }); modelBuilder.Entity("Marechai.Database.Models.MagazinesByMachine", b => { - b.HasOne("Marechai.Database.Models.Machine", "Machine").WithMany("Magazines").HasForeignKey("MachineId") - .OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.Machine", "Machine").WithMany("Magazines"). + HasForeignKey("MachineId").OnDelete(DeleteBehavior.Cascade); - b.HasOne("Marechai.Database.Models.MagazineIssue", "Magazine").WithMany("Machines") - .HasForeignKey("MagazineId").OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.MagazineIssue", "Magazine").WithMany("Machines"). + HasForeignKey("MagazineId").OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Marechai.Database.Models.MagazinesByMachineFamily", b => { - b.HasOne("Marechai.Database.Models.MachineFamily", "MachineFamily").WithMany("Magazines") - .HasForeignKey("MachineFamilyId").OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.MachineFamily", "MachineFamily").WithMany("Magazines"). + HasForeignKey("MachineFamilyId").OnDelete(DeleteBehavior.Cascade); - b.HasOne("Marechai.Database.Models.MagazineIssue", "Magazine").WithMany("MachineFamilies") - .HasForeignKey("MagazineId").OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.MagazineIssue", "Magazine").WithMany("MachineFamilies"). + HasForeignKey("MagazineId").OnDelete(DeleteBehavior.Cascade); }); - modelBuilder.Entity("Marechai.Database.Models.MemoryByMachine", - b => - { - b.HasOne("Marechai.Database.Models.Machine", "Machine").WithMany("Memory") - .HasForeignKey("MachineId").HasConstraintName("fk_memory_by_machine_machine") - .OnDelete(DeleteBehavior.Cascade); - }); + modelBuilder.Entity("Marechai.Database.Models.MemoryByMachine", b => + { + b.HasOne("Marechai.Database.Models.Machine", "Machine").WithMany("Memory").HasForeignKey("MachineId"). + HasConstraintName("fk_memory_by_machine_machine").OnDelete(DeleteBehavior.Cascade); + }); - modelBuilder.Entity("Marechai.Database.Models.MemoryByOwnedMachine", - b => - { - b.HasOne("Marechai.Database.Models.OwnedMachine", "OwnedMachine").WithMany("Memory") - .HasForeignKey("OwnedMachineId").OnDelete(DeleteBehavior.Cascade); - }); + modelBuilder.Entity("Marechai.Database.Models.MemoryByOwnedMachine", b => + { + b.HasOne("Marechai.Database.Models.OwnedMachine", "OwnedMachine").WithMany("Memory"). + HasForeignKey("OwnedMachineId").OnDelete(DeleteBehavior.Cascade); + }); modelBuilder.Entity("Marechai.Database.Models.OwnedMachine", b => { - b.HasOne("Marechai.Database.Models.Machine", "Machine").WithMany().HasForeignKey("MachineId") - .OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.Machine", "Machine").WithMany().HasForeignKey("MachineId"). + OnDelete(DeleteBehavior.Cascade); - b.HasOne("Marechai.Database.Models.ApplicationUser", "User").WithMany("OwnedMachines") - .HasForeignKey("UserId").OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.ApplicationUser", "User").WithMany("OwnedMachines"). + HasForeignKey("UserId").OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Marechai.Database.Models.OwnedMachinePhoto", b => { - b.HasOne("Marechai.Database.Models.License", "License").WithMany("OwnedMachinePhotos") - .HasForeignKey("LicenseId").OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.License", "License").WithMany("OwnedMachinePhotos"). + HasForeignKey("LicenseId").OnDelete(DeleteBehavior.Cascade); - b.HasOne("Marechai.Database.Models.OwnedMachine", "OwnedMachine").WithMany("Photos") - .HasForeignKey("OwnedMachineId").OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.OwnedMachine", "OwnedMachine").WithMany("Photos"). + HasForeignKey("OwnedMachineId").OnDelete(DeleteBehavior.Cascade); - b.HasOne("Marechai.Database.Models.ApplicationUser", "User").WithMany("OwnedMachinePhotos") - .HasForeignKey("UserId").OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.ApplicationUser", "User").WithMany("OwnedMachinePhotos"). + HasForeignKey("UserId").OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Marechai.Database.Models.PeopleByBook", b => { - b.HasOne("Marechai.Database.Models.Book", "Book").WithMany("People").HasForeignKey("BookId") - .OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.Book", "Book").WithMany("People").HasForeignKey("BookId"). + OnDelete(DeleteBehavior.Cascade); - b.HasOne("Marechai.Database.Models.DocumentPerson", "Person").WithMany("Books").HasForeignKey("PersonId") - .OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.DocumentPerson", "Person").WithMany("Books"). + HasForeignKey("PersonId").OnDelete(DeleteBehavior.Cascade); - b.HasOne("Marechai.Database.Models.DocumentRole", "Role").WithMany().HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.DocumentRole", "Role").WithMany().HasForeignKey("RoleId"). + OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Marechai.Database.Models.PeopleByCompany", b => { - b.HasOne("Marechai.Database.Models.Company", "Company").WithMany("People").HasForeignKey("CompanyId") - .OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.Company", "Company").WithMany("People").HasForeignKey("CompanyId"). + OnDelete(DeleteBehavior.Cascade); - b.HasOne("Marechai.Database.Models.Person", "Person").WithMany("Companies").HasForeignKey("PersonId") - .OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.Person", "Person").WithMany("Companies").HasForeignKey("PersonId"). + OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Marechai.Database.Models.PeopleByDocument", b => { - b.HasOne("Marechai.Database.Models.Document", "Document").WithMany("People").HasForeignKey("DocumentId") - .OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.Document", "Document").WithMany("People"). + HasForeignKey("DocumentId").OnDelete(DeleteBehavior.Cascade); - b.HasOne("Marechai.Database.Models.DocumentPerson", "Person").WithMany("Documents") - .HasForeignKey("PersonId").OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.DocumentPerson", "Person").WithMany("Documents"). + HasForeignKey("PersonId").OnDelete(DeleteBehavior.Cascade); - b.HasOne("Marechai.Database.Models.DocumentRole", "Role").WithMany().HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.DocumentRole", "Role").WithMany().HasForeignKey("RoleId"). + OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Marechai.Database.Models.PeopleByMagazine", b => { - b.HasOne("Marechai.Database.Models.MagazineIssue", "Magazine").WithMany("People") - .HasForeignKey("MagazineId").OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.MagazineIssue", "Magazine").WithMany("People"). + HasForeignKey("MagazineId").OnDelete(DeleteBehavior.Cascade); - b.HasOne("Marechai.Database.Models.DocumentPerson", "Person").WithMany("Magazines") - .HasForeignKey("PersonId").OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.DocumentPerson", "Person").WithMany("Magazines"). + HasForeignKey("PersonId").OnDelete(DeleteBehavior.Cascade); - b.HasOne("Marechai.Database.Models.DocumentRole", "Role").WithMany().HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.DocumentRole", "Role").WithMany().HasForeignKey("RoleId"). + OnDelete(DeleteBehavior.Cascade); }); - modelBuilder.Entity("Marechai.Database.Models.Person", - b => - { - b.HasOne("Marechai.Database.Models.Iso31661Numeric", "CountryOfBirth") - .WithMany("People").HasForeignKey("CountryOfBirthId"); - }); + modelBuilder.Entity("Marechai.Database.Models.Person", b => + { + b.HasOne("Marechai.Database.Models.Iso31661Numeric", "CountryOfBirth").WithMany("People"). + HasForeignKey("CountryOfBirthId"); + }); modelBuilder.Entity("Marechai.Database.Models.Processor", b => { - b.HasOne("Marechai.Database.Models.Company", "Company").WithMany("Processors").HasForeignKey("CompanyId") - .HasConstraintName("fk_processors_company"); + b.HasOne("Marechai.Database.Models.Company", "Company").WithMany("Processors"). + HasForeignKey("CompanyId").HasConstraintName("fk_processors_company"); - b.HasOne("Marechai.Database.Models.InstructionSet", "InstructionSet").WithMany("Processors") - .HasForeignKey("InstructionSetId").HasConstraintName("fk_processors_instruction_set"); + b.HasOne("Marechai.Database.Models.InstructionSet", "InstructionSet").WithMany("Processors"). + HasForeignKey("InstructionSetId").HasConstraintName("fk_processors_instruction_set"); }); modelBuilder.Entity("Marechai.Database.Models.ProcessorsByMachine", b => { - b.HasOne("Marechai.Database.Models.Machine", "Machine").WithMany("Processors").HasForeignKey("MachineId") - .HasConstraintName("fk_processors_by_machine_machine").OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.Machine", "Machine").WithMany("Processors"). + HasForeignKey("MachineId").HasConstraintName("fk_processors_by_machine_machine"). + OnDelete(DeleteBehavior.Cascade); - b.HasOne("Marechai.Database.Models.Processor", "Processor").WithMany("ProcessorsByMachine") - .HasForeignKey("ProcessorId").HasConstraintName("fk_processors_by_machine_processor") - .OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.Processor", "Processor").WithMany("ProcessorsByMachine"). + HasForeignKey("ProcessorId").HasConstraintName("fk_processors_by_machine_processor"). + OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Marechai.Database.Models.ProcessorsByOwnedMachine", b => { - b.HasOne("Marechai.Database.Models.OwnedMachine", "OwnedMachine").WithMany("Processors") - .HasForeignKey("OwnedMachineId").OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.OwnedMachine", "OwnedMachine").WithMany("Processors"). + HasForeignKey("OwnedMachineId").OnDelete(DeleteBehavior.Cascade); - b.HasOne("Marechai.Database.Models.Processor", "Processor").WithMany().HasForeignKey("ProcessorId") - .OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.Processor", "Processor").WithMany().HasForeignKey("ProcessorId"). + OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Marechai.Database.Models.ResolutionsByGpu", b => { - b.HasOne("Marechai.Database.Models.Gpu", "Gpu").WithMany("ResolutionsByGpu").HasForeignKey("GpuId") - .HasConstraintName("fk_resolutions_by_gpu_gpu").OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.Gpu", "Gpu").WithMany("ResolutionsByGpu").HasForeignKey("GpuId"). + HasConstraintName("fk_resolutions_by_gpu_gpu").OnDelete(DeleteBehavior.Cascade); - b.HasOne("Marechai.Database.Models.Resolution", "Resolution").WithMany("ResolutionsByGpu") - .HasForeignKey("ResolutionId").HasConstraintName("fk_resolutions_by_gpu_resolution") - .OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.Resolution", "Resolution").WithMany("ResolutionsByGpu"). + HasForeignKey("ResolutionId").HasConstraintName("fk_resolutions_by_gpu_resolution"). + OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Marechai.Database.Models.ResolutionsByScreen", b => { - b.HasOne("Marechai.Database.Models.Resolution", "Resolution").WithMany("ResolutionsByScreen") - .HasForeignKey("ResolutionId").OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.Resolution", "Resolution").WithMany("ResolutionsByScreen"). + HasForeignKey("ResolutionId").OnDelete(DeleteBehavior.Cascade); - b.HasOne("Marechai.Database.Models.Screen", "Screen").WithMany("Resolutions").HasForeignKey("ScreenId") - .OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.Screen", "Screen").WithMany("Resolutions").HasForeignKey("ScreenId"). + OnDelete(DeleteBehavior.Cascade); }); - modelBuilder.Entity("Marechai.Database.Models.Screen", - b => - { - b.HasOne("Marechai.Database.Models.Resolution", "NativeResolution").WithMany("Screens") - .HasForeignKey("NativeResolutionId").OnDelete(DeleteBehavior.Cascade); - }); + modelBuilder.Entity("Marechai.Database.Models.Screen", b => + { + b.HasOne("Marechai.Database.Models.Resolution", "NativeResolution").WithMany("Screens"). + HasForeignKey("NativeResolutionId").OnDelete(DeleteBehavior.Cascade); + }); modelBuilder.Entity("Marechai.Database.Models.ScreensByMachine", b => { - b.HasOne("Marechai.Database.Models.Machine", "Machine").WithMany("Screens").HasForeignKey("MachineId") - .OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.Machine", "Machine").WithMany("Screens").HasForeignKey("MachineId"). + OnDelete(DeleteBehavior.Cascade); - b.HasOne("Marechai.Database.Models.Screen", "Screen").WithMany("ScreensByMachines") - .HasForeignKey("ScreenId").OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.Screen", "Screen").WithMany("ScreensByMachines"). + HasForeignKey("ScreenId").OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Marechai.Database.Models.SoundByMachine", b => { - b.HasOne("Marechai.Database.Models.Machine", "Machine").WithMany("Sound").HasForeignKey("MachineId") - .HasConstraintName("fk_sound_by_machine_machine").OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.Machine", "Machine").WithMany("Sound").HasForeignKey("MachineId"). + HasConstraintName("fk_sound_by_machine_machine").OnDelete(DeleteBehavior.Cascade); - b.HasOne("Marechai.Database.Models.SoundSynth", "SoundSynth").WithMany("SoundByMachine") - .HasForeignKey("SoundSynthId").HasConstraintName("fk_sound_by_machine_sound_synth") - .OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.SoundSynth", "SoundSynth").WithMany("SoundByMachine"). + HasForeignKey("SoundSynthId").HasConstraintName("fk_sound_by_machine_sound_synth"). + OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Marechai.Database.Models.SoundByOwnedMachine", b => { - b.HasOne("Marechai.Database.Models.OwnedMachine", "OwnedMachine").WithMany("Sound") - .HasForeignKey("OwnedMachineId").OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.OwnedMachine", "OwnedMachine").WithMany("Sound"). + HasForeignKey("OwnedMachineId").OnDelete(DeleteBehavior.Cascade); - b.HasOne("Marechai.Database.Models.SoundSynth", "SoundSynth").WithMany().HasForeignKey("SoundSynthId") - .OnDelete(DeleteBehavior.Cascade); + b.HasOne("Marechai.Database.Models.SoundSynth", "SoundSynth").WithMany().HasForeignKey("SoundSynthId"). + OnDelete(DeleteBehavior.Cascade); }); - modelBuilder.Entity("Marechai.Database.Models.SoundSynth", - b => - { - b.HasOne("Marechai.Database.Models.Company", "Company").WithMany("SoundSynths") - .HasForeignKey("CompanyId").HasConstraintName("fk_sound_synths_company"); - }); + modelBuilder.Entity("Marechai.Database.Models.SoundSynth", b => + { + b.HasOne("Marechai.Database.Models.Company", "Company").WithMany("SoundSynths"). + HasForeignKey("CompanyId").HasConstraintName("fk_sound_synths_company"); + }); - modelBuilder.Entity("Marechai.Database.Models.StorageByMachine", - b => - { - b.HasOne("Marechai.Database.Models.Machine", "Machine").WithMany("Storage") - .HasForeignKey("MachineId").HasConstraintName("fk_storage_by_machine_machine") - .OnDelete(DeleteBehavior.Cascade); - }); + modelBuilder.Entity("Marechai.Database.Models.StorageByMachine", b => + { + b.HasOne("Marechai.Database.Models.Machine", "Machine").WithMany("Storage").HasForeignKey("MachineId"). + HasConstraintName("fk_storage_by_machine_machine").OnDelete(DeleteBehavior.Cascade); + }); - modelBuilder.Entity("Marechai.Database.Models.StorageByOwnedMachine", - b => - { - b.HasOne("Marechai.Database.Models.OwnedMachine", "OwnedMachine").WithMany("Storage") - .HasForeignKey("OwnedMachineId").OnDelete(DeleteBehavior.Cascade); - }); + modelBuilder.Entity("Marechai.Database.Models.StorageByOwnedMachine", b => + { + b.HasOne("Marechai.Database.Models.OwnedMachine", "OwnedMachine").WithMany("Storage"). + HasForeignKey("OwnedMachineId").OnDelete(DeleteBehavior.Cascade); + }); - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", - b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole").WithMany() - .HasForeignKey("RoleId").OnDelete(DeleteBehavior.Cascade); - }); + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole").WithMany().HasForeignKey("RoleId"). + OnDelete(DeleteBehavior.Cascade); + }); - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", - b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser").WithMany() - .HasForeignKey("UserId").OnDelete(DeleteBehavior.Cascade); - }); + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser").WithMany().HasForeignKey("UserId"). + OnDelete(DeleteBehavior.Cascade); + }); - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", - b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser").WithMany() - .HasForeignKey("UserId").OnDelete(DeleteBehavior.Cascade); - }); + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser").WithMany().HasForeignKey("UserId"). + OnDelete(DeleteBehavior.Cascade); + }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole").WithMany().HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole").WithMany().HasForeignKey("RoleId"). + OnDelete(DeleteBehavior.Cascade); - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser").WithMany().HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); + b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser").WithMany().HasForeignKey("UserId"). + OnDelete(DeleteBehavior.Cascade); }); - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", - b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser").WithMany() - .HasForeignKey("UserId").OnDelete(DeleteBehavior.Cascade); - }); + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser").WithMany().HasForeignKey("UserId"). + OnDelete(DeleteBehavior.Cascade); + }); #pragma warning restore 612, 618 } } diff --git a/Marechai.Database/Models/BrowserTest.cs b/Marechai.Database/Models/BrowserTest.cs index 10897899..d2a4b2be 100644 --- a/Marechai.Database/Models/BrowserTest.cs +++ b/Marechai.Database/Models/BrowserTest.cs @@ -35,22 +35,15 @@ namespace Marechai.Database.Models { public class BrowserTest : BaseModel { - [DisplayName("User agent")] - [Required] - [StringLength(128)] + [DisplayName("User agent"), Required, StringLength(128)] public string UserAgent { get; set; } - [Required] - [StringLength(64)] + [Required, StringLength(64)] public string Browser { get; set; } - [Required] - [StringLength(16)] + [Required, StringLength(16)] public string Version { get; set; } - [DisplayName("Operating system")] - [Required] - [StringLength(32)] + [DisplayName("Operating system"), Required, StringLength(32)] public string Os { get; set; } - [Required] - [StringLength(8)] + [Required, StringLength(8)] public string Platform { get; set; } [DisplayName("GIF87")] public bool Gif87 { get; set; } diff --git a/Marechai.Database/Models/CompaniesByBook.cs b/Marechai.Database/Models/CompaniesByBook.cs index f5f7013b..e18120c5 100644 --- a/Marechai.Database/Models/CompaniesByBook.cs +++ b/Marechai.Database/Models/CompaniesByBook.cs @@ -7,12 +7,11 @@ namespace Marechai.Database.Models { public int CompanyId { get; set; } public long BookId { get; set; } - [Column(TypeName = "char(3)")] - [Required] + [Column(TypeName = "char(3)"), Required] public string RoleId { get; set; } public virtual DocumentCompany Company { get; set; } public virtual Book Book { get; set; } - public virtual DocumentRole Role { get; set; } + public virtual DocumentRole Role { get; set; } } } \ No newline at end of file diff --git a/Marechai.Database/Models/CompaniesByDocument.cs b/Marechai.Database/Models/CompaniesByDocument.cs index 1cd4083c..85603f02 100644 --- a/Marechai.Database/Models/CompaniesByDocument.cs +++ b/Marechai.Database/Models/CompaniesByDocument.cs @@ -7,8 +7,7 @@ namespace Marechai.Database.Models { public int CompanyId { get; set; } public long DocumentId { get; set; } - [Column(TypeName = "char(3)")] - [Required] + [Column(TypeName = "char(3)"), Required] public string RoleId { get; set; } public virtual DocumentCompany Company { get; set; } diff --git a/Marechai.Database/Models/CompaniesByMagazine.cs b/Marechai.Database/Models/CompaniesByMagazine.cs index 97a24505..01ceeb23 100644 --- a/Marechai.Database/Models/CompaniesByMagazine.cs +++ b/Marechai.Database/Models/CompaniesByMagazine.cs @@ -7,8 +7,7 @@ namespace Marechai.Database.Models { public int CompanyId { get; set; } public long MagazineId { get; set; } - [Column(TypeName = "char(3)")] - [Required] + [Column(TypeName = "char(3)"), Required] public string RoleId { get; set; } public virtual DocumentCompany Company { get; set; } diff --git a/Marechai.Database/Models/Company.cs b/Marechai.Database/Models/Company.cs index 4c3ad759..518ffebe 100644 --- a/Marechai.Database/Models/Company.cs +++ b/Marechai.Database/Models/Company.cs @@ -52,18 +52,15 @@ namespace Marechai.Database.Models [Required] public string Name { get; set; } - [DisplayFormat(DataFormatString = "{0:d}", ApplyFormatInEditMode = true)] - [DataType(DataType.Date)] + [DisplayFormat(DataFormatString = "{0:d}", ApplyFormatInEditMode = true), DataType(DataType.Date)] public DateTime? Founded { get; set; } - [Url] - [StringLength(255)] + [Url, StringLength(255)] public string Website { get; set; } [StringLength(45)] public string Twitter { get; set; } [StringLength(45)] public string Facebook { get; set; } - [DisplayFormat(DataFormatString = "{0:d}")] - [DataType(DataType.Date)] + [DisplayFormat(DataFormatString = "{0:d}"), DataType(DataType.Date)] public DateTime? Sold { get; set; } public int? SoldToId { get; set; } [StringLength(80)] @@ -72,8 +69,7 @@ namespace Marechai.Database.Models public string City { get; set; } [StringLength(80)] public string Province { get; set; } - [StringLength(25)] - [DisplayName("Postal code")] + [StringLength(25), DisplayName("Postal code")] public string PostalCode { get; set; } public short? CountryId { get; set; } [Required] @@ -96,18 +92,16 @@ namespace Marechai.Database.Models Logos?.OrderByDescending(l => l.Year).FirstOrDefault(); public virtual DocumentCompany DocumentCompany { get; set; } - [DisplayName("Sold")] - [NotMapped] - public string SoldView => - Status != CompanyStatus.Active && Status != CompanyStatus.Unknown - ? Sold is null - ? "Unknown" - : Sold.Value.ToShortDateString() - : Sold is null - ? SoldToId is null - ? "" - : "Unknown" - : Sold.Value.ToShortDateString(); + [DisplayName("Sold"), NotMapped] + public string SoldView => Status != CompanyStatus.Active && Status != CompanyStatus.Unknown + ? Sold is null + ? "Unknown" + : Sold.Value.ToShortDateString() + : Sold is null + ? SoldToId is null + ? "" + : "Unknown" + : Sold.Value.ToShortDateString(); [NotMapped] public CompanyDescription Description => Descriptions?.FirstOrDefault(); diff --git a/Marechai.Database/Models/CompanyDescription.cs b/Marechai.Database/Models/CompanyDescription.cs index c6413b48..c2d8d704 100644 --- a/Marechai.Database/Models/CompanyDescription.cs +++ b/Marechai.Database/Models/CompanyDescription.cs @@ -36,11 +36,9 @@ namespace Marechai.Database.Models public class CompanyDescription : BaseModel { public int CompanyId { get; set; } - [MaxLength(262144, ErrorMessage = "Description is too long")] - [Required] + [MaxLength(262144, ErrorMessage = "Description is too long"), Required] public string Text { get; set; } - [MaxLength(262144, ErrorMessage = "Description is too long")] - [DisplayName("HTML")] + [MaxLength(262144, ErrorMessage = "Description is too long"), DisplayName("HTML")] public string Html { get; set; } public virtual Company Company { get; set; } diff --git a/Marechai.Database/Models/CompanyLogo.cs b/Marechai.Database/Models/CompanyLogo.cs index c8c145b2..17202908 100644 --- a/Marechai.Database/Models/CompanyLogo.cs +++ b/Marechai.Database/Models/CompanyLogo.cs @@ -45,9 +45,7 @@ namespace Marechai.Database.Models public virtual Company Company { get; set; } - [NotMapped] - [Required(ErrorMessage = "SVG logo required")] - [DisplayName("Upload SVG logo:")] + [NotMapped, Required(ErrorMessage = "SVG logo required"), DisplayName("Upload SVG logo:")] public IFormFile SvgLogo { get; set; } [NotMapped] diff --git a/Marechai.Database/Models/DocumentBase.cs b/Marechai.Database/Models/DocumentBase.cs index 30604e08..2773be6e 100644 --- a/Marechai.Database/Models/DocumentBase.cs +++ b/Marechai.Database/Models/DocumentBase.cs @@ -8,8 +8,7 @@ namespace Marechai.Database.Models [Required] public string Title { get; set; } public string NativeTitle { get; set; } - [DisplayFormat(DataFormatString = "{0:d}")] - [DataType(DataType.Date)] + [DisplayFormat(DataFormatString = "{0:d}"), DataType(DataType.Date)] public DateTime? Published { get; set; } public short? CountryId { get; set; } [MaxLength(262144, ErrorMessage = "Synopsis is too long")] diff --git a/Marechai.Database/Models/DocumentPerson.cs b/Marechai.Database/Models/DocumentPerson.cs index 29de140f..80ec5df1 100644 --- a/Marechai.Database/Models/DocumentPerson.cs +++ b/Marechai.Database/Models/DocumentPerson.cs @@ -16,8 +16,7 @@ namespace Marechai.Database.Models [DisplayName("Name to be displayed")] public string DisplayName { get; set; } - [NotMapped] - [DisplayName("Name")] + [NotMapped, DisplayName("Name")] public string FullName => DisplayName ?? Alias ?? $"{Name} {Surname}"; [DisplayName("Linked person")] diff --git a/Marechai.Database/Models/DocumentRole.cs b/Marechai.Database/Models/DocumentRole.cs index 418a3a55..a7f294bf 100644 --- a/Marechai.Database/Models/DocumentRole.cs +++ b/Marechai.Database/Models/DocumentRole.cs @@ -5,9 +5,7 @@ namespace Marechai.Database.Models { public class DocumentRole { - [Column(TypeName = "char(3)")] - [Key] - [Required] + [Column(TypeName = "char(3)"), Key, Required] public string Id { get; set; } public string Name { get; set; } public bool Enabled { get; set; } diff --git a/Marechai.Database/Models/Gpu.cs b/Marechai.Database/Models/Gpu.cs index 5ec12da3..d2f81a56 100644 --- a/Marechai.Database/Models/Gpu.cs +++ b/Marechai.Database/Models/Gpu.cs @@ -45,15 +45,12 @@ namespace Marechai.Database.Models ResolutionsByGpu = new HashSet(); } - [Required] - [StringLength(128)] + [Required, StringLength(128)] public string Name { get; set; } public int? CompanyId { get; set; } - [DisplayName("Model code")] - [StringLength(45)] + [DisplayName("Model code"), StringLength(45)] public string ModelCode { get; set; } - [DisplayFormat(DataFormatString = "{0:d}")] - [DataType(DataType.Date)] + [DisplayFormat(DataFormatString = "{0:d}"), DataType(DataType.Date)] public DateTime? Introduced { get; set; } [StringLength(45)] public string Package { get; set; } diff --git a/Marechai.Database/Models/InstructionSet.cs b/Marechai.Database/Models/InstructionSet.cs index f5c858bb..90dbe572 100644 --- a/Marechai.Database/Models/InstructionSet.cs +++ b/Marechai.Database/Models/InstructionSet.cs @@ -36,14 +36,9 @@ namespace Marechai.Database.Models { public class InstructionSet : BaseModel { - public InstructionSet() - { - Processors = new HashSet(); - } + public InstructionSet() => Processors = new HashSet(); - [Required] - [StringLength(45)] - [Remote("VerifyUnique", "InstructionSets", "Admin")] + [Required, StringLength(45), Remote("VerifyUnique", "InstructionSets", "Admin")] public string Name { get; set; } public virtual ICollection Processors { get; set; } diff --git a/Marechai.Database/Models/InstructionSetExtension.cs b/Marechai.Database/Models/InstructionSetExtension.cs index b6f04740..d402ea78 100644 --- a/Marechai.Database/Models/InstructionSetExtension.cs +++ b/Marechai.Database/Models/InstructionSetExtension.cs @@ -37,15 +37,10 @@ namespace Marechai.Database.Models { public class InstructionSetExtension : BaseModel { - public InstructionSetExtension() - { + public InstructionSetExtension() => InstructionSetExtensionsByProcessor = new HashSet(); - } - [DisplayName("Name")] - [Required] - [StringLength(45)] - [Remote("VerifyUnique", "InstructionSetExtensions", "Admin")] + [DisplayName("Name"), Required, StringLength(45), Remote("VerifyUnique", "InstructionSetExtensions", "Admin")] public string Extension { get; set; } public virtual ICollection InstructionSetExtensionsByProcessor diff --git a/Marechai.Database/Models/Iso31661Numeric.cs b/Marechai.Database/Models/Iso31661Numeric.cs index 79b0a7bf..a4be7392 100644 --- a/Marechai.Database/Models/Iso31661Numeric.cs +++ b/Marechai.Database/Models/Iso31661Numeric.cs @@ -35,15 +35,11 @@ namespace Marechai.Database.Models { public class Iso31661Numeric { - public Iso31661Numeric() - { - Companies = new HashSet(); - } + public Iso31661Numeric() => Companies = new HashSet(); [Required] public short Id { get; set; } - [Required] - [StringLength(64)] + [Required, StringLength(64)] public string Name { get; set; } public virtual ICollection Companies { get; set; } diff --git a/Marechai.Database/Models/Iso639.cs b/Marechai.Database/Models/Iso639.cs index 32bc16a0..6bb7e7f0 100644 --- a/Marechai.Database/Models/Iso639.cs +++ b/Marechai.Database/Models/Iso639.cs @@ -3,14 +3,10 @@ using System.ComponentModel.DataAnnotations.Schema; namespace Marechai.Database.Models { - /// - /// ISO-639 codes - /// + /// ISO-639 codes public class Iso639 { - [Column(TypeName = "char(3)")] - [Key] - [Required] + [Column(TypeName = "char(3)"), Key, Required] public string Id { get; set; } [Column(TypeName = "char(3)")] public string Part2B { get; set; } @@ -18,14 +14,11 @@ namespace Marechai.Database.Models public string Part2T { get; set; } [Column(TypeName = "char(2)")] public string Part1 { get; set; } - [Column(TypeName = "char(1)")] - [Required] + [Column(TypeName = "char(1)"), Required] public string Scope { get; set; } - [Column(TypeName = "char(1)")] - [Required] + [Column(TypeName = "char(1)"), Required] public string Type { get; set; } - [Column(TypeName = "varchar(150)")] - [Required] + [Column(TypeName = "varchar(150)"), Required] public string ReferenceName { get; set; } [Column(TypeName = "varchar(150)")] public string Comment { get; set; } diff --git a/Marechai.Database/Models/License.cs b/Marechai.Database/Models/License.cs index 5fefb9f9..b43926df 100644 --- a/Marechai.Database/Models/License.cs +++ b/Marechai.Database/Models/License.cs @@ -11,20 +11,14 @@ namespace Marechai.Database.Models public string Name { get; set; } [DisplayName("SPDX identifier")] public string SPDX { get; set; } - [DisplayName("FSF approved")] - [Required] + [DisplayName("FSF approved"), Required] public bool FsfApproved { get; set; } - [DisplayName("OSI approved")] - [Required] + [DisplayName("OSI approved"), Required] public bool OsiApproved { get; set; } - [DisplayName("License text link")] - [StringLength(512)] - [Url] + [DisplayName("License text link"), StringLength(512), Url] public string Link { get; set; } - [DisplayName("License text")] - [Column(TypeName = "longtext")] - [StringLength(131072)] - [DataType(DataType.MultilineText)] + [DisplayName("License text"), Column(TypeName = "longtext"), StringLength(131072), + DataType(DataType.MultilineText)] public string Text { get; set; } public virtual ICollection Photos { get; set; } public virtual ICollection OwnedMachinePhotos { get; set; } diff --git a/Marechai.Database/Models/Machine.cs b/Marechai.Database/Models/Machine.cs index 68950280..95291f28 100644 --- a/Marechai.Database/Models/Machine.cs +++ b/Marechai.Database/Models/Machine.cs @@ -49,13 +49,11 @@ namespace Marechai.Database.Models [Required] public int CompanyId { get; set; } - [Required] - [StringLength(255)] + [Required, StringLength(255)] public string Name { get; set; } [Required] public MachineType Type { get; set; } - [DisplayFormat(DataFormatString = "{0:d}")] - [DataType(DataType.Date)] + [DisplayFormat(DataFormatString = "{0:d}"), DataType(DataType.Date)] public DateTime? Introduced { get; set; } public int? FamilyId { get; set; } [StringLength(50)] @@ -74,8 +72,7 @@ namespace Marechai.Database.Models public virtual ICollection Books { get; set; } public virtual ICollection Magazines { get; set; } - [NotMapped] - [DisplayName("Introduced")] + [NotMapped, DisplayName("Introduced")] public string IntroducedView => Introduced == DateTime.MinValue ? "Prototype" : Introduced?.ToShortDateString() ?? "Unknown"; } diff --git a/Marechai.Database/Models/MachineFamily.cs b/Marechai.Database/Models/MachineFamily.cs index fd4790a7..b12ed89d 100644 --- a/Marechai.Database/Models/MachineFamily.cs +++ b/Marechai.Database/Models/MachineFamily.cs @@ -35,14 +35,10 @@ namespace Marechai.Database.Models { public class MachineFamily : BaseModel { - public MachineFamily() - { - Machines = new HashSet(); - } + public MachineFamily() => Machines = new HashSet(); public int CompanyId { get; set; } - [Required] - [StringLength(255)] + [Required, StringLength(255)] public string Name { get; set; } public virtual Company Company { get; set; } diff --git a/Marechai.Database/Models/Magazine.cs b/Marechai.Database/Models/Magazine.cs index 1f19e567..0d2a166e 100644 --- a/Marechai.Database/Models/Magazine.cs +++ b/Marechai.Database/Models/Magazine.cs @@ -8,8 +8,7 @@ namespace Marechai.Database.Models { [StringLength(8, MinimumLength = 8)] public string Issn { get; set; } - [DisplayFormat(DataFormatString = "{0:d}")] - [DataType(DataType.Date)] + [DisplayFormat(DataFormatString = "{0:d}"), DataType(DataType.Date)] public DateTime? FirstPublication { get; set; } public virtual Iso31661Numeric Country { get; set; } diff --git a/Marechai.Database/Models/MagazineIssue.cs b/Marechai.Database/Models/MagazineIssue.cs index 96187ca3..c63517ca 100644 --- a/Marechai.Database/Models/MagazineIssue.cs +++ b/Marechai.Database/Models/MagazineIssue.cs @@ -11,8 +11,7 @@ namespace Marechai.Database.Models [Required] public string Caption { get; set; } public string NativeCaption { get; set; } - [DisplayFormat(DataFormatString = "{0:d}")] - [DataType(DataType.Date)] + [DisplayFormat(DataFormatString = "{0:d}"), DataType(DataType.Date)] public DateTime? Published { get; set; } [StringLength(18)] public string ProductCode { get; set; } diff --git a/Marechai.Database/Models/MarechaiContext.cs b/Marechai.Database/Models/MarechaiContext.cs index ae7990b7..73870dc8 100644 --- a/Marechai.Database/Models/MarechaiContext.cs +++ b/Marechai.Database/Models/MarechaiContext.cs @@ -43,7 +43,7 @@ namespace Marechai.Database.Models public virtual DbSet BooksByMachines { get; set; } public virtual DbSet BooksByMachineFamilies { get; set; } public virtual DbSet BrowserTests { get; set; } - public virtual DbSet MarechaiDb { get; set; } + public virtual DbSet MarechaiDb { get; set; } public virtual DbSet CompaniesByBooks { get; set; } public virtual DbSet CompaniesByDocuments { get; set; } public virtual DbSet CompaniesByMagazines { get; set; } @@ -99,9 +99,10 @@ namespace Marechai.Database.Models protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { - if(optionsBuilder.IsConfigured) return; + if(optionsBuilder.IsConfigured) + return; - #warning To protect potentially sensitive information in your connection string, you should move it out of source code. See http://go.microsoft.com/fwlink/?LinkId=723263 for guidance on storing connection strings. + #warning To protect potentially sensitive information in your connection string, you should move it out of source code. See http: //go.microsoft.com/fwlink/?LinkId=723263 for guidance on storing connection strings. optionsBuilder.UseMySql("server=localhost;port=3306;user=marechai;password=marechaipass;database=marechai"); optionsBuilder.UseLazyLoadingProxies(); } @@ -128,11 +129,11 @@ namespace Marechai.Database.Models entity.HasIndex(e => e.Edition); - entity.HasOne(d => d.Previous).WithOne(d => d.Next).HasForeignKey(d => d.PreviousId) - .OnDelete(DeleteBehavior.ClientSetNull); + entity.HasOne(d => d.Previous).WithOne(d => d.Next).HasForeignKey(d => d.PreviousId). + OnDelete(DeleteBehavior.ClientSetNull); - entity.HasOne(d => d.Source).WithMany(d => d.Derivates).HasForeignKey(d => d.SourceId) - .OnDelete(DeleteBehavior.ClientSetNull); + entity.HasOne(d => d.Source).WithMany(d => d.Derivates).HasForeignKey(d => d.SourceId). + OnDelete(DeleteBehavior.ClientSetNull); entity.HasOne(d => d.Country).WithMany(p => p.Books).HasForeignKey(d => d.CountryId); }); @@ -175,51 +176,51 @@ namespace Marechai.Database.Models entity.Property(e => e.Id).HasColumnName("id").HasColumnType("int(11)"); - entity.Property(e => e.Agif).HasColumnName("agif").HasColumnType("tinyint(1)") - .HasDefaultValueSql("'0'"); + entity.Property(e => e.Agif).HasColumnName("agif").HasColumnType("tinyint(1)"). + HasDefaultValueSql("'0'"); - entity.Property(e => e.Browser).IsRequired().HasColumnName("browser").HasColumnType("varchar(64)") - .HasDefaultValueSql("''"); + entity.Property(e => e.Browser).IsRequired().HasColumnName("browser").HasColumnType("varchar(64)"). + HasDefaultValueSql("''"); - entity.Property(e => e.Colors).HasColumnName("colors").HasColumnType("tinyint(1)") - .HasDefaultValueSql("'0'"); + entity.Property(e => e.Colors).HasColumnName("colors").HasColumnType("tinyint(1)"). + HasDefaultValueSql("'0'"); - entity.Property(e => e.Flash).HasColumnName("flash").HasColumnType("tinyint(1)") - .HasDefaultValueSql("'0'"); + entity.Property(e => e.Flash).HasColumnName("flash").HasColumnType("tinyint(1)"). + HasDefaultValueSql("'0'"); - entity.Property(e => e.Frames).HasColumnName("frames").HasColumnType("tinyint(1)") - .HasDefaultValueSql("'0'"); + entity.Property(e => e.Frames).HasColumnName("frames").HasColumnType("tinyint(1)"). + HasDefaultValueSql("'0'"); - entity.Property(e => e.Gif87).HasColumnName("gif87").HasColumnType("tinyint(1)") - .HasDefaultValueSql("'0'"); + entity.Property(e => e.Gif87).HasColumnName("gif87").HasColumnType("tinyint(1)"). + HasDefaultValueSql("'0'"); - entity.Property(e => e.Gif89).HasColumnName("gif89").HasColumnType("tinyint(1)") - .HasDefaultValueSql("'0'"); + entity.Property(e => e.Gif89).HasColumnName("gif89").HasColumnType("tinyint(1)"). + HasDefaultValueSql("'0'"); - entity.Property(e => e.Jpeg).HasColumnName("jpeg").HasColumnType("tinyint(1)") - .HasDefaultValueSql("'0'"); + entity.Property(e => e.Jpeg).HasColumnName("jpeg").HasColumnType("tinyint(1)"). + HasDefaultValueSql("'0'"); entity.Property(e => e.Js).HasColumnName("js").HasColumnType("tinyint(1)").HasDefaultValueSql("'0'"); - entity.Property(e => e.Os).IsRequired().HasColumnName("os").HasColumnType("varchar(32)") - .HasDefaultValueSql("''"); + entity.Property(e => e.Os).IsRequired().HasColumnName("os").HasColumnType("varchar(32)"). + HasDefaultValueSql("''"); - entity.Property(e => e.Platform).IsRequired().HasColumnName("platform").HasColumnType("varchar(8)") - .HasDefaultValueSql("''"); + entity.Property(e => e.Platform).IsRequired().HasColumnName("platform").HasColumnType("varchar(8)"). + HasDefaultValueSql("''"); entity.Property(e => e.Png).HasColumnName("png").HasColumnType("tinyint(1)").HasDefaultValueSql("'0'"); - entity.Property(e => e.Pngt).HasColumnName("pngt").HasColumnType("tinyint(1)") - .HasDefaultValueSql("'0'"); + entity.Property(e => e.Pngt).HasColumnName("pngt").HasColumnType("tinyint(1)"). + HasDefaultValueSql("'0'"); - entity.Property(e => e.Table).HasColumnName("table").HasColumnType("tinyint(1)") - .HasDefaultValueSql("'0'"); + entity.Property(e => e.Table).HasColumnName("table").HasColumnType("tinyint(1)"). + HasDefaultValueSql("'0'"); - entity.Property(e => e.UserAgent).IsRequired().HasColumnName("user_agent").HasColumnType("varchar(128)") - .HasDefaultValueSql("''"); + entity.Property(e => e.UserAgent).IsRequired().HasColumnName("user_agent"). + HasColumnType("varchar(128)").HasDefaultValueSql("''"); - entity.Property(e => e.Version).IsRequired().HasColumnName("version").HasColumnType("varchar(16)") - .HasDefaultValueSql("''"); + entity.Property(e => e.Version).IsRequired().HasColumnName("version").HasColumnType("varchar(16)"). + HasDefaultValueSql("''"); }); modelBuilder.Entity(entity => @@ -228,8 +229,8 @@ namespace Marechai.Database.Models entity.Property(e => e.Id).HasColumnName("id").HasColumnType("int(11)"); - entity.Property(e => e.Updated).HasColumnName("updated").HasColumnType("datetime") - .HasDefaultValueSql("CURRENT_TIMESTAMP"); + entity.Property(e => e.Updated).HasColumnName("updated").HasColumnType("datetime"). + HasDefaultValueSql("CURRENT_TIMESTAMP"); entity.Property(e => e.Version).HasColumnName("version").HasColumnType("int(11)"); }); @@ -315,8 +316,8 @@ namespace Marechai.Database.Models entity.Property(e => e.Founded).HasColumnName("founded").HasColumnType("datetime"); - entity.Property(e => e.Name).IsRequired().HasColumnName("name").HasColumnType("varchar(128)") - .HasDefaultValueSql("''"); + entity.Property(e => e.Name).IsRequired().HasColumnName("name").HasColumnType("varchar(128)"). + HasDefaultValueSql("''"); entity.Property(e => e.PostalCode).HasColumnName("postal_code").HasColumnType("varchar(25)"); @@ -332,21 +333,24 @@ namespace Marechai.Database.Models entity.Property(e => e.Website).HasColumnName("website").HasColumnType("varchar(255)"); - entity.HasOne(d => d.Country).WithMany(p => p.Companies).HasForeignKey(d => d.CountryId) - .HasConstraintName("fk_companies_country"); + entity.HasOne(d => d.Country).WithMany(p => p.Companies).HasForeignKey(d => d.CountryId). + HasConstraintName("fk_companies_country"); - entity.HasOne(d => d.SoldTo).WithMany(p => p.InverseSoldToNavigation).HasForeignKey(d => d.SoldToId) - .HasConstraintName("fk_companies_sold_to"); + entity.HasOne(d => d.SoldTo).WithMany(p => p.InverseSoldToNavigation).HasForeignKey(d => d.SoldToId). + HasConstraintName("fk_companies_sold_to"); - entity.HasOne(d => d.DocumentCompany).WithOne(p => p.Company) - .HasForeignKey(d => d.CompanyId).OnDelete(DeleteBehavior.SetNull); + entity.HasOne(d => d.DocumentCompany).WithOne(p => p.Company). + HasForeignKey(d => d.CompanyId).OnDelete(DeleteBehavior.SetNull); }); modelBuilder.Entity().HasIndex(e => e.Text).ForMySqlIsFullText(); modelBuilder.Entity(entity => { - entity.HasKey(e => new {e.Id, e.CompanyId, LogoGuid = e.Guid}); + entity.HasKey(e => new + { + e.Id, e.CompanyId, LogoGuid = e.Guid + }); entity.ToTable("company_logos"); @@ -364,8 +368,8 @@ namespace Marechai.Database.Models entity.Property(e => e.Year).HasColumnName("year").HasColumnType("int(4)"); - entity.HasOne(d => d.Company).WithMany(p => p.Logos).HasForeignKey(d => d.CompanyId) - .OnDelete(DeleteBehavior.ClientSetNull).HasConstraintName("fk_company_logos_company1"); + entity.HasOne(d => d.Company).WithMany(p => p.Logos).HasForeignKey(d => d.CompanyId). + OnDelete(DeleteBehavior.ClientSetNull).HasConstraintName("fk_company_logos_company1"); }); modelBuilder.Entity(entity => @@ -402,8 +406,8 @@ namespace Marechai.Database.Models entity.HasIndex(e => e.DisplayName); - entity.HasOne(d => d.Person).WithOne(p => p.DocumentPerson) - .HasForeignKey(d => d.DocumentPersonId).OnDelete(DeleteBehavior.SetNull); + entity.HasOne(d => d.Person).WithOne(p => p.DocumentPerson). + HasForeignKey(d => d.DocumentPersonId).OnDelete(DeleteBehavior.SetNull); }); modelBuilder.Entity(entity => @@ -451,17 +455,17 @@ namespace Marechai.Database.Models entity.Property(e => e.Id).HasColumnName("id").HasColumnType("int(11)"); - entity.Property(e => e.Browser).IsRequired().HasColumnName("browser").HasColumnType("char(128)") - .HasDefaultValueSql("''"); + entity.Property(e => e.Browser).IsRequired().HasColumnName("browser").HasColumnType("char(128)"). + HasDefaultValueSql("''"); - entity.Property(e => e.Date).IsRequired().HasColumnName("date").HasColumnType("char(20)") - .HasDefaultValueSql("''"); + entity.Property(e => e.Date).IsRequired().HasColumnName("date").HasColumnType("char(20)"). + HasDefaultValueSql("''"); - entity.Property(e => e.Ip).IsRequired().HasColumnName("ip").HasColumnType("char(16)") - .HasDefaultValueSql("''"); + entity.Property(e => e.Ip).IsRequired().HasColumnName("ip").HasColumnType("char(16)"). + HasDefaultValueSql("''"); - entity.Property(e => e.Referer).IsRequired().HasColumnName("referer").HasColumnType("char(255)") - .HasDefaultValueSql("''"); + entity.Property(e => e.Referer).IsRequired().HasColumnName("referer").HasColumnType("char(255)"). + HasDefaultValueSql("''"); }); modelBuilder.Entity(entity => @@ -496,8 +500,8 @@ namespace Marechai.Database.Models entity.Property(e => e.ModelCode).HasColumnName("model_code").HasColumnType("varchar(45)"); - entity.Property(e => e.Name).IsRequired().HasColumnName("name").HasColumnType("char(128)") - .HasDefaultValueSql("''"); + entity.Property(e => e.Name).IsRequired().HasColumnName("name").HasColumnType("char(128)"). + HasDefaultValueSql("''"); entity.Property(e => e.Package).HasColumnName("package").HasColumnType("varchar(45)"); @@ -507,8 +511,8 @@ namespace Marechai.Database.Models entity.Property(e => e.Transistors).HasColumnName("transistors").HasColumnType("bigint(20)"); - entity.HasOne(d => d.Company).WithMany(p => p.Gpus).HasForeignKey(d => d.CompanyId) - .HasConstraintName("fk_gpus_company"); + entity.HasOne(d => d.Company).WithMany(p => p.Gpus).HasForeignKey(d => d.CompanyId). + HasConstraintName("fk_gpus_company"); }); modelBuilder.Entity(entity => @@ -525,11 +529,11 @@ namespace Marechai.Database.Models entity.Property(e => e.MachineId).HasColumnName("machine").HasColumnType("int(11)"); - entity.HasOne(d => d.Gpu).WithMany(p => p.GpusByMachine).HasForeignKey(d => d.GpuId) - .HasConstraintName("fk_gpus_by_machine_gpu"); + entity.HasOne(d => d.Gpu).WithMany(p => p.GpusByMachine).HasForeignKey(d => d.GpuId). + HasConstraintName("fk_gpus_by_machine_gpu"); - entity.HasOne(d => d.Machine).WithMany(p => p.Gpus).HasForeignKey(d => d.MachineId) - .HasConstraintName("fk_gpus_by_machine_machine"); + entity.HasOne(d => d.Machine).WithMany(p => p.Gpus).HasForeignKey(d => d.MachineId). + HasConstraintName("fk_gpus_by_machine_machine"); }); modelBuilder.Entity(entity => @@ -552,7 +556,10 @@ namespace Marechai.Database.Models modelBuilder.Entity(entity => { - entity.HasKey(e => new {e.Id, e.ProcessorId, e.ExtensionId}); + entity.HasKey(e => new + { + e.Id, e.ProcessorId, e.ExtensionId + }); entity.ToTable("instruction_set_extensions_by_processor"); @@ -566,13 +573,13 @@ namespace Marechai.Database.Models entity.Property(e => e.ExtensionId).HasColumnName("extension_id").HasColumnType("int(11)"); - entity.HasOne(d => d.Extension).WithMany(p => p.InstructionSetExtensionsByProcessor) - .HasForeignKey(d => d.ExtensionId).OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("fk_extension_extension_id"); + entity.HasOne(d => d.Extension).WithMany(p => p.InstructionSetExtensionsByProcessor). + HasForeignKey(d => d.ExtensionId).OnDelete(DeleteBehavior.ClientSetNull). + HasConstraintName("fk_extension_extension_id"); - entity.HasOne(d => d.Processor).WithMany(p => p.InstructionSetExtensions) - .HasForeignKey(d => d.ProcessorId).OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("fk_extension_processor_id"); + entity.HasOne(d => d.Processor).WithMany(p => p.InstructionSetExtensions). + HasForeignKey(d => d.ProcessorId).OnDelete(DeleteBehavior.ClientSetNull). + HasConstraintName("fk_extension_processor_id"); }); modelBuilder.Entity(entity => @@ -632,17 +639,17 @@ namespace Marechai.Database.Models entity.Property(e => e.Id).HasColumnName("id").HasColumnType("int(11)"); - entity.Property(e => e.Browser).IsRequired().HasColumnName("browser").HasColumnType("char(128)") - .HasDefaultValueSql("''"); + entity.Property(e => e.Browser).IsRequired().HasColumnName("browser").HasColumnType("char(128)"). + HasDefaultValueSql("''"); - entity.Property(e => e.Date).IsRequired().HasColumnName("date").HasColumnType("char(20)") - .HasDefaultValueSql("''"); + entity.Property(e => e.Date).IsRequired().HasColumnName("date").HasColumnType("char(20)"). + HasDefaultValueSql("''"); - entity.Property(e => e.Ip).IsRequired().HasColumnName("ip").HasColumnType("char(16)") - .HasDefaultValueSql("''"); + entity.Property(e => e.Ip).IsRequired().HasColumnName("ip").HasColumnType("char(16)"). + HasDefaultValueSql("''"); - entity.Property(e => e.Referer).IsRequired().HasColumnName("referer").HasColumnType("char(255)") - .HasDefaultValueSql("''"); + entity.Property(e => e.Referer).IsRequired().HasColumnName("referer").HasColumnType("char(255)"). + HasDefaultValueSql("''"); }); modelBuilder.Entity(entity => @@ -659,8 +666,8 @@ namespace Marechai.Database.Models entity.Property(e => e.Name).IsRequired().HasColumnName("name").HasColumnType("varchar(255)"); - entity.HasOne(d => d.Company).WithMany(p => p.MachineFamilies).HasForeignKey(d => d.CompanyId) - .HasConstraintName("fk_machine_families_company"); + entity.HasOne(d => d.Company).WithMany(p => p.MachineFamilies).HasForeignKey(d => d.CompanyId). + HasConstraintName("fk_machine_families_company"); }); modelBuilder.Entity(entity => @@ -681,8 +688,8 @@ namespace Marechai.Database.Models entity.Property(e => e.Id).HasColumnName("id").HasColumnType("int(11)"); - entity.Property(e => e.CompanyId).HasColumnName("company").HasColumnType("int(11)") - .HasDefaultValueSql("'0'"); + entity.Property(e => e.CompanyId).HasColumnName("company").HasColumnType("int(11)"). + HasDefaultValueSql("'0'"); entity.Property(e => e.FamilyId).HasColumnName("family").HasColumnType("int(11)"); @@ -694,11 +701,11 @@ namespace Marechai.Database.Models entity.Property(e => e.Type).HasColumnName("type").HasColumnType("int(11)").HasDefaultValueSql("'0'"); - entity.HasOne(d => d.Company).WithMany(p => p.Machines).HasForeignKey(d => d.CompanyId) - .OnDelete(DeleteBehavior.ClientSetNull).HasConstraintName("fk_machines_company"); + entity.HasOne(d => d.Company).WithMany(p => p.Machines).HasForeignKey(d => d.CompanyId). + OnDelete(DeleteBehavior.ClientSetNull).HasConstraintName("fk_machines_company"); - entity.HasOne(d => d.Family).WithMany(p => p.Machines).HasForeignKey(d => d.FamilyId) - .HasConstraintName("fk_machines_family"); + entity.HasOne(d => d.Family).WithMany(p => p.Machines).HasForeignKey(d => d.FamilyId). + HasConstraintName("fk_machines_family"); }); modelBuilder.Entity(entity => @@ -954,8 +961,8 @@ namespace Marechai.Database.Models entity.Property(e => e.Usage).HasColumnName("usage").HasColumnType("int(11)").HasDefaultValueSql("'0'"); - entity.HasOne(d => d.Machine).WithMany(p => p.Memory).HasForeignKey(d => d.MachineId) - .HasConstraintName("fk_memory_by_machine_machine"); + entity.HasOne(d => d.Machine).WithMany(p => p.Memory).HasForeignKey(d => d.MachineId). + HasConstraintName("fk_memory_by_machine_machine"); }); modelBuilder.Entity(entity => @@ -983,11 +990,11 @@ namespace Marechai.Database.Models entity.Property(e => e.Id).HasColumnName("id").HasColumnType("int(11)"); - entity.Property(e => e.Donator).IsRequired().HasColumnName("donator").HasColumnType("char(128)") - .HasDefaultValueSql("''"); + entity.Property(e => e.Donator).IsRequired().HasColumnName("donator").HasColumnType("char(128)"). + HasDefaultValueSql("''"); - entity.Property(e => e.Quantity).HasColumnName("quantity").HasColumnType("decimal(11,2)") - .HasDefaultValueSql("'0.00'"); + entity.Property(e => e.Quantity).HasColumnName("quantity").HasColumnType("decimal(11,2)"). + HasDefaultValueSql("'0.00'"); }); modelBuilder.Entity(entity => @@ -1002,8 +1009,8 @@ namespace Marechai.Database.Models entity.Property(e => e.Id).HasColumnName("id").HasColumnType("int(11)"); - entity.Property(e => e.AddedId).HasColumnName("added_id").HasColumnType("int(11)") - .HasDefaultValueSql("'0'"); + entity.Property(e => e.AddedId).HasColumnName("added_id").HasColumnType("int(11)"). + HasDefaultValueSql("'0'"); entity.Property(e => e.Date).IsRequired().HasColumnName("date").HasColumnType("datetime"); @@ -1086,8 +1093,8 @@ namespace Marechai.Database.Models entity.HasOne(d => d.CountryOfBirth).WithMany(p => p.People).HasForeignKey(d => d.CountryOfBirthId); - entity.HasOne(d => d.DocumentPerson).WithOne(p => p.Person) - .HasForeignKey(d => d.PersonId).OnDelete(DeleteBehavior.SetNull); + entity.HasOne(d => d.DocumentPerson).WithOne(p => p.Person). + HasForeignKey(d => d.PersonId).OnDelete(DeleteBehavior.SetNull); }); modelBuilder.Entity(entity => @@ -1174,8 +1181,8 @@ namespace Marechai.Database.Models entity.Property(e => e.ModelCode).HasColumnName("model_code").HasColumnType("varchar(45)"); - entity.Property(e => e.Name).IsRequired().HasColumnName("name").HasColumnType("char(50)") - .HasDefaultValueSql("''"); + entity.Property(e => e.Name).IsRequired().HasColumnName("name").HasColumnType("char(50)"). + HasDefaultValueSql("''"); entity.Property(e => e.Package).HasColumnName("package").HasColumnType("varchar(45)"); @@ -1193,11 +1200,11 @@ namespace Marechai.Database.Models entity.Property(e => e.Transistors).HasColumnName("transistors").HasColumnType("bigint(20)"); - entity.HasOne(d => d.Company).WithMany(p => p.Processors).HasForeignKey(d => d.CompanyId) - .HasConstraintName("fk_processors_company"); + entity.HasOne(d => d.Company).WithMany(p => p.Processors).HasForeignKey(d => d.CompanyId). + HasConstraintName("fk_processors_company"); - entity.HasOne(d => d.InstructionSet).WithMany(p => p.Processors).HasForeignKey(d => d.InstructionSetId) - .HasConstraintName("fk_processors_instruction_set"); + entity.HasOne(d => d.InstructionSet).WithMany(p => p.Processors).HasForeignKey(d => d.InstructionSetId). + HasConstraintName("fk_processors_instruction_set"); }); modelBuilder.Entity(entity => @@ -1218,11 +1225,11 @@ namespace Marechai.Database.Models entity.Property(e => e.Speed).HasColumnName("speed"); - entity.HasOne(d => d.Machine).WithMany(p => p.Processors).HasForeignKey(d => d.MachineId) - .HasConstraintName("fk_processors_by_machine_machine"); + entity.HasOne(d => d.Machine).WithMany(p => p.Processors).HasForeignKey(d => d.MachineId). + HasConstraintName("fk_processors_by_machine_machine"); - entity.HasOne(d => d.Processor).WithMany(p => p.ProcessorsByMachine).HasForeignKey(d => d.ProcessorId) - .HasConstraintName("fk_processors_by_machine_processor"); + entity.HasOne(d => d.Processor).WithMany(p => p.ProcessorsByMachine).HasForeignKey(d => d.ProcessorId). + HasConstraintName("fk_processors_by_machine_processor"); }); modelBuilder.Entity(entity => @@ -1248,23 +1255,30 @@ namespace Marechai.Database.Models entity.HasIndex(e => e.Width).HasName("idx_resolutions_width"); - entity.HasIndex(e => new {e.Width, e.Height}).HasName("idx_resolutions_resolution"); + entity.HasIndex(e => new + { + e.Width, e.Height + }).HasName("idx_resolutions_resolution"); - entity.HasIndex(e => new {e.Width, e.Height, e.Colors}) - .HasName("idx_resolutions_resolution_with_color"); + entity.HasIndex(e => new + { + e.Width, e.Height, e.Colors + }).HasName("idx_resolutions_resolution_with_color"); - entity.HasIndex(e => new {e.Width, e.Height, e.Colors, e.Palette}) - .HasName("idx_resolutions_resolution_with_color_and_palette"); + entity.HasIndex(e => new + { + e.Width, e.Height, e.Colors, e.Palette + }).HasName("idx_resolutions_resolution_with_color_and_palette"); entity.Property(e => e.Id).HasColumnName("id").HasColumnType("int(11)"); - entity.Property(e => e.Chars).HasColumnName("chars").HasColumnType("tinyint(1)") - .HasDefaultValueSql("'0'"); + entity.Property(e => e.Chars).HasColumnName("chars").HasColumnType("tinyint(1)"). + HasDefaultValueSql("'0'"); entity.Property(e => e.Colors).HasColumnName("colors").HasColumnType("bigint(20)"); - entity.Property(e => e.Height).HasColumnName("height").HasColumnType("int(11)") - .HasDefaultValueSql("'0'"); + entity.Property(e => e.Height).HasColumnName("height").HasColumnType("int(11)"). + HasDefaultValueSql("'0'"); entity.Property(e => e.Palette).HasColumnName("palette").HasColumnType("bigint(20)"); @@ -1285,11 +1299,11 @@ namespace Marechai.Database.Models entity.Property(e => e.ResolutionId).HasColumnName("resolution").HasColumnType("int(11)"); - entity.HasOne(d => d.Gpu).WithMany(p => p.ResolutionsByGpu).HasForeignKey(d => d.GpuId) - .HasConstraintName("fk_resolutions_by_gpu_gpu"); + entity.HasOne(d => d.Gpu).WithMany(p => p.ResolutionsByGpu).HasForeignKey(d => d.GpuId). + HasConstraintName("fk_resolutions_by_gpu_gpu"); - entity.HasOne(d => d.Resolution).WithMany(p => p.ResolutionsByGpu).HasForeignKey(d => d.ResolutionId) - .HasConstraintName("fk_resolutions_by_gpu_resolution"); + entity.HasOne(d => d.Resolution).WithMany(p => p.ResolutionsByGpu).HasForeignKey(d => d.ResolutionId). + HasConstraintName("fk_resolutions_by_gpu_resolution"); }); modelBuilder.Entity(entity => @@ -1335,11 +1349,11 @@ namespace Marechai.Database.Models entity.Property(e => e.SoundSynthId).HasColumnName("sound_synth").HasColumnType("int(11)"); - entity.HasOne(d => d.Machine).WithMany(p => p.Sound).HasForeignKey(d => d.MachineId) - .HasConstraintName("fk_sound_by_machine_machine"); + entity.HasOne(d => d.Machine).WithMany(p => p.Sound).HasForeignKey(d => d.MachineId). + HasConstraintName("fk_sound_by_machine_machine"); - entity.HasOne(d => d.SoundSynth).WithMany(p => p.SoundByMachine).HasForeignKey(d => d.SoundSynthId) - .HasConstraintName("fk_sound_by_machine_sound_synth"); + entity.HasOne(d => d.SoundSynth).WithMany(p => p.SoundByMachine).HasForeignKey(d => d.SoundSynthId). + HasConstraintName("fk_sound_by_machine_sound_synth"); }); modelBuilder.Entity(entity => @@ -1387,8 +1401,8 @@ namespace Marechai.Database.Models entity.Property(e => e.ModelCode).HasColumnName("model_code").HasColumnType("varchar(45)"); - entity.Property(e => e.Name).IsRequired().HasColumnName("name").HasColumnType("char(50)") - .HasDefaultValueSql("''"); + entity.Property(e => e.Name).IsRequired().HasColumnName("name").HasColumnType("char(50)"). + HasDefaultValueSql("''"); entity.Property(e => e.SquareWave).HasColumnName("square_wave").HasColumnType("int(11)"); @@ -1398,8 +1412,8 @@ namespace Marechai.Database.Models entity.Property(e => e.WhiteNoise).HasColumnName("white_noise").HasColumnType("int(11)"); - entity.HasOne(d => d.Company).WithMany(p => p.SoundSynths).HasForeignKey(d => d.CompanyId) - .HasConstraintName("fk_sound_synths_company"); + entity.HasOne(d => d.Company).WithMany(p => p.SoundSynths).HasForeignKey(d => d.CompanyId). + HasConstraintName("fk_sound_synths_company"); }); modelBuilder.Entity(entity => @@ -1418,15 +1432,15 @@ namespace Marechai.Database.Models entity.Property(e => e.Capacity).HasColumnName("capacity").HasColumnType("bigint(20)"); - entity.Property(e => e.Interface).HasColumnName("interface").HasColumnType("int(11)") - .HasDefaultValueSql("'0'"); + entity.Property(e => e.Interface).HasColumnName("interface").HasColumnType("int(11)"). + HasDefaultValueSql("'0'"); entity.Property(e => e.MachineId).HasColumnName("machine").HasColumnType("int(11)"); entity.Property(e => e.Type).HasColumnName("type").HasColumnType("int(11)").HasDefaultValueSql("'0'"); - entity.HasOne(d => d.Machine).WithMany(p => p.Storage).HasForeignKey(d => d.MachineId) - .HasConstraintName("fk_storage_by_machine_machine"); + entity.HasOne(d => d.Machine).WithMany(p => p.Storage).HasForeignKey(d => d.MachineId). + HasConstraintName("fk_storage_by_machine_machine"); }); modelBuilder.Entity(entity => diff --git a/Marechai.Database/Models/MarechaiDb.cs b/Marechai.Database/Models/MarechaiDb.cs index a5a1b599..2f7b3916 100644 --- a/Marechai.Database/Models/MarechaiDb.cs +++ b/Marechai.Database/Models/MarechaiDb.cs @@ -34,8 +34,8 @@ namespace Marechai.Database.Models { public class MarechaiDb { - public int Id { get; set; } - public int Version { get; set; } + public int Id { get; set; } + public int Version { get; set; } public DateTimeOffset? Updated { get; set; } } } \ No newline at end of file diff --git a/Marechai.Database/Models/PeopleByBook.cs b/Marechai.Database/Models/PeopleByBook.cs index 5de85a84..dca657a3 100644 --- a/Marechai.Database/Models/PeopleByBook.cs +++ b/Marechai.Database/Models/PeopleByBook.cs @@ -7,8 +7,7 @@ namespace Marechai.Database.Models { public int PersonId { get; set; } public long BookId { get; set; } - [Column(TypeName = "char(3)")] - [Required] + [Column(TypeName = "char(3)"), Required] public string RoleId { get; set; } public virtual DocumentPerson Person { get; set; } diff --git a/Marechai.Database/Models/PeopleByDocument.cs b/Marechai.Database/Models/PeopleByDocument.cs index f7def5ed..7e3bf3aa 100644 --- a/Marechai.Database/Models/PeopleByDocument.cs +++ b/Marechai.Database/Models/PeopleByDocument.cs @@ -7,8 +7,7 @@ namespace Marechai.Database.Models { public int PersonId { get; set; } public long DocumentId { get; set; } - [Column(TypeName = "char(3)")] - [Required] + [Column(TypeName = "char(3)"), Required] public string RoleId { get; set; } public virtual DocumentPerson Person { get; set; } diff --git a/Marechai.Database/Models/PeopleByMagazine.cs b/Marechai.Database/Models/PeopleByMagazine.cs index 4298ccbd..cc86adf6 100644 --- a/Marechai.Database/Models/PeopleByMagazine.cs +++ b/Marechai.Database/Models/PeopleByMagazine.cs @@ -7,8 +7,7 @@ namespace Marechai.Database.Models { public int PersonId { get; set; } public long MagazineId { get; set; } - [Column(TypeName = "char(3)")] - [Required] + [Column(TypeName = "char(3)"), Required] public string RoleId { get; set; } public virtual DocumentPerson Person { get; set; } diff --git a/Marechai.Database/Models/Person.cs b/Marechai.Database/Models/Person.cs index f1ce84f2..d65acb8e 100644 --- a/Marechai.Database/Models/Person.cs +++ b/Marechai.Database/Models/Person.cs @@ -15,11 +15,9 @@ namespace Marechai.Database.Models public string Surname { get; set; } [DisplayName("Country of birth")] public virtual Iso31661Numeric CountryOfBirth { get; set; } - [DisplayName("Birth date")] - [DataType(DataType.Date)] + [DisplayName("Birth date"), DataType(DataType.Date)] public DateTime BirthDate { get; set; } - [DisplayName("Date of death")] - [DataType(DataType.Date)] + [DisplayName("Date of death"), DataType(DataType.Date)] public DateTime? DeathDate { get; set; } [Url] public string Webpage { get; set; } @@ -32,8 +30,7 @@ namespace Marechai.Database.Models [DisplayName("Name to be displayed")] public string DisplayName { get; set; } - [NotMapped] - [DisplayName("Name")] + [NotMapped, DisplayName("Name")] public string FullName => DisplayName ?? Alias ?? $"{Name} {Surname}"; public short? CountryOfBirthId { get; set; } diff --git a/Marechai.Database/Models/Processor.cs b/Marechai.Database/Models/Processor.cs index 9aa187bc..82becc74 100644 --- a/Marechai.Database/Models/Processor.cs +++ b/Marechai.Database/Models/Processor.cs @@ -8,7 +8,7 @@ // --[ Description ] ---------------------------------------------------------- // // Describes general purpose processors or application specific coprocessors -// that are not strictly for graphic or sound generation. +// that are not strictly for graphic or sound generation. // // --[ License ] -------------------------------------------------------------- // @@ -45,15 +45,12 @@ namespace Marechai.Database.Models ProcessorsByMachine = new HashSet(); } - [Required] - [StringLength(50)] + [Required, StringLength(50)] public string Name { get; set; } public int? CompanyId { get; set; } - [DisplayName("Model code")] - [StringLength(45)] + [DisplayName("Model code"), StringLength(45)] public string ModelCode { get; set; } - [DisplayFormat(DataFormatString = "{0:d}")] - [DataType(DataType.Date)] + [DisplayFormat(DataFormatString = "{0:d}"), DataType(DataType.Date)] public DateTime? Introduced { get; set; } [DisplayName("Instruction set")] public int? InstructionSetId { get; set; } diff --git a/Marechai.Database/Models/Resolution.cs b/Marechai.Database/Models/Resolution.cs index ce78d841..db37d864 100644 --- a/Marechai.Database/Models/Resolution.cs +++ b/Marechai.Database/Models/Resolution.cs @@ -36,16 +36,11 @@ namespace Marechai.Database.Models { public class Resolution : BaseModel { - public Resolution() - { - ResolutionsByGpu = new HashSet(); - } + public Resolution() => ResolutionsByGpu = new HashSet(); - [Required] - [Range(1, 131072)] + [Required, Range(1, 131072)] public int Width { get; set; } - [Required] - [Range(1, 131072)] + [Required, Range(1, 131072)] public int Height { get; set; } [Range(2, 281474976710656)] public long? Colors { get; set; } @@ -66,27 +61,27 @@ namespace Marechai.Database.Models { if(Chars) { - if(Colors == null) return $"{Width}x{Height} characters"; + if(Colors == null) + return$"{Width}x{Height} characters"; - if(Palette != null && Colors != Palette) - return Grayscale - ? $"{Width}x{Height} characters at {Colors} grays from a palette of {Palette}" + if(Palette != null && + Colors != Palette) + return Grayscale ? $"{Width}x{Height} characters at {Colors} grays from a palette of {Palette}" : $"{Width}x{Height} characters at {Colors} colors from a palette of {Palette}"; - return Colors == 2 && Grayscale - ? $"{Width}x{Height} black and white characters" + return Colors == 2 && Grayscale ? $"{Width}x{Height} black and white characters" : $"{Width}x{Height} characters at {Colors} colors"; } - if(Colors == null) return $"{Width}x{Height} pixels"; + if(Colors == null) + return$"{Width}x{Height} pixels"; - if(Palette != null && Colors != Palette) - return Grayscale - ? $"{Width}x{Height} pixels at {Colors} grays from a palette of {Palette}" + if(Palette != null && + Colors != Palette) + return Grayscale ? $"{Width}x{Height} pixels at {Colors} grays from a palette of {Palette}" : $"{Width}x{Height} pixels at {Colors} colors from a palette of {Palette}"; - return Colors == 2 && Grayscale - ? $"{Width}x{Height} black and white pixels" + return Colors == 2 && Grayscale ? $"{Width}x{Height} black and white pixels" : $"{Width}x{Height} pixels at {Colors} colors"; } } diff --git a/Marechai.Database/Models/ResolutionsByScreen.cs b/Marechai.Database/Models/ResolutionsByScreen.cs index bd500c78..c9cd66a5 100644 --- a/Marechai.Database/Models/ResolutionsByScreen.cs +++ b/Marechai.Database/Models/ResolutionsByScreen.cs @@ -28,7 +28,6 @@ // Copyright © 2003-2020 Natalia Portillo *******************************************************************************/ -using System.ComponentModel; using Microsoft.AspNetCore.Mvc; namespace Marechai.Database.Models @@ -40,7 +39,7 @@ namespace Marechai.Database.Models [Remote("VerifyUnique", "ResolutionsByScreen", "Admin", AdditionalFields = nameof(ScreenId))] public int ResolutionId { get; set; } - public virtual Screen Screen { get; set; } + public virtual Screen Screen { get; set; } public virtual Resolution Resolution { get; set; } } } \ No newline at end of file diff --git a/Marechai.Database/Models/Screen.cs b/Marechai.Database/Models/Screen.cs index a57df03d..73841a20 100644 --- a/Marechai.Database/Models/Screen.cs +++ b/Marechai.Database/Models/Screen.cs @@ -7,19 +7,15 @@ namespace Marechai.Database.Models { public class Screen : BaseModel { - [Range(1, 131072)] - [DisplayName("Width (mm)")] + [Range(1, 131072), DisplayName("Width (mm)")] public double? Width { get; set; } - [Range(1, 131072)] - [DisplayName("Height (mm)")] + [Range(1, 131072), DisplayName("Height (mm)")] public double? Height { get; set; } - [Required] - [DisplayName("Diagonal (inches)")] + [Required, DisplayName("Diagonal (inches)")] public double Diagonal { get; set; } [DisplayName("Native resolution")] public virtual Resolution NativeResolution { get; set; } - [Range(2, 281474976710656)] - [DisplayName("Effective colors")] + [Range(2, 281474976710656), DisplayName("Effective colors")] public long? EffectiveColors { get; set; } [Required] public string Type { get; set; } @@ -32,9 +28,11 @@ namespace Marechai.Database.Models { get { - if(Width != null && Height != null) return $"{Width}x{Height} mm"; + if(Width != null && + Height != null) + return$"{Width}x{Height} mm"; - return "Unknown"; + return"Unknown"; } } diff --git a/Marechai.Database/Models/SoundSynth.cs b/Marechai.Database/Models/SoundSynth.cs index 884f511d..fb0e8462 100644 --- a/Marechai.Database/Models/SoundSynth.cs +++ b/Marechai.Database/Models/SoundSynth.cs @@ -38,34 +38,24 @@ namespace Marechai.Database.Models { public class SoundSynth : BaseModel { - public SoundSynth() - { - SoundByMachine = new HashSet(); - } + public SoundSynth() => SoundByMachine = new HashSet(); - [Required] - [StringLength(50)] + [Required, StringLength(50)] public string Name { get; set; } public int? CompanyId { get; set; } - [DisplayName("Model code")] - [StringLength(45)] + [DisplayName("Model code"), StringLength(45)] public string ModelCode { get; set; } - [DisplayFormat(DataFormatString = "{0:d}")] - [DataType(DataType.Date)] + [DisplayFormat(DataFormatString = "{0:d}"), DataType(DataType.Date)] public DateTime? Introduced { get; set; } - [DisplayName("PCM voices")] - [Range(1, int.MaxValue)] + [DisplayName("PCM voices"), Range(1, int.MaxValue)] public int? Voices { get; set; } [DisplayName("Sample rate (Hz)")] public double? Frequency { get; set; } - [DisplayName("Sample resolution")] - [Range(1, int.MaxValue)] + [DisplayName("Sample resolution"), Range(1, int.MaxValue)] public int? Depth { get; set; } - [DisplayName("Square wave channels")] - [Range(1, int.MaxValue)] + [DisplayName("Square wave channels"), Range(1, int.MaxValue)] public int? SquareWave { get; set; } - [DisplayName("White noise channels")] - [Range(1, int.MaxValue)] + [DisplayName("White noise channels"), Range(1, int.MaxValue)] public int? WhiteNoise { get; set; } public int? Type { get; set; } diff --git a/Marechai.Database/Mysql.cs b/Marechai.Database/Mysql.cs index 6f51833d..1c62cd7f 100644 --- a/Marechai.Database/Mysql.cs +++ b/Marechai.Database/Mysql.cs @@ -50,17 +50,18 @@ namespace Marechai.Database command.CommandText = "SELECT LAST_INSERT_ID()"; IDataReader reader = command.ExecuteReader(); - if(reader == null || !reader.Read()) return 0; + if(reader == null || + !reader.Read()) + return 0; long id = reader.GetInt64(0); reader.Close(); + return id; } } - /// - /// Opens an existing database - /// + /// Opens an existing database /// Server /// User /// Database name @@ -81,9 +82,11 @@ namespace Marechai.Database bool res = Operations.UpdateDatabase(); - if(res) return true; + if(res) + return true; connection = null; + return false; } catch(MySqlException ex) @@ -91,31 +94,26 @@ namespace Marechai.Database Console.WriteLine("Error opening database."); Console.WriteLine(ex); connection = null; + return false; } } - /// - /// Closes the database - /// + /// Closes the database public void CloseDb() { connection?.Close(); connection = null; } - /// - /// Gets a data adapter for the opened database - /// + /// Gets a data adapter for the opened database /// Data adapter - public IDbDataAdapter GetNewDataAdapter() - { - return new MySqlDataAdapter(); - } + public IDbDataAdapter GetNewDataAdapter() => new MySqlDataAdapter(); public bool TableExists(string tableName) { MySqlCommand cmd = connection.CreateCommand(); + cmd.CommandText = $"SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = '{connection.Database}' AND table_name = '{tableName}'"; @@ -125,12 +123,10 @@ namespace Marechai.Database int count = reader.GetInt32(0); reader.Close(); + return count > 0; } - ~Mysql() - { - CloseDb(); - } + ~Mysql() => CloseDb(); } } \ No newline at end of file diff --git a/Marechai.Database/Operations/Update.cs b/Marechai.Database/Operations/Update.cs index 31e10318..91172f7c 100644 --- a/Marechai.Database/Operations/Update.cs +++ b/Marechai.Database/Operations/Update.cs @@ -32,16 +32,13 @@ using System; using System.Collections.Generic; using System.Data; using System.IO; -using Marechai.Database.Schemas; using Marechai.Database.Schemas.Sql; namespace Marechai.Database { public partial class Operations { - /// - /// Updates opened database to last known version - /// + /// Updates opened database to last known version /// true if updated correctly, false otherwise public bool UpdateDatabase() { @@ -53,7 +50,7 @@ namespace Marechai.Database IDbCommand dbCmd = dbCon.CreateCommand(); IDbDataAdapter dataAdapter = dbCore.GetNewDataAdapter(); dbCmd.CommandText = "SELECT * FROM marechai_db"; - DataSet dataSet = new DataSet(); + var dataSet = new DataSet(); dataAdapter.SelectCommand = dbCmd; dataAdapter.Fill(dataSet); @@ -61,7 +58,8 @@ namespace Marechai.Database { int newId = int.Parse(dataRow["version"].ToString()); - if(newId > currentDbVersion) currentDbVersion = newId; + if(newId > currentDbVersion) + currentDbVersion = newId; } } @@ -71,10 +69,12 @@ namespace Marechai.Database { Console.WriteLine("Current database version is higher than last supported version {0}, cannot continue...", DB_VERSION); + return false; } - if(currentDbVersion == DB_VERSION) return true; + if(currentDbVersion == DB_VERSION) + return true; for(int i = currentDbVersion; i < DB_VERSION; i++) switch(i) @@ -82,116 +82,139 @@ namespace Marechai.Database case 2: { UpdateDatabaseToV3(); + break; } case 3: { UpdateDatabaseToV4(); + break; } case 4: { UpdateDatabaseToV5(); + break; } case 5: { UpdateDatabaseToV6(); + break; } case 6: { UpdateDatabaseToV7(); + break; } case 7: { UpdateDatabaseToV8(); + break; } case 8: { UpdateDatabaseToV9(); + break; } case 9: { UpdateDatabaseToV10(); + break; } case 10: { UpdateDatabaseToV11(); + break; } case 11: { UpdateDatabaseToV12(); + break; } case 12: { UpdateDatabaseToV13(); + break; } case 13: { UpdateDatabaseToV14(); + break; } case 14: { UpdateDatabaseToV15(); + break; } case 15: { UpdateDatabaseToV16(); + break; } case 16: { UpdateDatabaseToV17(); + break; } case 17: { UpdateDatabaseToV18(); + break; } case 18: { UpdateDatabaseToV19(); + break; } case 19: { UpdateDatabaseToV20(); + break; } case 20: { UpdateDatabaseToV21(); + break; } case 21: { UpdateDatabaseToV22(); + break; } case 22: { UpdateDatabaseToV23(); + break; } case 23: { UpdateVersionToEntityFramework(); + break; } } OptimizeDatabase(); + return true; } @@ -201,11 +224,13 @@ namespace Marechai.Database Console.WriteLine("Creating versioning table"); IDbCommand dbCmd = dbCon.CreateCommand(); + dbCmd.CommandText = @"CREATE TABLE `marechai_db` ( `id` INT NOT NULL AUTO_INCREMENT, `version` INT NOT NULL, `updated` DATETIME DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`) )"; + dbCmd.ExecuteNonQuery(); Console.WriteLine("Renaming table `admin` to `admins`"); @@ -215,8 +240,10 @@ namespace Marechai.Database Console.WriteLine("Renaming column `browser_test.idstring` to `browser_test.user_agent`"); dbCmd = dbCon.CreateCommand(); + dbCmd.CommandText = @"ALTER TABLE `browser_test` CHANGE COLUMN `idstring` `user_agent` varchar(128) NOT NULL DEFAULT '';"; + dbCmd.ExecuteNonQuery(); Console.WriteLine("Renaming table `browser_test` to `browser_tests`"); dbCmd = dbCon.CreateCommand(); @@ -225,8 +252,10 @@ namespace Marechai.Database Console.WriteLine("Renaming column `Companias.Compania` to `Companias.name`"); dbCmd = dbCon.CreateCommand(); + dbCmd.CommandText = @"ALTER TABLE `Companias` CHANGE COLUMN `Compania` `name` varchar(128) NOT NULL DEFAULT '';"; + dbCmd.ExecuteNonQuery(); Console.WriteLine("Renaming table `Companias` to `companies`"); dbCmd = dbCon.CreateCommand(); @@ -235,13 +264,17 @@ namespace Marechai.Database Console.WriteLine("Renaming column `computers.spu` to `computers.sound_synth`"); dbCmd = dbCon.CreateCommand(); + dbCmd.CommandText = @"ALTER TABLE `computers` CHANGE COLUMN `spu` `sound_synth` int(11) NOT NULL DEFAULT '0'"; + dbCmd.ExecuteNonQuery(); Console.WriteLine("Renaming column `computers.mpu` to `music_synth.name`"); dbCmd = dbCon.CreateCommand(); + dbCmd.CommandText = @"ALTER TABLE `computers` CHANGE COLUMN `mpu` `music_synth` int(11) NOT NULL DEFAULT '0'"; + dbCmd.ExecuteNonQuery(); Console.WriteLine("Dropping column `computers.comment`"); dbCmd = dbCon.CreateCommand(); @@ -254,13 +287,17 @@ namespace Marechai.Database dbCmd.ExecuteNonQuery(); Console.WriteLine("Renaming column `consoles.spu` to `consoles.sound_synth`"); dbCmd = dbCon.CreateCommand(); + dbCmd.CommandText = @"ALTER TABLE `consoles` CHANGE COLUMN `spu` `sound_synth` int(11) NOT NULL DEFAULT '0'"; + dbCmd.ExecuteNonQuery(); Console.WriteLine("Renaming column `consoles.mpu` to `consoles.music_synth`"); dbCmd = dbCon.CreateCommand(); + dbCmd.CommandText = @"ALTER TABLE `consoles` CHANGE COLUMN `mpu` `music_synth` int(11) NOT NULL DEFAULT '0'"; + dbCmd.ExecuteNonQuery(); Console.WriteLine("Dropping column `consoles.comments`"); dbCmd = dbCon.CreateCommand(); @@ -287,8 +324,10 @@ namespace Marechai.Database Console.WriteLine("Renaming column `Formatos_de_disco.Format` to `Formatos_de_disco.description`"); dbCmd = dbCon.CreateCommand(); + dbCmd.CommandText = @"ALTER TABLE `Formatos_de_disco` CHANGE COLUMN `Format` `description` char(50) NOT NULL DEFAULT ''"; + dbCmd.ExecuteNonQuery(); Console.WriteLine("Renaming table `Formatos_de_disco` to `disk_formats`"); dbCmd = dbCon.CreateCommand(); @@ -335,7 +374,7 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); IDbDataAdapter dataAdapter = dbCore.GetNewDataAdapter(); dbCmd.CommandText = "SELECT * from console_company"; - DataSet dataSet = new DataSet(); + var dataSet = new DataSet(); dataAdapter.SelectCommand = dbCmd; dataAdapter.Fill(dataSet); @@ -346,6 +385,7 @@ namespace Marechai.Database IDbTransaction trans; Console.WriteLine("Converting all items from `console_company` to `companies`"); + foreach(KeyValuePair consoleCompany in consoleCompanies) { dbCmd = dbCon.CreateCommand(); @@ -359,6 +399,7 @@ namespace Marechai.Database { Console.WriteLine("Converting console company `{0}` to company `{1}`", consoleCompany.Value, dataSet.Tables[0].Rows[0]["name"]); + conversionEquivalents.Add(consoleCompany.Key, int.Parse(dataSet.Tables[0].Rows[0]["id"].ToString())); } @@ -388,16 +429,20 @@ namespace Marechai.Database dataSet = new DataSet(); dataAdapter.SelectCommand = dbCmd; dataAdapter.Fill(dataSet); + foreach(DataRow dataRow in dataSet.Tables[0].Rows) consoleIdAndCompanyId.Add(int.Parse(dataRow["id"].ToString()), int.Parse(dataRow["company"].ToString())); trans = dbCon.BeginTransaction(); + foreach(KeyValuePair keyValuePair in consoleIdAndCompanyId) { conversionEquivalents.TryGetValue(keyValuePair.Value, out int newId); + Console.WriteLine("Converting console company {0} to company {1} for console {2}... ", keyValuePair.Value, newId, keyValuePair.Key); + dbCmd = dbCon.CreateCommand(); dbCmd.Transaction = trans; dbCmd.CommandText = $"UPDATE consoles SET company = {newId} WHERE id = {keyValuePair.Key}"; @@ -409,6 +454,7 @@ namespace Marechai.Database trans.Commit(); Console.WriteLine("Moving company logos..."); + foreach(string file in Directory.GetFiles("wwwroot/assets/logos/computers/", "*", SearchOption.TopDirectoryOnly)) { @@ -421,14 +467,17 @@ namespace Marechai.Database Directory.Delete("wwwroot/assets/logos/computers"); Console.WriteLine("Moving console company logos..."); + foreach(string file in Directory.GetFiles("wwwroot/assets/logos/consoles/", "*", SearchOption.TopDirectoryOnly)) { string oldNameWithoutExtension = Path.GetFileNameWithoutExtension(file); + if(!int.TryParse(oldNameWithoutExtension, out int oldId)) { Console.WriteLine("Removing stray file {0}...", file); File.Delete(file); + continue; } @@ -436,6 +485,7 @@ namespace Marechai.Database string extension = Path.GetExtension(file); string newPath = Path.Combine("wwwroot/assets/logos/", $"{newId}{extension}"); + if(File.Exists(newPath)) { Console.WriteLine("Removing duplicate file {0}...", file); @@ -480,9 +530,10 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "ALTER TABLE `admins` ROW_FORMAT = DYNAMIC;\n" + "ALTER TABLE `browser_tests` ROW_FORMAT = DYNAMIC;\n" + - "ALTER TABLE `marechai_db` ROW_FORMAT = DYNAMIC;\n" + + "ALTER TABLE `marechai_db` ROW_FORMAT = DYNAMIC;\n" + "ALTER TABLE `companies` ROW_FORMAT = DYNAMIC;\n" + "ALTER TABLE `computers` ROW_FORMAT = DYNAMIC;\n" + "ALTER TABLE `consoles` ROW_FORMAT = DYNAMIC;\n" + @@ -497,6 +548,7 @@ namespace Marechai.Database "ALTER TABLE `owned_consoles` ROW_FORMAT = DYNAMIC;\n" + "ALTER TABLE `processors` ROW_FORMAT = DYNAMIC;\n" + "ALTER TABLE `sound_synths` ROW_FORMAT = DYNAMIC;\n"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -520,11 +572,13 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "CREATE INDEX idx_browser_tests_user_agent ON browser_tests (user_agent);\n" + "CREATE INDEX idx_browser_tests_browser ON browser_tests (browser);\n" + "CREATE INDEX idx_browser_tests_version ON browser_tests (version);\n" + "CREATE INDEX idx_browser_tests_os ON browser_tests (os);\n" + "CREATE INDEX idx_browser_tests_platform ON browser_tests (platform);"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -542,6 +596,7 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "CREATE INDEX idx_computers_company ON computers (company);\n" + "CREATE INDEX idx_computers_year ON computers (year);\n" + "CREATE INDEX idx_computers_model ON computers (model);\n" + @@ -565,6 +620,7 @@ namespace Marechai.Database "CREATE INDEX idx_computers_disk2 ON computers (disk2);\n" + "CREATE INDEX idx_computers_cap1 ON computers (cap1);\n" + "CREATE INDEX idx_computers_cap2 ON computers (cap2);"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -573,6 +629,7 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "CREATE INDEX idx_consoles_company ON consoles (company);\n" + "CREATE INDEX idx_consoles_year ON consoles (year);\n" + "CREATE INDEX idx_consoles_model ON consoles (model);\n" + @@ -592,6 +649,7 @@ namespace Marechai.Database "CREATE INDEX idx_consoles_palette ON consoles (palette);\n" + "CREATE INDEX idx_consoles_format ON consoles (format);\n" + "CREATE INDEX idx_consoles_cap ON consoles (cap);"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -609,10 +667,12 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "CREATE INDEX idx_forbidden_browser ON forbidden (browser);\n" + "CREATE INDEX idx_forbidden_date ON forbidden (date);\n" + "CREATE INDEX idx_forbidden_ip ON forbidden (ip);\n" + "CREATE INDEX idx_forbidden_referer ON forbidden (referer);"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -630,10 +690,12 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "CREATE INDEX idx_log_browser ON log (browser);\n" + "CREATE INDEX idx_log_date ON log (date);\n" + "CREATE INDEX idx_log_ip ON log (ip);\n" + "CREATE INDEX idx_log_referer ON log (referer);"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -642,8 +704,10 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "CREATE INDEX idx_money_donations_donator ON money_donations (donator);\n" + "CREATE INDEX idx_money_donations_quantity ON money_donations (quantity);"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -661,9 +725,11 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "CREATE INDEX idx_news_date ON news (date);\n" + "CREATE INDEX idx_news_type ON news (type);\n" + "CREATE INDEX idx_news_ip ON news (added_id);"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -672,6 +738,7 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "CREATE INDEX idx_owned_computers_db_id ON owned_computers (db_id);\n" + "CREATE INDEX idx_owned_computers_date ON owned_computers (date);\n" + "CREATE INDEX idx_owned_computers_status ON owned_computers (status);\n" + @@ -689,6 +756,7 @@ namespace Marechai.Database "CREATE INDEX idx_owned_computers_disk2 ON owned_computers (disk2);\n" + "CREATE INDEX idx_owned_computers_cap1 ON owned_computers (cap1);\n" + "CREATE INDEX idx_owned_computers_cap2 ON owned_computers (cap2);"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -697,12 +765,14 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "CREATE INDEX idx_owned_consoles_db_id ON owned_consoles (db_id);\n" + "CREATE INDEX idx_owned_consoles_date ON owned_consoles (date);\n" + "CREATE INDEX idx_owned_consoles_status ON owned_consoles (status);\n" + "CREATE INDEX idx_owned_consoles_trade ON owned_consoles (trade);\n" + "CREATE INDEX idx_owned_consoles_boxed ON owned_consoles (boxed);\n" + "CREATE INDEX idx_owned_consoles_manuals ON owned_consoles (manuals);"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -784,6 +854,7 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "ALTER TABLE `companies` ADD COLUMN `founded` DATETIME NULL;\n" + "ALTER TABLE `companies` ADD COLUMN `website` VARCHAR(255) NULL;\n" + "ALTER TABLE `companies` ADD COLUMN `twitter` VARCHAR(45) NULL;\n" + @@ -795,6 +866,7 @@ namespace Marechai.Database "ALTER TABLE `companies` ADD COLUMN `province` VARCHAR(80) NULL;\n" + "ALTER TABLE `companies` ADD COLUMN `postal_code` VARCHAR(25) NULL;\n" + "ALTER TABLE `companies` ADD COLUMN `country` SMALLINT(3) UNSIGNED ZEROFILL NULL;"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -803,6 +875,7 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "CREATE INDEX `idx_companies_founded` ON `companies` (`founded`);\n" + "CREATE INDEX `idx_companies_website` ON `companies` (`website`);\n" + "CREATE INDEX `idx_companies_twitter` ON `companies` (`twitter`);\n" + @@ -814,6 +887,7 @@ namespace Marechai.Database "CREATE INDEX `idx_companies_province` ON `companies` (`province`);\n" + "CREATE INDEX `idx_companies_postal_code` ON `companies` (`postal_code`);\n" + "CREATE INDEX `idx_companies_country` ON `companies` (`country`);"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -822,9 +896,11 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "ALTER TABLE `companies` ADD FOREIGN KEY `fk_companies_sold_to` (sold_to) REFERENCES `companies` (`id`);\n" + "ALTER TABLE `companies` ADD FOREIGN KEY `fk_companies_country` (country) REFERENCES `iso3166_1_numeric` (`id`);"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -940,6 +1016,7 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "ALTER TABLE `processors` ADD COLUMN `company` INT NULL;\n" + "ALTER TABLE `processors` ADD COLUMN `model_code` VARCHAR(45) NULL;\n" + "ALTER TABLE `processors` ADD COLUMN `introduced` DATETIME NULL;\n" + @@ -964,6 +1041,7 @@ namespace Marechai.Database "ALTER TABLE `processors` ADD COLUMN `L1_data` FLOAT NULL;\n" + "ALTER TABLE `processors` ADD COLUMN `L2` FLOAT NULL;\n" + "ALTER TABLE `processors` ADD COLUMN `L3` FLOAT NULL;"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -972,6 +1050,7 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "CREATE INDEX `idx_processors_company` ON `processors` (`company`);\n" + "CREATE INDEX `idx_processors_model_code` ON `processors` (`model_code`);\n" + @@ -997,6 +1076,7 @@ namespace Marechai.Database "CREATE INDEX `idx_processors_L1_data` ON `processors` (`L1_data`);\n" + "CREATE INDEX `idx_processors_L2` ON `processors` (`L2`);\n" + "CREATE INDEX `idx_processors_L3` ON `processors` (`L3`);"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -1005,9 +1085,11 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "ALTER TABLE `processors` ADD FOREIGN KEY `fk_processors_company` (company) REFERENCES `companies` (`id`) ON UPDATE CASCADE;\n" + "ALTER TABLE `processors` ADD FOREIGN KEY `fk_processors_instruction_set` (instruction_set) REFERENCES `instruction_sets` (`id`) ON UPDATE CASCADE;"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -1027,6 +1109,7 @@ namespace Marechai.Database IDbCommand dbCmd = dbCon.CreateCommand(); IDbTransaction trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "ALTER TABLE `gpus` ADD COLUMN `company` INT NULL;\n" + "ALTER TABLE `gpus` ADD COLUMN `model_code` VARCHAR(45) NULL;\n" + "ALTER TABLE `gpus` ADD COLUMN `introduced` DATETIME NULL;\n" + @@ -1035,6 +1118,7 @@ namespace Marechai.Database "ALTER TABLE `gpus` ADD COLUMN `process_nm` FLOAT NULL;\n" + "ALTER TABLE `gpus` ADD COLUMN `die_size` FLOAT NULL;\n" + "ALTER TABLE `gpus` ADD COLUMN `transistors` BIGINT NULL;"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -1043,6 +1127,7 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "CREATE INDEX `idx_gpus_company` ON `gpus` (`company`);\n" + "CREATE INDEX `idx_gpus_model_code` ON `gpus` (`model_code`);\n" + "CREATE INDEX `idx_gpus_introduced` ON `gpus` (`introduced`);\n" + @@ -1051,6 +1136,7 @@ namespace Marechai.Database "CREATE INDEX `idx_gpus_process_nm` ON `gpus` (`process_nm`);\n" + "CREATE INDEX `idx_gpus_die_size` ON `gpus` (`die_size`);\n" + "CREATE INDEX `idx_gpus_transistors` ON `gpus` (`transistors`);"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -1059,8 +1145,10 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "ALTER TABLE `gpus` ADD FOREIGN KEY `fk_gpus_company` (company) REFERENCES `companies` (`id`) ON UPDATE CASCADE;"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -1080,9 +1168,11 @@ namespace Marechai.Database IDbCommand dbCmd = dbCon.CreateCommand(); IDbTransaction trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "ALTER TABLE `computers` CHANGE COLUMN `gpu` `gpu` INT DEFAULT NULL;\n" + "ALTER TABLE `computers` CHANGE COLUMN `cpu1` `cpu1` INT DEFAULT NULL;\n" + "ALTER TABLE `computers` CHANGE COLUMN `mhz1` `mhz1` INT DEFAULT NULL;"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -1091,9 +1181,11 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "ALTER TABLE `consoles` CHANGE COLUMN `gpu` `gpu` INT DEFAULT NULL;\n" + "ALTER TABLE `consoles` CHANGE COLUMN `cpu1` `cpu1` INT DEFAULT NULL;\n" + "ALTER TABLE `consoles` CHANGE COLUMN `mhz1` `mhz1` INT DEFAULT NULL;"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -1102,8 +1194,10 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = $"INSERT INTO `gpus` (`id`, `name`) VALUES ({DB_NONE}, 'DB_NONE');\n" + $"INSERT INTO `gpus` (`id`, `name`) VALUES ({DB_SOFTWARE}, 'DB_FRAMEBUFFER');"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -1112,9 +1206,11 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = $"UPDATE `computers` SET `gpu` = {DB_NONE} WHERE `gpu` = 1;\n" + "UPDATE `computers` SET `gpu` = NULL WHERE `gpu` = 2;\n" + $"UPDATE `computers` SET `gpu` = {DB_SOFTWARE} WHERE `gpu` = 3;"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -1123,9 +1219,11 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = $"UPDATE `consoles` SET `gpu` = {DB_NONE} WHERE `gpu` = 1;\n" + "UPDATE `consoles` SET `gpu` = NULL WHERE `gpu` = 2;\n" + $"UPDATE `consoles` SET `gpu` = {DB_SOFTWARE} WHERE `gpu` = 3;"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -1134,8 +1232,10 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "DELETE FROM `gpus` WHERE `id` = 1;\n" + "DELETE FROM `gpus` WHERE `id` = 2;\n" + "DELETE FROM `gpus` WHERE `id` = 3;"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -1155,6 +1255,7 @@ namespace Marechai.Database IDbCommand dbCmd = dbCon.CreateCommand(); IDbTransaction trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "ALTER TABLE `sound_synths` ADD COLUMN `company` INT NULL;\n" + "ALTER TABLE `sound_synths` ADD COLUMN `model_code` VARCHAR(45) NULL;\n" + "ALTER TABLE `sound_synths` ADD COLUMN `introduced` DATETIME NULL;\n" + @@ -1164,6 +1265,7 @@ namespace Marechai.Database "ALTER TABLE `sound_synths` ADD COLUMN `square_wave` INT NULL;\n" + "ALTER TABLE `sound_synths` ADD COLUMN `white_noise` INT NULL;\n" + "ALTER TABLE `sound_synths` ADD COLUMN `type` INT NULL;"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -1172,6 +1274,7 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "CREATE INDEX `idx_sound_synths_company` ON `sound_synths` (`company`);\n" + "CREATE INDEX `idx_sound_synths_model_code` ON `sound_synths` (`model_code`);\n" + "CREATE INDEX `idx_sound_synths_introduced` ON `sound_synths` (`introduced`);\n" + @@ -1181,6 +1284,7 @@ namespace Marechai.Database "CREATE INDEX `idx_sound_synths_square_wave` ON `sound_synths` (`square_wave`);\n" + "CREATE INDEX `idx_sound_synths_white_noise` ON `sound_synths` (`white_noise`);\n" + "CREATE INDEX `idx_sound_synths_type` ON `sound_synths` (`type`);"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -1189,8 +1293,10 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "ALTER TABLE `sound_synths` ADD FOREIGN KEY `fk_sound_synths_company` (company) REFERENCES `companies` (`id`) ON UPDATE CASCADE;"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -1199,8 +1305,10 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "ALTER TABLE `computers` DROP FOREIGN KEY `fk_computers_music_synth`;\n" + "ALTER TABLE `consoles` DROP FOREIGN KEY `fk_consoles_music_synth`;"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -1211,7 +1319,7 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); IDbDataAdapter dataAdapter = dbCore.GetNewDataAdapter(); dbCmd.CommandText = "SELECT * from music_synths"; - DataSet dataSet = new DataSet(); + var dataSet = new DataSet(); dataAdapter.SelectCommand = dbCmd; dataAdapter.Fill(dataSet); @@ -1221,6 +1329,7 @@ namespace Marechai.Database Dictionary conversionEquivalents = new Dictionary(); Console.WriteLine("Converting all items from `music_synths` to `sound_synths`"); + foreach(KeyValuePair musicSynth in musicSynths) { dbCmd = dbCon.CreateCommand(); @@ -1234,6 +1343,7 @@ namespace Marechai.Database { Console.WriteLine("Converting music synth `{0}` to sound synth `{1}`", musicSynth.Value, dataSet.Tables[0].Rows[0]["name"]); + conversionEquivalents.Add(musicSynth.Key, int.Parse(dataSet.Tables[0].Rows[0]["id"].ToString())); } else @@ -1262,16 +1372,20 @@ namespace Marechai.Database dataSet = new DataSet(); dataAdapter.SelectCommand = dbCmd; dataAdapter.Fill(dataSet); + foreach(DataRow dataRow in dataSet.Tables[0].Rows) consoleIdAndMusicSynthId.Add(int.Parse(dataRow["id"].ToString()), int.Parse(dataRow["music_synth"].ToString())); trans = dbCon.BeginTransaction(); + foreach(KeyValuePair keyValuePair in consoleIdAndMusicSynthId) { conversionEquivalents.TryGetValue(keyValuePair.Value, out int newId); + Console.WriteLine("Converting music synth {0} to sound synth {1} for console {2}... ", keyValuePair.Value, newId, keyValuePair.Key); + dbCmd = dbCon.CreateCommand(); dbCmd.Transaction = trans; dbCmd.CommandText = $"UPDATE consoles SET music_synth = {newId} WHERE id = {keyValuePair.Key}"; @@ -1290,16 +1404,20 @@ namespace Marechai.Database dataSet = new DataSet(); dataAdapter.SelectCommand = dbCmd; dataAdapter.Fill(dataSet); + foreach(DataRow dataRow in dataSet.Tables[0].Rows) computerIdAndMusicSynthId.Add(int.Parse(dataRow["id"].ToString()), int.Parse(dataRow["music_synth"].ToString())); trans = dbCon.BeginTransaction(); + foreach(KeyValuePair keyValuePair in computerIdAndMusicSynthId) { conversionEquivalents.TryGetValue(keyValuePair.Value, out int newId); + Console.WriteLine("Converting music synth {0} to sound synth {1} for computer {2}... ", keyValuePair.Value, newId, keyValuePair.Key); + dbCmd = dbCon.CreateCommand(); dbCmd.Transaction = trans; dbCmd.CommandText = $"UPDATE computers SET music_synth = {newId} WHERE id = {keyValuePair.Key}"; @@ -1314,8 +1432,10 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "ALTER TABLE `computers` ADD FOREIGN KEY `fk_computers_music_synth` (music_synth) REFERENCES `sound_synths` (`id`) ON UPDATE CASCADE;"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -1324,8 +1444,10 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "ALTER TABLE `consoles` ADD FOREIGN KEY `fk_consoles_music_synth` (music_synth) REFERENCES `sound_synths` (`id`) ON UPDATE CASCADE;"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -1372,8 +1494,10 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = $"ALTER TABLE `machines` ADD COLUMN `type` INT NOT NULL DEFAULT '{(int)MachineType.Unknown}';"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -1391,6 +1515,7 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "ALTER TABLE `machines` DROP INDEX `idx_computers_company`, ADD INDEX `idx_machines_company` (`company`);\n" + "ALTER TABLE `machines` DROP INDEX `idx_computers_year`, ADD INDEX `idx_machines_year` (`year`);\n" + @@ -1414,6 +1539,7 @@ namespace Marechai.Database "ALTER TABLE `machines` DROP INDEX `idx_computers_disk2`, ADD INDEX `idx_machines_disk2` (`disk2`);\n" + "ALTER TABLE `machines` DROP INDEX `idx_computers_cap1`, ADD INDEX `idx_machines_cap1` (`cap1`);\n" + "ALTER TABLE `machines` DROP INDEX `idx_computers_cap2`, ADD INDEX `idx_machines_cap2` (`cap2`);"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -1422,6 +1548,7 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "ALTER TABLE `machines` DROP FOREIGN KEY `fk_computers_company`;\n" + "ALTER TABLE `machines` DROP FOREIGN KEY `fk_computers_cpu1`;\n" + "ALTER TABLE `machines` DROP FOREIGN KEY `fk_computers_cpu2`;\n" + @@ -1433,6 +1560,7 @@ namespace Marechai.Database "ALTER TABLE `machines` DROP FOREIGN KEY `fk_computers_hdd3`;\n" + "ALTER TABLE `machines` DROP FOREIGN KEY `fk_computers_music_synth`;\n" + "ALTER TABLE `machines` DROP FOREIGN KEY `fk_computers_sound_synth`;"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -1441,6 +1569,7 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_company` (company) REFERENCES `companies` (`id`) ON UPDATE CASCADE;\n" + "ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_cpu1` (cpu1) REFERENCES `processors` (`id`) ON UPDATE CASCADE;\n" + @@ -1453,6 +1582,7 @@ namespace Marechai.Database "ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_hdd3` (hdd3) REFERENCES `disk_formats` (`id`) ON UPDATE CASCADE;\n" + "ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_music_synth` (music_synth) REFERENCES `sound_synths` (`id`) ON UPDATE CASCADE;\n" + "ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_sound_synth` (sound_synth) REFERENCES `sound_synths` (`id`) ON UPDATE CASCADE;"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -1471,7 +1601,7 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); IDbDataAdapter dataAdapter = dbCore.GetNewDataAdapter(); dbCmd.CommandText = "SELECT * from consoles"; - DataSet dataSet = new DataSet(); + var dataSet = new DataSet(); dataAdapter.SelectCommand = dbCmd; dataAdapter.Fill(dataSet); @@ -1549,13 +1679,15 @@ namespace Marechai.Database param2.Value = (int)dataRow["year"]; param3.Value = (string)dataRow["model"]; param4.Value = dataRow["cpu1"] == DBNull.Value ? (object)null : (int)dataRow["cpu1"]; - param5.Value = dataRow["mhz1"] == DBNull.Value - ? (object)null + + param5.Value = dataRow["mhz1"] == DBNull.Value ? (object)null : float.Parse(dataRow["mhz1"].ToString()); + param6.Value = dataRow["cpu2"] == DBNull.Value ? (object)null : (int)dataRow["cpu2"]; - param7.Value = dataRow["mhz2"] == DBNull.Value - ? (object)null + + param7.Value = dataRow["mhz2"] == DBNull.Value ? (object)null : float.Parse(dataRow["mhz2"].ToString()); + param8.Value = (int)dataRow["ram"]; param9.Value = (int)dataRow["rom"]; param10.Value = dataRow["gpu"] == DBNull.Value ? (object)null : (int)dataRow["gpu"]; @@ -1643,7 +1775,7 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); IDbDataAdapter dataAdapter = dbCore.GetNewDataAdapter(); dbCmd.CommandText = "SELECT * from machines"; - DataSet dataSet = new DataSet(); + var dataSet = new DataSet(); dataAdapter.SelectCommand = dbCmd; dataAdapter.Fill(dataSet); @@ -1675,8 +1807,8 @@ namespace Marechai.Database if(dataRow["cpu1"] != DBNull.Value) { param2.Value = (int)dataRow["cpu1"]; - param3.Value = dataRow["mhz1"] == DBNull.Value - ? (object)null + + param3.Value = dataRow["mhz1"] == DBNull.Value ? (object)null : float.Parse(dataRow["mhz1"].ToString()); trans = dbCon.BeginTransaction(); @@ -1693,8 +1825,8 @@ namespace Marechai.Database if(dataRow["cpu2"] != DBNull.Value) { param2.Value = (int)dataRow["cpu2"]; - param3.Value = dataRow["mhz2"] == DBNull.Value - ? (object)null + + param3.Value = dataRow["mhz2"] == DBNull.Value ? (object)null : float.Parse(dataRow["mhz2"].ToString()); trans = dbCon.BeginTransaction(); @@ -1715,12 +1847,14 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "ALTER TABLE `machines` DROP FOREIGN KEY `fk_machines_cpu1`;\n" + "ALTER TABLE `machines` DROP FOREIGN KEY `fk_machines_cpu2`;\n" + "ALTER TABLE `machines` DROP COLUMN `cpu1`;\n" + "ALTER TABLE `machines` DROP COLUMN `cpu2`;\n" + "ALTER TABLE `machines` DROP COLUMN `mhz1`;\n" + "ALTER TABLE `machines` DROP COLUMN `mhz2`;"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -1750,7 +1884,7 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); IDbDataAdapter dataAdapter = dbCore.GetNewDataAdapter(); dbCmd.CommandText = "SELECT * from machines"; - DataSet dataSet = new DataSet(); + var dataSet = new DataSet(); dataAdapter.SelectCommand = dbCmd; dataAdapter.Fill(dataSet); @@ -1796,8 +1930,10 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "ALTER TABLE `machines` DROP FOREIGN KEY `fk_machines_gpu`;\n" + "ALTER TABLE `machines` DROP COLUMN `gpu`;"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -1835,8 +1971,10 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = $"UPDATE `machines` SET sound_synth = {DB_SOFTWARE} WHERE sound_synth = 27;\n" + $"UPDATE `machines` SET music_synth = {DB_SOFTWARE} WHERE music_synth = 27;"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -1846,7 +1984,7 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); IDbDataAdapter dataAdapter = dbCore.GetNewDataAdapter(); dbCmd.CommandText = "SELECT * from machines"; - DataSet dataSet = new DataSet(); + var dataSet = new DataSet(); dataAdapter.SelectCommand = dbCmd; dataAdapter.Fill(dataSet); @@ -1871,7 +2009,8 @@ namespace Marechai.Database dbcmd.Parameters.Add(param1); dbcmd.Parameters.Add(param2); - if(dataRow["sound_synth"] != DBNull.Value && (int)dataRow["sound_synth"] != 1 && + if(dataRow["sound_synth"] != DBNull.Value && + (int)dataRow["sound_synth"] != 1 && (int)dataRow["sound_synth"] != 2) { param2.Value = (int)dataRow["sound_synth"]; @@ -1887,7 +2026,8 @@ namespace Marechai.Database trans.Commit(); } - if(dataRow["music_synth"] != DBNull.Value && (int)dataRow["music_synth"] != 1 && + if(dataRow["music_synth"] != DBNull.Value && + (int)dataRow["music_synth"] != 1 && (int)dataRow["music_synth"] != 2) { param2.Value = (int)dataRow["music_synth"]; @@ -1910,12 +2050,14 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "ALTER TABLE `machines` DROP FOREIGN KEY `fk_machines_sound_synth`;\n" + "ALTER TABLE `machines` DROP FOREIGN KEY `fk_machines_music_synth`;\n" + "ALTER TABLE `machines` DROP COLUMN `sound_channels`;\n" + "ALTER TABLE `machines` DROP COLUMN `music_channels`;\n" + "ALTER TABLE `machines` DROP COLUMN `sound_synth`;\n" + "ALTER TABLE `machines` DROP COLUMN `music_synth`;"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -1924,8 +2066,10 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "DELETE FROM sound_synths WHERE id = 1;\n" + "DELETE FROM sound_synths WHERE id = 2;\n" + "DELETE FROM sound_synths WHERE id = 27;"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -1955,7 +2099,7 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); IDbDataAdapter dataAdapter = dbCore.GetNewDataAdapter(); dbCmd.CommandText = "SELECT * from machines"; - DataSet dataSet = new DataSet(); + var dataSet = new DataSet(); dataAdapter.SelectCommand = dbCmd; dataAdapter.Fill(dataSet); @@ -1984,7 +2128,8 @@ namespace Marechai.Database dbcmd.Parameters.Add(param2); dbcmd.Parameters.Add(param3); - if(dataRow["ram"] != DBNull.Value && (int)dataRow["ram"] > 0) + if(dataRow["ram"] != DBNull.Value && + (int)dataRow["ram"] > 0) { param2.Value = MemoryUsage.Work; param3.Value = (int)dataRow["ram"] * 1024; @@ -2001,7 +2146,8 @@ namespace Marechai.Database trans.Commit(); } - if(dataRow["rom"] != DBNull.Value && (int)dataRow["rom"] > 0) + if(dataRow["rom"] != DBNull.Value && + (int)dataRow["rom"] > 0) { param2.Value = MemoryUsage.Firmware; param3.Value = (int)dataRow["rom"] * 1024; @@ -2018,7 +2164,8 @@ namespace Marechai.Database trans.Commit(); } - if(dataRow["vram"] != DBNull.Value && (int)dataRow["vram"] > 0) + if(dataRow["vram"] != DBNull.Value && + (int)dataRow["vram"] > 0) { param2.Value = MemoryUsage.Video; param3.Value = (int)dataRow["vram"] * 1024; @@ -2042,9 +2189,11 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "ALTER TABLE `machines` DROP COLUMN `ram`;\n" + "ALTER TABLE `machines` DROP COLUMN `rom`;\n" + "ALTER TABLE `machines` DROP COLUMN `vram`;"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -2083,36 +2232,44 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); IDbDataAdapter dataAdapter = dbCore.GetNewDataAdapter(); dbCmd.CommandText = "SELECT * from machines"; - DataSet dataSet = new DataSet(); + var dataSet = new DataSet(); dataAdapter.SelectCommand = dbCmd; dataAdapter.Fill(dataSet); foreach(DataRow dataRow in dataSet.Tables[0].Rows) { - if(dataRow["colors"] == DBNull.Value || dataRow["res"] == DBNull.Value || + if(dataRow["colors"] == DBNull.Value || + dataRow["res"] == DBNull.Value || (int)dataRow["colors"] == 0 || - (string)dataRow["res"] == "???") continue; + (string)dataRow["res"] == "???") + continue; dbCmd = dbCon.CreateCommand(); IDbDataAdapter dataAdapter2 = dbCore.GetNewDataAdapter(); dbCmd.CommandText = $"SELECT * FROM gpus_by_machine WHERE machine = {(int)dataRow["id"]}"; - DataSet dataSet2 = new DataSet(); + var dataSet2 = new DataSet(); dataAdapter2.SelectCommand = dbCmd; dataAdapter2.Fill(dataSet2); - if(dataSet2.Tables[0].Rows.Count == 0) continue; + if(dataSet2.Tables[0].Rows.Count == 0) + continue; int gpuId = (int)dataSet2.Tables[0].Rows[0]["gpu"]; string[] resPieces = ((string)dataRow["res"]).Split('x'); - if(!int.TryParse(resPieces[0], out int width)) continue; - if(!int.TryParse(resPieces[1], out int height)) continue; + if(!int.TryParse(resPieces[0], out int width)) + continue; + + if(!int.TryParse(resPieces[1], out int height)) + continue; dbCmd = dbCon.CreateCommand(); dataAdapter2 = dbCore.GetNewDataAdapter(); + dbCmd.CommandText = $"SELECT * FROM resolutions WHERE width = {width} AND height = {height} AND colors = {(int)dataRow["colors"]}"; + dataSet2 = new DataSet(); dataAdapter2.SelectCommand = dbCmd; dataAdapter2.Fill(dataSet2); @@ -2153,7 +2310,8 @@ namespace Marechai.Database resId = (int)dbCore.LastInsertRowId; } - else resId = (int)dataSet2.Tables[0].Rows[0]["id"]; + else + resId = (int)dataSet2.Tables[0].Rows[0]["id"]; dbcmd = dbCon.CreateCommand(); @@ -2184,8 +2342,10 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "ALTER TABLE `machines` DROP COLUMN `res`;\n" + "ALTER TABLE `machines` DROP COLUMN `colors`;"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -2215,7 +2375,7 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); IDbDataAdapter dataAdapter = dbCore.GetNewDataAdapter(); dbCmd.CommandText = "SELECT * from machines"; - DataSet dataSet = new DataSet(); + var dataSet = new DataSet(); dataAdapter.SelectCommand = dbCmd; dataAdapter.Fill(dataSet); @@ -2248,9 +2408,14 @@ namespace Marechai.Database dbcmd.Parameters.Add(param3); dbcmd.Parameters.Add(param4); - foreach(string media in new[] {"hdd1", "hdd2", "hdd3", "disk1", "disk2"}) + foreach(string media in new[] { - if(dataRow[media] == DBNull.Value || (int)dataRow[media] == 30) continue; + "hdd1", "hdd2", "hdd3", "disk1", "disk2" + }) + { + if(dataRow[media] == DBNull.Value || + (int)dataRow[media] == 30) + continue; param3.Value = StorageInterface.Unknown; @@ -2258,101 +2423,130 @@ namespace Marechai.Database { case 1: param2.Value = StorageType.CompactFloppy; + break; case 3: case 5: param2.Value = StorageType.Microfloppy; + break; case 4: param2.Value = StorageType.Minifloppy; + break; case 7: param2.Value = StorageType.CompactDisc; + break; case 8: param2.Value = StorageType.CompactCassette; + break; case 9: param2.Value = StorageType.CompactFlash; + break; case 11: param2.Value = StorageType.Dvd; + break; case 12: param2.Value = StorageType.GDROM; + break; case 13: param2.Value = StorageType.ZIP100; + break; case 14: param2.Value = StorageType.LS120; + break; case 15: param2.Value = StorageType.MagnetoOptical; + break; case 17: param2.Value = StorageType.Microdrive; + break; case 18: param2.Value = StorageType.MMC; + break; case 20: param2.Value = StorageType.SecureDigital; + break; case 21: param2.Value = StorageType.SmartMedia; + break; case 23: param2.Value = StorageType.PunchedCard; + break; case 24: param2.Value = StorageType.HardDisk; param3.Value = StorageInterface.ACSI; + break; case 25: case 29: param2.Value = StorageType.HardDisk; param3.Value = StorageInterface.ATA; + break; case 26: param2.Value = StorageType.HardDisk; param3.Value = StorageInterface.ESDI; + break; case 27: param2.Value = StorageType.HardDisk; param3.Value = StorageInterface.FireWire; + break; case 28: param2.Value = StorageType.CompactFloppy; + break; case 32: case 35: param2.Value = StorageType.HardDisk; param3.Value = StorageInterface.ST506; + break; case 33: param2.Value = StorageType.HardDisk; param3.Value = StorageInterface.SASI; + break; case 34: case 41: param2.Value = StorageType.HardDisk; param3.Value = StorageInterface.SCSI; + break; case 40: param2.Value = StorageType.Floppy; + break; case 43: param2.Value = StorageType.Bluray; + break; case 44: param2.Value = StorageType.GOD; + break; case 45: param2.Value = StorageType.WOD; + break; default: param2.Value = StorageType.Unknown; + break; } @@ -2360,7 +2554,7 @@ namespace Marechai.Database switch(media) { - case "disk1": + case"disk1": if(dataRow["cap1"] != DBNull.Value) if(int.TryParse((string)dataRow["cap1"], out int cap)) param4.Value = cap == 0 @@ -2368,8 +2562,9 @@ namespace Marechai.Database : (StorageType)param2.Value == StorageType.CompactCassette ? cap : cap * 1024; + break; - case "disk2": + case"disk2": if(dataRow["cap2"] != DBNull.Value) if(int.TryParse((string)dataRow["cap2"], out int cap)) param4.Value = cap == 0 @@ -2377,6 +2572,7 @@ namespace Marechai.Database : (StorageType)param2.Value == StorageType.CompactCassette ? cap : cap * 1024; + break; } @@ -2399,6 +2595,7 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "ALTER TABLE `machines` DROP FOREIGN KEY `fk_machines_disk1`;\n" + "ALTER TABLE `machines` DROP FOREIGN KEY `fk_machines_disk2`;\n" + "ALTER TABLE `machines` DROP FOREIGN KEY `fk_machines_hdd1`;\n" + @@ -2411,6 +2608,7 @@ namespace Marechai.Database "ALTER TABLE `machines` DROP COLUMN `cap1`;\n" + "ALTER TABLE `machines` DROP COLUMN `disk2`;\n" + "ALTER TABLE `machines` DROP COLUMN `cap2`;"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -2439,8 +2637,10 @@ namespace Marechai.Database IDbCommand dbCmd = dbCon.CreateCommand(); IDbTransaction trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "ALTER TABLE `machines` ADD COLUMN `introduced` DATETIME NULL;\n" + "CREATE INDEX idx_machines_introduced ON machines (introduced);"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -2450,7 +2650,7 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); IDbDataAdapter dataAdapter = dbCore.GetNewDataAdapter(); dbCmd.CommandText = "SELECT * from machines"; - DataSet dataSet = new DataSet(); + var dataSet = new DataSet(); dataAdapter.SelectCommand = dbCmd; dataAdapter.Fill(dataSet); @@ -2464,8 +2664,10 @@ namespace Marechai.Database param1.DbType = DbType.DateTime; - if((int)dataRow["year"] > 0) param1.Value = new DateTime((int)dataRow["year"], 1, 1); - else param1.Value = null; + if((int)dataRow["year"] > 0) + param1.Value = new DateTime((int)dataRow["year"], 1, 1); + else + param1.Value = null; string sql = $"UPDATE `machines` SET introduced = @introduced WHERE id = {(int)dataRow["id"]}"; @@ -2518,10 +2720,12 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "ALTER TABLE `machines` ADD COLUMN `family` INT DEFAULT NULL;\n" + "ALTER TABLE `machines` CHANGE COLUMN `model` `name` VARCHAR(255) NOT NULL;\n" + "ALTER TABLE `machines` DROP INDEX `idx_machines_model`;\n" + "ALTER TABLE `machines` ADD COLUMN `model` VARCHAR(50) DEFAULT NULL;"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -2530,9 +2734,11 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "CREATE INDEX `idx_machines_family` ON `machines` (`family`);\n" + "CREATE INDEX `idx_machines_name` ON `machines` (`name`);\n" + "CREATE INDEX `idx_machines_model` ON `machines` (`model`);"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -2541,8 +2747,10 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "ALTER TABLE `machines` ADD FOREIGN KEY `fk_machines_family` (family) REFERENCES machine_families (`id`) ON UPDATE CASCADE"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -2598,8 +2806,10 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "ALTER TABLE `companies` ADD FOREIGN KEY `fk_companies_country` (country) REFERENCES `iso3166_1_numeric` (`id`);"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -2608,6 +2818,7 @@ namespace Marechai.Database dbCmd = dbCon.CreateCommand(); trans = dbCon.BeginTransaction(); dbCmd.Transaction = trans; + dbCmd.CommandText = "ALTER TABLE gpus_by_machine ADD id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT;\n" + "ALTER TABLE memory_by_machine ADD id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT;\n" + @@ -2615,6 +2826,7 @@ namespace Marechai.Database "ALTER TABLE resolutions_by_gpu ADD id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT;\n" + "ALTER TABLE sound_by_machine ADD id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT;\n" + "ALTER TABLE storage_by_machine ADD id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT;"; + dbCmd.ExecuteNonQuery(); trans.Commit(); dbCmd.Dispose(); @@ -2631,7 +2843,7 @@ namespace Marechai.Database IDbCommand dbCmd = dbCon.CreateCommand(); IDbDataAdapter dataAdapter = dbCore.GetNewDataAdapter(); dbCmd.CommandText = "SHOW TABLES"; - DataSet dataSet = new DataSet(); + var dataSet = new DataSet(); dataAdapter.SelectCommand = dbCmd; dataAdapter.Fill(dataSet); @@ -2652,14 +2864,16 @@ namespace Marechai.Database IDbCommand dbCmd = dbCon.CreateCommand(); IDbDataAdapter dataAdapter = dbCore.GetNewDataAdapter(); dbCmd.CommandText = "SELECT * FROM marechai_db"; - DataSet dataSet = new DataSet(); + var dataSet = new DataSet(); dataAdapter.SelectCommand = dbCmd; dataAdapter.Fill(dataSet); foreach(DataRow dataRow in dataSet.Tables[0].Rows) { - int newId = int.Parse(dataRow["version"].ToString()); - if(newId > currentDbVersion) currentDbVersion = newId; + int newId = int.Parse(dataRow["version"].ToString()); + + if(newId > currentDbVersion) + currentDbVersion = newId; } return currentDbVersion; @@ -2669,19 +2883,23 @@ namespace Marechai.Database { Console.WriteLine("Adding Entity Framework table..."); IDbCommand dbCmd = dbCon.CreateCommand(); + dbCmd.CommandText = "create table `__EFMigrationsHistory`\n" + "(MigrationId varchar(95) not null primary key,\n" + "ProductVersion varchar(32) not null);"; + dbCmd.ExecuteNonQuery(); dbCmd.Dispose(); - + Console.WriteLine("Adding Entity Framework first migration..."); dbCmd = dbCon.CreateCommand(); + dbCmd.CommandText = "INSERT INTO marechai.`__EFMigrationsHistory` (MigrationId, ProductVersion)" + " VALUES ('20180805214952_InitialMigration', '2.1.1-rtm-30846');"; + dbCmd.ExecuteNonQuery(); dbCmd.Dispose(); - + Console.WriteLine("Setting new database version to 1984 (Entity Framework)..."); dbCmd = dbCon.CreateCommand(); dbCmd.CommandText = "INSERT INTO marechai_db (version) VALUES ('1984')"; diff --git a/Marechai.Database/Schemas/Sql/V10.cs b/Marechai.Database/Schemas/Sql/V10.cs index 034a5314..b5c3eead 100644 --- a/Marechai.Database/Schemas/Sql/V10.cs +++ b/Marechai.Database/Schemas/Sql/V10.cs @@ -36,12 +36,12 @@ namespace Marechai.Database.Schemas.Sql public static readonly string BrowserTests = V9.BrowserTests; - public static readonly string MarechaiDb = "CREATE TABLE `marechai_db` (\n" + - "`id` int(11) NOT NULL AUTO_INCREMENT,\n" + - "`version` int(11) NOT NULL,\n" + - "`updated` datetime DEFAULT CURRENT_TIMESTAMP,\n" + - "PRIMARY KEY (`id`)\n" + ");\n" + - "INSERT INTO marechai_db (version) VALUES ('10');"; + public static readonly string MarechaiDb = "CREATE TABLE `marechai_db` (\n" + + "`id` int(11) NOT NULL AUTO_INCREMENT,\n" + + "`version` int(11) NOT NULL,\n" + + "`updated` datetime DEFAULT CURRENT_TIMESTAMP,\n" + + "PRIMARY KEY (`id`)\n" + ");\n" + + "INSERT INTO marechai_db (version) VALUES ('10');"; public static readonly string Companies = V9.Companies; diff --git a/Marechai.Database/Schemas/Sql/V11.cs b/Marechai.Database/Schemas/Sql/V11.cs index 274e46ae..96f2f2a8 100644 --- a/Marechai.Database/Schemas/Sql/V11.cs +++ b/Marechai.Database/Schemas/Sql/V11.cs @@ -36,12 +36,12 @@ namespace Marechai.Database.Schemas.Sql public static readonly string BrowserTests = V10.BrowserTests; - public static readonly string MarechaiDb = "CREATE TABLE `marechai_db` (\n" + - "`id` int(11) NOT NULL AUTO_INCREMENT,\n" + - "`version` int(11) NOT NULL,\n" + - "`updated` datetime DEFAULT CURRENT_TIMESTAMP,\n" + - "PRIMARY KEY (`id`)\n" + ");\n" + - "INSERT INTO marechai_db (version) VALUES ('11');"; + public static readonly string MarechaiDb = "CREATE TABLE `marechai_db` (\n" + + "`id` int(11) NOT NULL AUTO_INCREMENT,\n" + + "`version` int(11) NOT NULL,\n" + + "`updated` datetime DEFAULT CURRENT_TIMESTAMP,\n" + + "PRIMARY KEY (`id`)\n" + ");\n" + + "INSERT INTO marechai_db (version) VALUES ('11');"; public static readonly string Companies = V10.Companies; diff --git a/Marechai.Database/Schemas/Sql/V12.cs b/Marechai.Database/Schemas/Sql/V12.cs index 6032c275..0d22ebca 100644 --- a/Marechai.Database/Schemas/Sql/V12.cs +++ b/Marechai.Database/Schemas/Sql/V12.cs @@ -36,12 +36,12 @@ namespace Marechai.Database.Schemas.Sql public static readonly string BrowserTests = V11.BrowserTests; - public static readonly string MarechaiDb = "CREATE TABLE `marechai_db` (\n" + - "`id` int(11) NOT NULL AUTO_INCREMENT,\n" + - "`version` int(11) NOT NULL,\n" + - "`updated` datetime DEFAULT CURRENT_TIMESTAMP,\n" + - "PRIMARY KEY (`id`)\n" + ");\n" + - "INSERT INTO marechai_db (version) VALUES ('12');"; + public static readonly string MarechaiDb = "CREATE TABLE `marechai_db` (\n" + + "`id` int(11) NOT NULL AUTO_INCREMENT,\n" + + "`version` int(11) NOT NULL,\n" + + "`updated` datetime DEFAULT CURRENT_TIMESTAMP,\n" + + "PRIMARY KEY (`id`)\n" + ");\n" + + "INSERT INTO marechai_db (version) VALUES ('12');"; public static readonly string Companies = V11.Companies; diff --git a/Marechai.Database/Schemas/Sql/V13.cs b/Marechai.Database/Schemas/Sql/V13.cs index e7ba3be8..c727b510 100644 --- a/Marechai.Database/Schemas/Sql/V13.cs +++ b/Marechai.Database/Schemas/Sql/V13.cs @@ -36,12 +36,12 @@ namespace Marechai.Database.Schemas.Sql public static readonly string BrowserTests = V12.BrowserTests; - public static readonly string MarechaiDb = "CREATE TABLE `marechai_db` (\n" + - "`id` int(11) NOT NULL AUTO_INCREMENT,\n" + - "`version` int(11) NOT NULL,\n" + - "`updated` datetime DEFAULT CURRENT_TIMESTAMP,\n" + - "PRIMARY KEY (`id`)\n" + ");\n" + - "INSERT INTO marechai_db (version) VALUES ('13');"; + public static readonly string MarechaiDb = "CREATE TABLE `marechai_db` (\n" + + "`id` int(11) NOT NULL AUTO_INCREMENT,\n" + + "`version` int(11) NOT NULL,\n" + + "`updated` datetime DEFAULT CURRENT_TIMESTAMP,\n" + + "PRIMARY KEY (`id`)\n" + ");\n" + + "INSERT INTO marechai_db (version) VALUES ('13');"; public static readonly string Companies = V12.Companies; diff --git a/Marechai.Database/Schemas/Sql/V14.cs b/Marechai.Database/Schemas/Sql/V14.cs index d5bddd4d..ed1e48c9 100644 --- a/Marechai.Database/Schemas/Sql/V14.cs +++ b/Marechai.Database/Schemas/Sql/V14.cs @@ -36,12 +36,12 @@ namespace Marechai.Database.Schemas.Sql public static readonly string BrowserTests = V13.BrowserTests; - public static readonly string MarechaiDb = "CREATE TABLE `marechai_db` (\n" + - "`id` int(11) NOT NULL AUTO_INCREMENT,\n" + - "`version` int(11) NOT NULL,\n" + - "`updated` datetime DEFAULT CURRENT_TIMESTAMP,\n" + - "PRIMARY KEY (`id`)\n" + ");\n" + - "INSERT INTO marechai_db (version) VALUES ('14');"; + public static readonly string MarechaiDb = "CREATE TABLE `marechai_db` (\n" + + "`id` int(11) NOT NULL AUTO_INCREMENT,\n" + + "`version` int(11) NOT NULL,\n" + + "`updated` datetime DEFAULT CURRENT_TIMESTAMP,\n" + + "PRIMARY KEY (`id`)\n" + ");\n" + + "INSERT INTO marechai_db (version) VALUES ('14');"; public static readonly string Companies = V13.Companies; diff --git a/Marechai.Database/Schemas/Sql/V15.cs b/Marechai.Database/Schemas/Sql/V15.cs index 38a6f0f0..a683a379 100644 --- a/Marechai.Database/Schemas/Sql/V15.cs +++ b/Marechai.Database/Schemas/Sql/V15.cs @@ -36,12 +36,12 @@ namespace Marechai.Database.Schemas.Sql public static readonly string BrowserTests = V14.BrowserTests; - public static readonly string MarechaiDb = "CREATE TABLE `marechai_db` (\n" + - "`id` int(11) NOT NULL AUTO_INCREMENT,\n" + - "`version` int(11) NOT NULL,\n" + - "`updated` datetime DEFAULT CURRENT_TIMESTAMP,\n" + - "PRIMARY KEY (`id`)\n" + ");\n" + - "INSERT INTO marechai_db (version) VALUES ('15');"; + public static readonly string MarechaiDb = "CREATE TABLE `marechai_db` (\n" + + "`id` int(11) NOT NULL AUTO_INCREMENT,\n" + + "`version` int(11) NOT NULL,\n" + + "`updated` datetime DEFAULT CURRENT_TIMESTAMP,\n" + + "PRIMARY KEY (`id`)\n" + ");\n" + + "INSERT INTO marechai_db (version) VALUES ('15');"; public static readonly string Companies = V14.Companies; diff --git a/Marechai.Database/Schemas/Sql/V16.cs b/Marechai.Database/Schemas/Sql/V16.cs index dc00e5d5..fc10dc6e 100644 --- a/Marechai.Database/Schemas/Sql/V16.cs +++ b/Marechai.Database/Schemas/Sql/V16.cs @@ -36,12 +36,12 @@ namespace Marechai.Database.Schemas.Sql public static readonly string BrowserTests = V15.BrowserTests; - public static readonly string MarechaiDb = "CREATE TABLE `marechai_db` (\n" + - "`id` int(11) NOT NULL AUTO_INCREMENT,\n" + - "`version` int(11) NOT NULL,\n" + - "`updated` datetime DEFAULT CURRENT_TIMESTAMP,\n" + - "PRIMARY KEY (`id`)\n" + ");\n" + - "INSERT INTO marechai_db (version) VALUES ('16');"; + public static readonly string MarechaiDb = "CREATE TABLE `marechai_db` (\n" + + "`id` int(11) NOT NULL AUTO_INCREMENT,\n" + + "`version` int(11) NOT NULL,\n" + + "`updated` datetime DEFAULT CURRENT_TIMESTAMP,\n" + + "PRIMARY KEY (`id`)\n" + ");\n" + + "INSERT INTO marechai_db (version) VALUES ('16');"; public static readonly string Companies = V15.Companies; diff --git a/Marechai.Database/Schemas/Sql/V17.cs b/Marechai.Database/Schemas/Sql/V17.cs index 3aef0057..516d9d31 100644 --- a/Marechai.Database/Schemas/Sql/V17.cs +++ b/Marechai.Database/Schemas/Sql/V17.cs @@ -36,12 +36,12 @@ namespace Marechai.Database.Schemas.Sql public static readonly string BrowserTests = V16.BrowserTests; - public static readonly string MarechaiDb = "CREATE TABLE `marechai_db` (\n" + - "`id` int(11) NOT NULL AUTO_INCREMENT,\n" + - "`version` int(11) NOT NULL,\n" + - "`updated` datetime DEFAULT CURRENT_TIMESTAMP,\n" + - "PRIMARY KEY (`id`));\n" + - "INSERT INTO marechai_db (version) VALUES ('17');"; + public static readonly string MarechaiDb = "CREATE TABLE `marechai_db` (\n" + + "`id` int(11) NOT NULL AUTO_INCREMENT,\n" + + "`version` int(11) NOT NULL,\n" + + "`updated` datetime DEFAULT CURRENT_TIMESTAMP,\n" + + "PRIMARY KEY (`id`));\n" + + "INSERT INTO marechai_db (version) VALUES ('17');"; public static readonly string Companies = V16.Companies; diff --git a/Marechai.Database/Schemas/Sql/V18.cs b/Marechai.Database/Schemas/Sql/V18.cs index fc28108b..1f4ead0e 100644 --- a/Marechai.Database/Schemas/Sql/V18.cs +++ b/Marechai.Database/Schemas/Sql/V18.cs @@ -36,12 +36,12 @@ namespace Marechai.Database.Schemas.Sql public static readonly string BrowserTests = V17.BrowserTests; - public static readonly string MarechaiDb = "CREATE TABLE `marechai_db` (\n" + - "`id` int(11) NOT NULL AUTO_INCREMENT,\n" + - "`version` int(11) NOT NULL,\n" + - "`updated` datetime DEFAULT CURRENT_TIMESTAMP,\n" + - "PRIMARY KEY (`id`));\n" + - "INSERT INTO marechai_db (version) VALUES ('18');"; + public static readonly string MarechaiDb = "CREATE TABLE `marechai_db` (\n" + + "`id` int(11) NOT NULL AUTO_INCREMENT,\n" + + "`version` int(11) NOT NULL,\n" + + "`updated` datetime DEFAULT CURRENT_TIMESTAMP,\n" + + "PRIMARY KEY (`id`));\n" + + "INSERT INTO marechai_db (version) VALUES ('18');"; public static readonly string Companies = V17.Companies; diff --git a/Marechai.Database/Schemas/Sql/V19.cs b/Marechai.Database/Schemas/Sql/V19.cs index cf0b587b..f8ce7d56 100644 --- a/Marechai.Database/Schemas/Sql/V19.cs +++ b/Marechai.Database/Schemas/Sql/V19.cs @@ -36,12 +36,12 @@ namespace Marechai.Database.Schemas.Sql public static readonly string BrowserTests = V18.BrowserTests; - public static readonly string MarechaiDb = "CREATE TABLE `marechai_db` (\n" + - "`id` int(11) NOT NULL AUTO_INCREMENT,\n" + - "`version` int(11) NOT NULL,\n" + - "`updated` datetime DEFAULT CURRENT_TIMESTAMP,\n" + - "PRIMARY KEY (`id`));\n" + - "INSERT INTO marechai_db (version) VALUES ('19');"; + public static readonly string MarechaiDb = "CREATE TABLE `marechai_db` (\n" + + "`id` int(11) NOT NULL AUTO_INCREMENT,\n" + + "`version` int(11) NOT NULL,\n" + + "`updated` datetime DEFAULT CURRENT_TIMESTAMP,\n" + + "PRIMARY KEY (`id`));\n" + + "INSERT INTO marechai_db (version) VALUES ('19');"; public static readonly string Companies = V18.Companies; diff --git a/Marechai.Database/Schemas/Sql/V20.cs b/Marechai.Database/Schemas/Sql/V20.cs index 123ccabe..6e080e54 100644 --- a/Marechai.Database/Schemas/Sql/V20.cs +++ b/Marechai.Database/Schemas/Sql/V20.cs @@ -36,12 +36,12 @@ namespace Marechai.Database.Schemas.Sql public static readonly string BrowserTests = V19.BrowserTests; - public static readonly string MarechaiDb = "CREATE TABLE `marechai_db` (\n" + - "`id` int(11) NOT NULL AUTO_INCREMENT,\n" + - "`version` int(11) NOT NULL,\n" + - "`updated` datetime DEFAULT CURRENT_TIMESTAMP,\n" + - "PRIMARY KEY (`id`));\n" + - "INSERT INTO marechai_db (version) VALUES ('20');"; + public static readonly string MarechaiDb = "CREATE TABLE `marechai_db` (\n" + + "`id` int(11) NOT NULL AUTO_INCREMENT,\n" + + "`version` int(11) NOT NULL,\n" + + "`updated` datetime DEFAULT CURRENT_TIMESTAMP,\n" + + "PRIMARY KEY (`id`));\n" + + "INSERT INTO marechai_db (version) VALUES ('20');"; public static readonly string Companies = V19.Companies; diff --git a/Marechai.Database/Schemas/Sql/V21.cs b/Marechai.Database/Schemas/Sql/V21.cs index 3ed06c7b..6c6eea93 100644 --- a/Marechai.Database/Schemas/Sql/V21.cs +++ b/Marechai.Database/Schemas/Sql/V21.cs @@ -36,12 +36,12 @@ namespace Marechai.Database.Schemas.Sql public static readonly string BrowserTests = V20.BrowserTests; - public static readonly string MarechaiDb = "CREATE TABLE `marechai_db` (\n" + - "`id` int(11) NOT NULL AUTO_INCREMENT,\n" + - "`version` int(11) NOT NULL,\n" + - "`updated` datetime DEFAULT CURRENT_TIMESTAMP,\n" + - "PRIMARY KEY (`id`));\n" + - "INSERT INTO marechai_db (version) VALUES ('21');"; + public static readonly string MarechaiDb = "CREATE TABLE `marechai_db` (\n" + + "`id` int(11) NOT NULL AUTO_INCREMENT,\n" + + "`version` int(11) NOT NULL,\n" + + "`updated` datetime DEFAULT CURRENT_TIMESTAMP,\n" + + "PRIMARY KEY (`id`));\n" + + "INSERT INTO marechai_db (version) VALUES ('21');"; public static readonly string Companies = V20.Companies; diff --git a/Marechai.Database/Schemas/Sql/V22.cs b/Marechai.Database/Schemas/Sql/V22.cs index 936325e9..a3604d12 100644 --- a/Marechai.Database/Schemas/Sql/V22.cs +++ b/Marechai.Database/Schemas/Sql/V22.cs @@ -36,12 +36,12 @@ namespace Marechai.Database.Schemas.Sql public static readonly string BrowserTests = V21.BrowserTests; - public static readonly string MarechaiDb = "CREATE TABLE `marechai_db` (\n" + - "`id` int(11) NOT NULL AUTO_INCREMENT,\n" + - "`version` int(11) NOT NULL,\n" + - "`updated` datetime DEFAULT CURRENT_TIMESTAMP,\n" + - "PRIMARY KEY (`id`));\n" + - "INSERT INTO marechai_db (version) VALUES ('22');"; + public static readonly string MarechaiDb = "CREATE TABLE `marechai_db` (\n" + + "`id` int(11) NOT NULL AUTO_INCREMENT,\n" + + "`version` int(11) NOT NULL,\n" + + "`updated` datetime DEFAULT CURRENT_TIMESTAMP,\n" + + "PRIMARY KEY (`id`));\n" + + "INSERT INTO marechai_db (version) VALUES ('22');"; public static readonly string Companies = V21.Companies; diff --git a/Marechai.Database/Schemas/Sql/V6.cs b/Marechai.Database/Schemas/Sql/V6.cs index fcf3386f..262b0b1b 100644 --- a/Marechai.Database/Schemas/Sql/V6.cs +++ b/Marechai.Database/Schemas/Sql/V6.cs @@ -36,12 +36,12 @@ namespace Marechai.Database.Schemas.Sql public static readonly string BrowserTests = V5.BrowserTests; - public static readonly string MarechaiDb = "CREATE TABLE `marechai_db` (\n" + - "`id` int(11) NOT NULL AUTO_INCREMENT,\n" + - "`version` int(11) NOT NULL,\n" + - "`updated` datetime DEFAULT CURRENT_TIMESTAMP,\n" + - "PRIMARY KEY (`id`)\n" + ");\n" + - "INSERT INTO marechai_db (version) VALUES ('6');"; + public static readonly string MarechaiDb = "CREATE TABLE `marechai_db` (\n" + + "`id` int(11) NOT NULL AUTO_INCREMENT,\n" + + "`version` int(11) NOT NULL,\n" + + "`updated` datetime DEFAULT CURRENT_TIMESTAMP,\n" + + "PRIMARY KEY (`id`)\n" + ");\n" + + "INSERT INTO marechai_db (version) VALUES ('6');"; public static readonly string Companies = "CREATE TABLE `companies` (\n" + "`id` int(11) NOT NULL AUTO_INCREMENT,\n" + diff --git a/Marechai.Database/Schemas/Sql/V7.cs b/Marechai.Database/Schemas/Sql/V7.cs index 31d9070f..db47f299 100644 --- a/Marechai.Database/Schemas/Sql/V7.cs +++ b/Marechai.Database/Schemas/Sql/V7.cs @@ -36,12 +36,12 @@ namespace Marechai.Database.Schemas.Sql public static readonly string BrowserTests = V6.BrowserTests; - public static readonly string MarechaiDb = "CREATE TABLE `marechai_db` (\n" + - "`id` int(11) NOT NULL AUTO_INCREMENT,\n" + - "`version` int(11) NOT NULL,\n" + - "`updated` datetime DEFAULT CURRENT_TIMESTAMP,\n" + - "PRIMARY KEY (`id`)\n" + ");\n" + - "INSERT INTO marechai_db (version) VALUES ('7');"; + public static readonly string MarechaiDb = "CREATE TABLE `marechai_db` (\n" + + "`id` int(11) NOT NULL AUTO_INCREMENT,\n" + + "`version` int(11) NOT NULL,\n" + + "`updated` datetime DEFAULT CURRENT_TIMESTAMP,\n" + + "PRIMARY KEY (`id`)\n" + ");\n" + + "INSERT INTO marechai_db (version) VALUES ('7');"; public static readonly string Companies = "CREATE TABLE `companies` (\n" + "`id` int(11) NOT NULL AUTO_INCREMENT,\n" + diff --git a/Marechai.Database/Schemas/Sql/V8.cs b/Marechai.Database/Schemas/Sql/V8.cs index 39c10143..e76e423f 100644 --- a/Marechai.Database/Schemas/Sql/V8.cs +++ b/Marechai.Database/Schemas/Sql/V8.cs @@ -36,12 +36,12 @@ namespace Marechai.Database.Schemas.Sql public static readonly string BrowserTests = V7.BrowserTests; - public static readonly string MarechaiDb = "CREATE TABLE `marechai_db` (\n" + - "`id` int(11) NOT NULL AUTO_INCREMENT,\n" + - "`version` int(11) NOT NULL,\n" + - "`updated` datetime DEFAULT CURRENT_TIMESTAMP,\n" + - "PRIMARY KEY (`id`)\n" + ");\n" + - "INSERT INTO marechai_db (version) VALUES ('8');"; + public static readonly string MarechaiDb = "CREATE TABLE `marechai_db` (\n" + + "`id` int(11) NOT NULL AUTO_INCREMENT,\n" + + "`version` int(11) NOT NULL,\n" + + "`updated` datetime DEFAULT CURRENT_TIMESTAMP,\n" + + "PRIMARY KEY (`id`)\n" + ");\n" + + "INSERT INTO marechai_db (version) VALUES ('8');"; public static readonly string Companies = V7.Companies; diff --git a/Marechai.Database/Schemas/Sql/V9.cs b/Marechai.Database/Schemas/Sql/V9.cs index 6db822f2..ab4d79cd 100644 --- a/Marechai.Database/Schemas/Sql/V9.cs +++ b/Marechai.Database/Schemas/Sql/V9.cs @@ -36,12 +36,12 @@ namespace Marechai.Database.Schemas.Sql public static readonly string BrowserTests = V8.BrowserTests; - public static readonly string MarechaiDb = "CREATE TABLE `marechai_db` (\n" + - "`id` int(11) NOT NULL AUTO_INCREMENT,\n" + - "`version` int(11) NOT NULL,\n" + - "`updated` datetime DEFAULT CURRENT_TIMESTAMP,\n" + - "PRIMARY KEY (`id`)\n" + ");\n" + - "INSERT INTO marechai_db (version) VALUES ('9');"; + public static readonly string MarechaiDb = "CREATE TABLE `marechai_db` (\n" + + "`id` int(11) NOT NULL AUTO_INCREMENT,\n" + + "`version` int(11) NOT NULL,\n" + + "`updated` datetime DEFAULT CURRENT_TIMESTAMP,\n" + + "PRIMARY KEY (`id`)\n" + ");\n" + + "INSERT INTO marechai_db (version) VALUES ('9');"; public static readonly string Companies = V8.Companies; diff --git a/Marechai.Database/Seeders/DocumentRoles.cs b/Marechai.Database/Seeders/DocumentRoles.cs index abe3742c..07e95d28 100644 --- a/Marechai.Database/Seeders/DocumentRoles.cs +++ b/Marechai.Database/Seeders/DocumentRoles.cs @@ -5,1297 +5,819 @@ namespace Marechai.Database.Seeders { public static class DocumentRoles { - public static void Seed(ModelBuilder modelBuilder) + public static void Seed(ModelBuilder modelBuilder) => modelBuilder.Entity().HasData(new { - modelBuilder.Entity().HasData(new {Id = "abr", Name = "Abridger", Enabled = true}, - new {Id = "acp", Name = "Art copyist", Enabled = true}, - new {Id = "act", Name = "Actor", Enabled = true}, - new {Id = "adi", Name = "Art director", Enabled = true}, - new {Id = "adp", Name = "Adapter", Enabled = true}, - new - { - Id = "aft", - Name = "Author of afterword, colophon, etc.", - Enabled = true - }, new {Id = "anl", Name = "Analyst", Enabled = true}, - new {Id = "anm", Name = "Animator", Enabled = true}, - new {Id = "ann", Name = "Annotator", Enabled = true}, - new - { - Id = "ant", - Name = "Bibliographic antecedent", - Enabled = true - }, new {Id = "ape", Name = "Appellee", Enabled = true}, - new {Id = "apl", Name = "Appellant", Enabled = true}, - new {Id = "app", Name = "Applicant", Enabled = true}, - new - { - Id = "aqt", - Name = "Author in quotations or text abstracts", - Enabled = true - }, new {Id = "arc", Name = "Architect", Enabled = true}, - new - { - Id = "ard", - Name = "Artistic director", - Enabled = true - }, - new - { - Id = "arr", - Name = "Arranger", - Enabled = true - }, - new - { - Id = "art", - Name = "Artist", - Enabled = true - }, - new - { - Id = "asg", - Name = "Assignee", - Enabled = true - }, - new - { - Id = "asn", - Name = "Associated name", - Enabled = true - }, - new - { - Id = "ato", - Name = "Autographer", - Enabled = true - }, - new - { - Id = "att", - Name = "Attributed name", - Enabled = true - }, - new - { - Id = "auc", - Name = "Auctioneer", - Enabled = true - }, - new - { - Id = "aud", - Name = "Author of dialog", - Enabled = true - }, - new - { - Id = "aui", - Name = "Author of introduction, etc.", - Enabled = true - }, - new {Id = "aus", Name = "Screenwriter", Enabled = true}, - new - { - Id = "aut", - Name = "Author", - Enabled = true - }, - new - { - Id = "bdd", - Name = "Binding designer", - Enabled = true - }, - new - { - Id = "bjd", - Name = "Bookjacket designer", - Enabled = true - }, - new - { - Id = "bkd", - Name = "Book designer", - Enabled = true - }, - new - { - Id = "bkp", - Name = "Book producer", - Enabled = true - }, - new - { - Id = "blw", - Name = "Blurb writer", - Enabled = true - }, - new - { - Id = "bnd", - Name = "Binder", - Enabled = true - }, - new - { - Id = "bpd", - Name = "Bookplate designer", - Enabled = true - }, - new - { - Id = "brd", - Name = "Broadcaster", - Enabled = true - }, - new - { - Id = "brl", - Name = "Braille embosser", - Enabled = true - }, - new - { - Id = "bsl", - Name = "Bookseller", - Enabled = true - }, - new - { - Id = "cas", - Name = "Caster", - Enabled = true - }, - new - { - Id = "ccp", - Name = "Conceptor", - Enabled = true - }, - new - { - Id = "chr", - Name = "Choreographer", - Enabled = true - }, - new - { - Id = "clb", - Name = "Collaborator", - Enabled = false - }, - new - { - Id = "cli", - Name = "Client", - Enabled = true - }, - new - { - Id = "cll", - Name = "Calligrapher", - Enabled = true - }, - new - { - Id = "clr", - Name = "Colorist", - Enabled = true - }, - new - { - Id = "clt", - Name = "Collotyper", - Enabled = true - }, - new - { - Id = "cmm", - Name = "Commentator", - Enabled = true - }, - new - { - Id = "cmp", - Name = "Composer", - Enabled = true - }, - new - { - Id = "cmt", - Name = "Compositor", - Enabled = true - }, - new - { - Id = "cnd", - Name = "Conductor", - Enabled = true - }, - new - { - Id = "cng", - Name = "Cinematographer", - Enabled = true - }, - new - { - Id = "cns", - Name = "Censor", - Enabled = true - }, - new - { - Id = "coe", - Name = "Contestant-appellee", - Enabled = true - }, - new - { - Id = "col", - Name = "Collector", - Enabled = true - }, - new - { - Id = "com", - Name = "Compiler", - Enabled = true - }, - new - { - Id = "con", - Name = "Conservator", - Enabled = true - }, - new - { - Id = "cor", - Name = "Collection registrar", - Enabled = true - }, - new - { - Id = "cos", - Name = "Contestant", - Enabled = true - }, - new - { - Id = "cot", - Name = "Contestant-appellant", - Enabled = true - }, - new - { - Id = "cou", - Name = "Court governed", - Enabled = true - }, - new - { - Id = "cov", - Name = "Cover designer", - Enabled = true - }, - new - { - Id = "cpc", - Name = "Copyright claimant", - Enabled = true - }, - new - { - Id = "cpe", - Name = "Complainant-appellee", - Enabled = true - }, - new - { - Id = "cph", - Name = "Copyright holder", - Enabled = true - }, - new - { - Id = "cpl", - Name = "Complainant", - Enabled = true - }, - new - { - Id = "cpt", - Name = "Complainant-appellant", - Enabled = true - }, new {Id = "cre", Name = "Creator", Enabled = true}, - new - { - Id = "crp", - Name = "Correspondent", - Enabled = true - }, - new - { - Id = "crr", - Name = "Corrector", - Enabled = true - }, - new - { - Id = "crt", - Name = "Court reporter", - Enabled = true - }, - new - { - Id = "csl", - Name = "Consultant", - Enabled = true - }, - new - { - Id = "csp", - Name = "Consultant to a project", - Enabled = true - }, - new {Id = "cst", Name = "Costume designer", Enabled = true}, - new {Id = "ctb", Name = "Contributor", Enabled = true}, - new {Id = "cte", Name = "Contestee-appellee", Enabled = true}, - new {Id = "ctg", Name = "Cartographer", Enabled = true}, - new {Id = "ctr", Name = "Contractor", Enabled = true}, - new {Id = "cts", Name = "Contestee", Enabled = true}, - new {Id = "ctt", Name = "Contestee-appellant", Enabled = true}, - new {Id = "cur", Name = "Curator", Enabled = true}, - new - { - Id = "cwt", - Name = "Commentator for written text", - Enabled = true - }, - new {Id = "dbp", Name = "Distribution place", Enabled = true}, - new {Id = "dfd", Name = "Defendant", Enabled = true}, - new {Id = "dfe", Name = "Defendant-appellee", Enabled = true}, - new {Id = "dft", Name = "Defendant-appellant", Enabled = true}, - new - { - Id = "dgg", - Name = "Degree granting institution", - Enabled = true - }, - new {Id = "dgs", Name = "Degree supervisor", Enabled = true}, - new {Id = "dis", Name = "Dissertant", Enabled = true}, - new {Id = "dln", Name = "Delineator", Enabled = true}, - new {Id = "dnc", Name = "Dancer", Enabled = true}, - new {Id = "dnr", Name = "Donor", Enabled = true}, - new {Id = "dpc", Name = "Depicted", Enabled = true}, - new {Id = "dpt", Name = "Depositor", Enabled = true}, - new {Id = "drm", Name = "Draftsman", Enabled = true}, - new {Id = "drt", Name = "Director", Enabled = true}, - new {Id = "dsr", Name = "Designer", Enabled = true}, - new {Id = "dst", Name = "Distributor", Enabled = true}, - new {Id = "dtc", Name = "Data contributor", Enabled = true}, - new {Id = "dte", Name = "Dedicatee", Enabled = true}, - new {Id = "dtm", Name = "Data manager", Enabled = true}, - new {Id = "dto", Name = "Dedicator", Enabled = true}, - new {Id = "dub", Name = "Dubious author", Enabled = true}, - new - { - Id = "edc", - Name = "Editor of compilation", - Enabled = true - }, - new - { - Id = "edm", - Name = "Editor of moving image work", - Enabled = true - }, new {Id = "edt", Name = "Editor", Enabled = true}, - new {Id = "egr", Name = "Engraver", Enabled = true}, - new {Id = "elg", Name = "Electrician", Enabled = true}, - new {Id = "elt", Name = "Electrotyper", Enabled = true}, - new {Id = "eng", Name = "Engineer", Enabled = true}, - new - { - Id = "enj", - Name = "Enacting jurisdiction", - Enabled = true - }, new {Id = "etr", Name = "Etcher", Enabled = true}, - new - { - Id = "evp", - Name = "Event place", - Enabled = true - }, - new - { - Id = "exp", - Name = "Expert", - Enabled = true - }, - new - { - Id = "fac", - Name = "Facsimilist", - Enabled = true - }, - new - { - Id = "fds", - Name = "Film distributor", - Enabled = true - }, - new - { - Id = "fld", - Name = "Field director", - Enabled = true - }, - new - { - Id = "flm", - Name = "Film editor", - Enabled = true - }, - new - { - Id = "fmd", - Name = "Film director", - Enabled = true - }, - new - { - Id = "fmk", - Name = "Filmmaker", - Enabled = true - }, - new - { - Id = "fmo", - Name = "Former owner", - Enabled = true - }, - new - { - Id = "fmp", - Name = "Film producer", - Enabled = true - }, - new - { - Id = "fnd", - Name = "Funder", - Enabled = true - }, - new - { - Id = "fpy", - Name = "First party", - Enabled = true - }, - new - { - Id = "frg", - Name = "Forger", - Enabled = true - }, - new - { - Id = "gis", - Name = "Geographic information specialist", - Enabled = true - }, - new {Id = "grt", Name = "Graphic technician", Enabled = false}, - new {Id = "his", Name = "Host institution", Enabled = true}, - new {Id = "hnr", Name = "Honoree", Enabled = true}, - new {Id = "hst", Name = "Host", Enabled = true}, - new {Id = "ill", Name = "Illustrator", Enabled = true}, - new {Id = "ilu", Name = "Illuminator", Enabled = true}, - new {Id = "ins", Name = "Inscriber", Enabled = true}, - new {Id = "inv", Name = "Inventor", Enabled = true}, - new {Id = "isb", Name = "Issuing body", Enabled = true}, - new {Id = "itr", Name = "Instrumentalist", Enabled = true}, - new {Id = "ive", Name = "Interviewee", Enabled = true}, - new {Id = "ivr", Name = "Interviewer", Enabled = true}, - new {Id = "jud", Name = "Judge", Enabled = true}, - new - { - Id = "jug", - Name = "Jurisdiction governed", - Enabled = true - }, - new {Id = "lbr", Name = "Laboratory", Enabled = true}, - new - { - Id = "lbt", - Name = "Librettist", - Enabled = true - }, - new - { - Id = "ldr", - Name = "Laboratory director", - Enabled = true - }, - new - { - Id = "led", - Name = "Lead", - Enabled = true - }, - new - { - Id = "lee", - Name = "Libelee-appellee", - Enabled = true - }, - new - { - Id = "lel", - Name = "Libelee", - Enabled = true - }, - new - { - Id = "len", - Name = "Lender", - Enabled = true - }, - new - { - Id = "let", - Name = "Libelee-appellant", - Enabled = true - }, - new - { - Id = "lgd", - Name = "Lighting designer", - Enabled = true - }, - new - { - Id = "lie", - Name = "Libelant-appellee", - Enabled = true - }, - new - { - Id = "lil", - Name = "Libelant", - Enabled = true - }, - new - { - Id = "lit", - Name = "Libelant-appellant", - Enabled = true - }, - new - { - Id = "lsa", - Name = "Landscape architect", - Enabled = true - }, - new - { - Id = "lse", - Name = "Licensee", - Enabled = true - }, - new - { - Id = "lso", - Name = "Licensor", - Enabled = true - }, - new - { - Id = "ltg", - Name = "Lithographer", - Enabled = true - }, - new - { - Id = "lyr", - Name = "Lyricist", - Enabled = true - }, - new - { - Id = "mcp", - Name = "Music copyist", - Enabled = true - }, - new - { - Id = "mdc", - Name = "Metadata contact", - Enabled = true - }, - new - { - Id = "med", - Name = "Medium", - Enabled = true - }, - new - { - Id = "mfp", - Name = "Manufacture place", - Enabled = true - }, - new - { - Id = "mfr", - Name = "Manufacturer", - Enabled = true - }, - new - { - Id = "mod", - Name = "Moderator", - Enabled = true - }, - new - { - Id = "mon", - Name = "Monitor", - Enabled = true - }, - new - { - Id = "mrb", - Name = "Marbler", - Enabled = true - }, - new - { - Id = "mrk", - Name = "Markup editor", - Enabled = true - }, - new - { - Id = "msd", - Name = "Musical director", - Enabled = true - }, - new - { - Id = "mte", - Name = "Metal-engraver", - Enabled = true - }, - new - { - Id = "mtk", - Name = "Minute taker", - Enabled = true - }, - new - { - Id = "mus", - Name = "Musician", - Enabled = true - }, - new - { - Id = "nrt", - Name = "Narrator", - Enabled = true - }, - new - { - Id = "opn", - Name = "Opponent", - Enabled = true - }, - new - { - Id = "org", - Name = "Originator", - Enabled = true - }, - new - { - Id = "orm", - Name = "Organizer", - Enabled = true - }, - new - { - Id = "osp", - Name = "Onscreen presenter", - Enabled = true - }, - new - { - Id = "oth", - Name = "Other", - Enabled = true - }, - new - { - Id = "own", - Name = "Owner", - Enabled = true - }, - new - { - Id = "pan", - Name = "Panelist", - Enabled = true - }, - new - { - Id = "pat", - Name = "Patron", - Enabled = true - }, - new - { - Id = "pbd", - Name = "Publishing director", - Enabled = true - }, - new - { - Id = "pbl", - Name = "Publisher", - Enabled = true - }, - new - { - Id = "pdr", - Name = "Project director", - Enabled = true - }, - new - { - Id = "pfr", - Name = "Proofreader", - Enabled = true - }, - new - { - Id = "pht", - Name = "Photographer", - Enabled = true - }, - new - { - Id = "plt", - Name = "Platemaker", - Enabled = true - }, - new - { - Id = "pma", - Name = "Permitting agency", - Enabled = true - }, - new - { - Id = "pmn", - Name = "Production manager", - Enabled = true - }, - new - { - Id = "pop", - Name = "Printer of plates", - Enabled = true - }, - new - { - Id = "ppm", - Name = "Papermaker", - Enabled = true - }, - new - { - Id = "ppt", - Name = "Puppeteer", - Enabled = true - }, - new - { - Id = "pra", - Name = "Praeses", - Enabled = true - }, - new - { - Id = "prc", - Name = "Process contact", - Enabled = true - }, - new - { - Id = "prd", - Name = "Production personnel", - Enabled = true - }, - new - { - Id = "pre", - Name = "Presenter", - Enabled = true - }, - new - { - Id = "prf", - Name = "Performer", - Enabled = true - }, - new - { - Id = "prg", - Name = "Programmer", - Enabled = true - }, - new - { - Id = "prm", - Name = "Printmaker", - Enabled = true - }, - new - { - Id = "prn", - Name = "Production company", - Enabled = true - }, - new - { - Id = "pro", - Name = "Producer", - Enabled = true - }, - new - { - Id = "prp", - Name = "Production place", - Enabled = true - }, - new - { - Id = "prs", - Name = "Production designer", - Enabled = true - }, - new - { - Id = "prt", - Name = "Printer", - Enabled = true - }, - new - { - Id = "prv", - Name = "Provider", - Enabled = true - }, - new - { - Id = "pta", - Name = "Patent applicant", - Enabled = true - }, - new - { - Id = "pte", - Name = "Plaintiff-appellee", - Enabled = true - }, - new - { - Id = "ptf", - Name = "Plaintiff", - Enabled = true - }, - new - { - Id = "pth", - Name = "Patent holder", - Enabled = true - }, - new - { - Id = "ptt", - Name = "Plaintiff-appellant", - Enabled = true - }, - new - { - Id = "pup", - Name = "Publication place", - Enabled = true - }, - new - { - Id = "rbr", - Name = "Rubricator", - Enabled = true - }, - new - { - Id = "rcd", - Name = "Recordist", - Enabled = true - }, - new - { - Id = "rce", - Name = "Recording engineer", - Enabled = true - }, - new - { - Id = "rcp", - Name = "Addressee", - Enabled = true - }, - new - { - Id = "rdd", - Name = "Radio director", - Enabled = true - }, - new - { - Id = "red", - Name = "Redaktor", - Enabled = true - }, - new - { - Id = "ren", - Name = "Renderer", - Enabled = true - }, - new - { - Id = "res", - Name = "Researcher", - Enabled = true - }, - new - { - Id = "rev", - Name = "Reviewer", - Enabled = true - }, - new - { - Id = "rpc", - Name = "Radio producer", - Enabled = true - }, - new - { - Id = "rps", - Name = "Repository", - Enabled = true - }, - new - { - Id = "rpt", - Name = "Reporter", - Enabled = true - }, - new - { - Id = "rpy", - Name = "Responsible party", - Enabled = true - }, - new - { - Id = "rse", - Name = "Respondent-appellee", - Enabled = true - }, - new - { - Id = "rsg", - Name = "Restager", - Enabled = true - }, - new - { - Id = "rsp", - Name = "Respondent", - Enabled = true - }, - new - { - Id = "rsr", - Name = "Restorationist", - Enabled = true - }, - new - { - Id = "rst", - Name = "Respondent-appellant", - Enabled = true - }, - new - { - Id = "rth", - Name = "Research team head", - Enabled = true - }, - new - { - Id = "rtm", - Name = "Research team member", - Enabled = true - }, - new - { - Id = "sad", - Name = "Scientific advisor", - Enabled = true - }, - new - { - Id = "sce", - Name = "Scenarist", - Enabled = true - }, - new - { - Id = "scl", - Name = "Sculptor", - Enabled = true - }, - new - { - Id = "scr", - Name = "Scribe", - Enabled = true - }, - new - { - Id = "sds", - Name = "Sound designer", - Enabled = true - }, - new - { - Id = "sec", - Name = "Secretary", - Enabled = true - }, - new - { - Id = "sgd", - Name = "Stage director", - Enabled = true - }, - new - { - Id = "sgn", - Name = "Signer", - Enabled = true - }, - new - { - Id = "sht", - Name = "Supporting host", - Enabled = true - }, - new - { - Id = "sll", - Name = "Seller", - Enabled = true - }, - new - { - Id = "sng", - Name = "Singer", - Enabled = true - }, - new - { - Id = "spk", - Name = "Speaker", - Enabled = true - }, - new - { - Id = "spn", - Name = "Sponsor", - Enabled = true - }, - new - { - Id = "spy", - Name = "Second party", - Enabled = true - }, - new - { - Id = "srv", - Name = "Surveyor", - Enabled = true - }, - new - { - Id = "std", - Name = "Set designer", - Enabled = true - }, - new - { - Id = "stg", - Name = "Setting", - Enabled = true - }, - new - { - Id = "stl", - Name = "Storyteller", - Enabled = true - }, - new - { - Id = "stm", - Name = "Stage manager", - Enabled = true - }, - new - { - Id = "stn", - Name = "Standards body", - Enabled = true - }, - new - { - Id = "str", - Name = "Stereotyper", - Enabled = true - }, - new - { - Id = "tcd", - Name = "Technical director", - Enabled = true - }, - new - { - Id = "tch", - Name = "Teacher", - Enabled = true - }, - new - { - Id = "ths", - Name = "Thesis advisor", - Enabled = true - }, - new - { - Id = "tld", - Name = "Television director", - Enabled = true - }, - new - { - Id = "tlp", - Name = "Television producer", - Enabled = true - }, - new - { - Id = "trc", - Name = "Transcriber", - Enabled = true - }, - new - { - Id = "trl", - Name = "Translator", - Enabled = true - }, - new - { - Id = "tyd", - Name = "Type designer", - Enabled = true - }, - new - { - Id = "tyg", - Name = "Typographer", - Enabled = true - }, - new - { - Id = "uvp", - Name = "University place", - Enabled = true - }, - new - { - Id = "vac", - Name = "Voice actor", - Enabled = true - }, - new - { - Id = "vdg", - Name = "Videographer", - Enabled = true - }, - new - { - Id = "voc", - Name = "Vocalist", - Enabled = false - }, - new - { - Id = "wac", - Name = "Writer of added commentary", - Enabled = true - }, - new - { - Id = "wal", - Name = "Writer of added lyrics", - Enabled = true - }, - new - { - Id = "wam", - Name = "Writer of accompanying material", - Enabled = true - }, - new {Id = "wat", Name = "Writer of added text", Enabled = true}, - new {Id = "wdc", Name = "Woodcutter", Enabled = true}, - new {Id = "wde", Name = "Wood engraver", Enabled = true}, - new - { - Id = "win", - Name = "Writer of introduction", - Enabled = true - }, new {Id = "wit", Name = "Witness", Enabled = true}, - new - { - Id = "wpr", - Name = "Writer of preface", - Enabled = true - }, - new - { - Id = "wst", - Name = "Writer of supplementary textual content", - Enabled = true - }); - } + Id = "abr", Name = "Abridger", Enabled = true + }, new + { + Id = "acp", Name = "Art copyist", Enabled = true + }, new + { + Id = "act", Name = "Actor", Enabled = true + }, new + { + Id = "adi", Name = "Art director", Enabled = true + }, new + { + Id = "adp", Name = "Adapter", Enabled = true + }, new + { + Id = "aft", Name = "Author of afterword, colophon, etc.", Enabled = true + }, new + { + Id = "anl", Name = "Analyst", Enabled = true + }, new + { + Id = "anm", Name = "Animator", Enabled = true + }, new + { + Id = "ann", Name = "Annotator", Enabled = true + }, new + { + Id = "ant", Name = "Bibliographic antecedent", Enabled = true + }, new + { + Id = "ape", Name = "Appellee", Enabled = true + }, new + { + Id = "apl", Name = "Appellant", Enabled = true + }, new + { + Id = "app", Name = "Applicant", Enabled = true + }, new + { + Id = "aqt", Name = "Author in quotations or text abstracts", Enabled = true + }, new + { + Id = "arc", Name = "Architect", Enabled = true + }, new + { + Id = "ard", Name = "Artistic director", Enabled = true + }, new + { + Id = "arr", Name = "Arranger", Enabled = true + }, new + { + Id = "art", Name = "Artist", Enabled = true + }, new + { + Id = "asg", Name = "Assignee", Enabled = true + }, new + { + Id = "asn", Name = "Associated name", Enabled = true + }, new + { + Id = "ato", Name = "Autographer", Enabled = true + }, new + { + Id = "att", Name = "Attributed name", Enabled = true + }, new + { + Id = "auc", Name = "Auctioneer", Enabled = true + }, new + { + Id = "aud", Name = "Author of dialog", Enabled = true + }, new + { + Id = "aui", Name = "Author of introduction, etc.", Enabled = true + }, new + { + Id = "aus", Name = "Screenwriter", Enabled = true + }, new + { + Id = "aut", Name = "Author", Enabled = true + }, new + { + Id = "bdd", Name = "Binding designer", Enabled = true + }, new + { + Id = "bjd", Name = "Bookjacket designer", Enabled = true + }, new + { + Id = "bkd", Name = "Book designer", Enabled = true + }, new + { + Id = "bkp", Name = "Book producer", Enabled = true + }, new + { + Id = "blw", Name = "Blurb writer", Enabled = true + }, new + { + Id = "bnd", Name = "Binder", Enabled = true + }, new + { + Id = "bpd", Name = "Bookplate designer", Enabled = true + }, new + { + Id = "brd", Name = "Broadcaster", Enabled = true + }, new + { + Id = "brl", Name = "Braille embosser", Enabled = true + }, new + { + Id = "bsl", Name = "Bookseller", Enabled = true + }, new + { + Id = "cas", Name = "Caster", Enabled = true + }, new + { + Id = "ccp", Name = "Conceptor", Enabled = true + }, new + { + Id = "chr", Name = "Choreographer", Enabled = true + }, new + { + Id = "clb", Name = "Collaborator", Enabled = false + }, new + { + Id = "cli", Name = "Client", Enabled = true + }, new + { + Id = "cll", Name = "Calligrapher", Enabled = true + }, new + { + Id = "clr", Name = "Colorist", Enabled = true + }, new + { + Id = "clt", Name = "Collotyper", Enabled = true + }, new + { + Id = "cmm", Name = "Commentator", Enabled = true + }, new + { + Id = "cmp", Name = "Composer", Enabled = true + }, new + { + Id = "cmt", Name = "Compositor", Enabled = true + }, new + { + Id = "cnd", Name = "Conductor", Enabled = true + }, new + { + Id = "cng", Name = "Cinematographer", Enabled = true + }, new + { + Id = "cns", Name = "Censor", Enabled = true + }, new + { + Id = "coe", Name = "Contestant-appellee", Enabled = true + }, new + { + Id = "col", Name = "Collector", Enabled = true + }, new + { + Id = "com", Name = "Compiler", Enabled = true + }, new + { + Id = "con", Name = "Conservator", Enabled = true + }, new + { + Id = "cor", Name = "Collection registrar", Enabled = true + }, new + { + Id = "cos", Name = "Contestant", Enabled = true + }, new + { + Id = "cot", Name = "Contestant-appellant", Enabled = true + }, new + { + Id = "cou", Name = "Court governed", Enabled = true + }, new + { + Id = "cov", Name = "Cover designer", Enabled = true + }, new + { + Id = "cpc", Name = "Copyright claimant", Enabled = true + }, new + { + Id = "cpe", Name = "Complainant-appellee", Enabled = true + }, new + { + Id = "cph", Name = "Copyright holder", Enabled = true + }, new + { + Id = "cpl", Name = "Complainant", Enabled = true + }, new + { + Id = "cpt", Name = "Complainant-appellant", Enabled = true + }, new + { + Id = "cre", Name = "Creator", Enabled = true + }, new + { + Id = "crp", Name = "Correspondent", Enabled = true + }, new + { + Id = "crr", Name = "Corrector", Enabled = true + }, new + { + Id = "crt", Name = "Court reporter", Enabled = true + }, new + { + Id = "csl", Name = "Consultant", Enabled = true + }, new + { + Id = "csp", Name = "Consultant to a project", Enabled = true + }, new + { + Id = "cst", Name = "Costume designer", Enabled = true + }, new + { + Id = "ctb", Name = "Contributor", Enabled = true + }, new + { + Id = "cte", Name = "Contestee-appellee", Enabled = true + }, new + { + Id = "ctg", Name = "Cartographer", Enabled = true + }, new + { + Id = "ctr", Name = "Contractor", Enabled = true + }, new + { + Id = "cts", Name = "Contestee", Enabled = true + }, new + { + Id = "ctt", Name = "Contestee-appellant", Enabled = true + }, new + { + Id = "cur", Name = "Curator", Enabled = true + }, new + { + Id = "cwt", Name = "Commentator for written text", Enabled = true + }, new + { + Id = "dbp", Name = "Distribution place", Enabled = true + }, new + { + Id = "dfd", Name = "Defendant", Enabled = true + }, new + { + Id = "dfe", Name = "Defendant-appellee", Enabled = true + }, new + { + Id = "dft", Name = "Defendant-appellant", Enabled = true + }, new + { + Id = "dgg", Name = "Degree granting institution", Enabled = true + }, new + { + Id = "dgs", Name = "Degree supervisor", Enabled = true + }, new + { + Id = "dis", Name = "Dissertant", Enabled = true + }, new + { + Id = "dln", Name = "Delineator", Enabled = true + }, new + { + Id = "dnc", Name = "Dancer", Enabled = true + }, new + { + Id = "dnr", Name = "Donor", Enabled = true + }, new + { + Id = "dpc", Name = "Depicted", Enabled = true + }, new + { + Id = "dpt", Name = "Depositor", Enabled = true + }, new + { + Id = "drm", Name = "Draftsman", Enabled = true + }, new + { + Id = "drt", Name = "Director", Enabled = true + }, new + { + Id = "dsr", Name = "Designer", Enabled = true + }, new + { + Id = "dst", Name = "Distributor", Enabled = true + }, new + { + Id = "dtc", Name = "Data contributor", Enabled = true + }, new + { + Id = "dte", Name = "Dedicatee", Enabled = true + }, new + { + Id = "dtm", Name = "Data manager", Enabled = true + }, new + { + Id = "dto", Name = "Dedicator", Enabled = true + }, new + { + Id = "dub", Name = "Dubious author", Enabled = true + }, new + { + Id = "edc", Name = "Editor of compilation", Enabled = true + }, new + { + Id = "edm", Name = "Editor of moving image work", Enabled = true + }, new + { + Id = "edt", Name = "Editor", Enabled = true + }, new + { + Id = "egr", Name = "Engraver", Enabled = true + }, new + { + Id = "elg", Name = "Electrician", Enabled = true + }, new + { + Id = "elt", Name = "Electrotyper", Enabled = true + }, new + { + Id = "eng", Name = "Engineer", Enabled = true + }, new + { + Id = "enj", Name = "Enacting jurisdiction", Enabled = true + }, new + { + Id = "etr", Name = "Etcher", Enabled = true + }, new + { + Id = "evp", Name = "Event place", Enabled = true + }, new + { + Id = "exp", Name = "Expert", Enabled = true + }, new + { + Id = "fac", Name = "Facsimilist", Enabled = true + }, new + { + Id = "fds", Name = "Film distributor", Enabled = true + }, new + { + Id = "fld", Name = "Field director", Enabled = true + }, new + { + Id = "flm", Name = "Film editor", Enabled = true + }, new + { + Id = "fmd", Name = "Film director", Enabled = true + }, new + { + Id = "fmk", Name = "Filmmaker", Enabled = true + }, new + { + Id = "fmo", Name = "Former owner", Enabled = true + }, new + { + Id = "fmp", Name = "Film producer", Enabled = true + }, new + { + Id = "fnd", Name = "Funder", Enabled = true + }, new + { + Id = "fpy", Name = "First party", Enabled = true + }, new + { + Id = "frg", Name = "Forger", Enabled = true + }, new + { + Id = "gis", Name = "Geographic information specialist", Enabled = true + }, new + { + Id = "grt", Name = "Graphic technician", Enabled = false + }, new + { + Id = "his", Name = "Host institution", Enabled = true + }, new + { + Id = "hnr", Name = "Honoree", Enabled = true + }, new + { + Id = "hst", Name = "Host", Enabled = true + }, new + { + Id = "ill", Name = "Illustrator", Enabled = true + }, new + { + Id = "ilu", Name = "Illuminator", Enabled = true + }, new + { + Id = "ins", Name = "Inscriber", Enabled = true + }, new + { + Id = "inv", Name = "Inventor", Enabled = true + }, new + { + Id = "isb", Name = "Issuing body", Enabled = true + }, new + { + Id = "itr", Name = "Instrumentalist", Enabled = true + }, new + { + Id = "ive", Name = "Interviewee", Enabled = true + }, new + { + Id = "ivr", Name = "Interviewer", Enabled = true + }, new + { + Id = "jud", Name = "Judge", Enabled = true + }, new + { + Id = "jug", Name = "Jurisdiction governed", Enabled = true + }, new + { + Id = "lbr", Name = "Laboratory", Enabled = true + }, new + { + Id = "lbt", Name = "Librettist", Enabled = true + }, new + { + Id = "ldr", Name = "Laboratory director", Enabled = true + }, new + { + Id = "led", Name = "Lead", Enabled = true + }, new + { + Id = "lee", Name = "Libelee-appellee", Enabled = true + }, new + { + Id = "lel", Name = "Libelee", Enabled = true + }, new + { + Id = "len", Name = "Lender", Enabled = true + }, new + { + Id = "let", Name = "Libelee-appellant", Enabled = true + }, new + { + Id = "lgd", Name = "Lighting designer", Enabled = true + }, new + { + Id = "lie", Name = "Libelant-appellee", Enabled = true + }, new + { + Id = "lil", Name = "Libelant", Enabled = true + }, new + { + Id = "lit", Name = "Libelant-appellant", Enabled = true + }, new + { + Id = "lsa", Name = "Landscape architect", Enabled = true + }, new + { + Id = "lse", Name = "Licensee", Enabled = true + }, new + { + Id = "lso", Name = "Licensor", Enabled = true + }, new + { + Id = "ltg", Name = "Lithographer", Enabled = true + }, new + { + Id = "lyr", Name = "Lyricist", Enabled = true + }, new + { + Id = "mcp", Name = "Music copyist", Enabled = true + }, new + { + Id = "mdc", Name = "Metadata contact", Enabled = true + }, new + { + Id = "med", Name = "Medium", Enabled = true + }, new + { + Id = "mfp", Name = "Manufacture place", Enabled = true + }, new + { + Id = "mfr", Name = "Manufacturer", Enabled = true + }, new + { + Id = "mod", Name = "Moderator", Enabled = true + }, new + { + Id = "mon", Name = "Monitor", Enabled = true + }, new + { + Id = "mrb", Name = "Marbler", Enabled = true + }, new + { + Id = "mrk", Name = "Markup editor", Enabled = true + }, new + { + Id = "msd", Name = "Musical director", Enabled = true + }, new + { + Id = "mte", Name = "Metal-engraver", Enabled = true + }, new + { + Id = "mtk", Name = "Minute taker", Enabled = true + }, new + { + Id = "mus", Name = "Musician", Enabled = true + }, new + { + Id = "nrt", Name = "Narrator", Enabled = true + }, new + { + Id = "opn", Name = "Opponent", Enabled = true + }, new + { + Id = "org", Name = "Originator", Enabled = true + }, new + { + Id = "orm", Name = "Organizer", Enabled = true + }, new + { + Id = "osp", Name = "Onscreen presenter", Enabled = true + }, new + { + Id = "oth", Name = "Other", Enabled = true + }, new + { + Id = "own", Name = "Owner", Enabled = true + }, new + { + Id = "pan", Name = "Panelist", Enabled = true + }, new + { + Id = "pat", Name = "Patron", Enabled = true + }, new + { + Id = "pbd", Name = "Publishing director", Enabled = true + }, new + { + Id = "pbl", Name = "Publisher", Enabled = true + }, new + { + Id = "pdr", Name = "Project director", Enabled = true + }, new + { + Id = "pfr", Name = "Proofreader", Enabled = true + }, new + { + Id = "pht", Name = "Photographer", Enabled = true + }, new + { + Id = "plt", Name = "Platemaker", Enabled = true + }, new + { + Id = "pma", Name = "Permitting agency", Enabled = true + }, new + { + Id = "pmn", Name = "Production manager", Enabled = true + }, new + { + Id = "pop", Name = "Printer of plates", Enabled = true + }, new + { + Id = "ppm", Name = "Papermaker", Enabled = true + }, new + { + Id = "ppt", Name = "Puppeteer", Enabled = true + }, new + { + Id = "pra", Name = "Praeses", Enabled = true + }, new + { + Id = "prc", Name = "Process contact", Enabled = true + }, new + { + Id = "prd", Name = "Production personnel", Enabled = true + }, new + { + Id = "pre", Name = "Presenter", Enabled = true + }, new + { + Id = "prf", Name = "Performer", Enabled = true + }, new + { + Id = "prg", Name = "Programmer", Enabled = true + }, new + { + Id = "prm", Name = "Printmaker", Enabled = true + }, new + { + Id = "prn", Name = "Production company", Enabled = true + }, new + { + Id = "pro", Name = "Producer", Enabled = true + }, new + { + Id = "prp", Name = "Production place", Enabled = true + }, new + { + Id = "prs", Name = "Production designer", Enabled = true + }, new + { + Id = "prt", Name = "Printer", Enabled = true + }, new + { + Id = "prv", Name = "Provider", Enabled = true + }, new + { + Id = "pta", Name = "Patent applicant", Enabled = true + }, new + { + Id = "pte", Name = "Plaintiff-appellee", Enabled = true + }, new + { + Id = "ptf", Name = "Plaintiff", Enabled = true + }, new + { + Id = "pth", Name = "Patent holder", Enabled = true + }, new + { + Id = "ptt", Name = "Plaintiff-appellant", Enabled = true + }, new + { + Id = "pup", Name = "Publication place", Enabled = true + }, new + { + Id = "rbr", Name = "Rubricator", Enabled = true + }, new + { + Id = "rcd", Name = "Recordist", Enabled = true + }, new + { + Id = "rce", Name = "Recording engineer", Enabled = true + }, new + { + Id = "rcp", Name = "Addressee", Enabled = true + }, new + { + Id = "rdd", Name = "Radio director", Enabled = true + }, new + { + Id = "red", Name = "Redaktor", Enabled = true + }, new + { + Id = "ren", Name = "Renderer", Enabled = true + }, new + { + Id = "res", Name = "Researcher", Enabled = true + }, new + { + Id = "rev", Name = "Reviewer", Enabled = true + }, new + { + Id = "rpc", Name = "Radio producer", Enabled = true + }, new + { + Id = "rps", Name = "Repository", Enabled = true + }, new + { + Id = "rpt", Name = "Reporter", Enabled = true + }, new + { + Id = "rpy", Name = "Responsible party", Enabled = true + }, new + { + Id = "rse", Name = "Respondent-appellee", Enabled = true + }, new + { + Id = "rsg", Name = "Restager", Enabled = true + }, new + { + Id = "rsp", Name = "Respondent", Enabled = true + }, new + { + Id = "rsr", Name = "Restorationist", Enabled = true + }, new + { + Id = "rst", Name = "Respondent-appellant", Enabled = true + }, new + { + Id = "rth", Name = "Research team head", Enabled = true + }, new + { + Id = "rtm", Name = "Research team member", Enabled = true + }, new + { + Id = "sad", Name = "Scientific advisor", Enabled = true + }, new + { + Id = "sce", Name = "Scenarist", Enabled = true + }, new + { + Id = "scl", Name = "Sculptor", Enabled = true + }, new + { + Id = "scr", Name = "Scribe", Enabled = true + }, new + { + Id = "sds", Name = "Sound designer", Enabled = true + }, new + { + Id = "sec", Name = "Secretary", Enabled = true + }, new + { + Id = "sgd", Name = "Stage director", Enabled = true + }, new + { + Id = "sgn", Name = "Signer", Enabled = true + }, new + { + Id = "sht", Name = "Supporting host", Enabled = true + }, new + { + Id = "sll", Name = "Seller", Enabled = true + }, new + { + Id = "sng", Name = "Singer", Enabled = true + }, new + { + Id = "spk", Name = "Speaker", Enabled = true + }, new + { + Id = "spn", Name = "Sponsor", Enabled = true + }, new + { + Id = "spy", Name = "Second party", Enabled = true + }, new + { + Id = "srv", Name = "Surveyor", Enabled = true + }, new + { + Id = "std", Name = "Set designer", Enabled = true + }, new + { + Id = "stg", Name = "Setting", Enabled = true + }, new + { + Id = "stl", Name = "Storyteller", Enabled = true + }, new + { + Id = "stm", Name = "Stage manager", Enabled = true + }, new + { + Id = "stn", Name = "Standards body", Enabled = true + }, new + { + Id = "str", Name = "Stereotyper", Enabled = true + }, new + { + Id = "tcd", Name = "Technical director", Enabled = true + }, new + { + Id = "tch", Name = "Teacher", Enabled = true + }, new + { + Id = "ths", Name = "Thesis advisor", Enabled = true + }, new + { + Id = "tld", Name = "Television director", Enabled = true + }, new + { + Id = "tlp", Name = "Television producer", Enabled = true + }, new + { + Id = "trc", Name = "Transcriber", Enabled = true + }, new + { + Id = "trl", Name = "Translator", Enabled = true + }, new + { + Id = "tyd", Name = "Type designer", Enabled = true + }, new + { + Id = "tyg", Name = "Typographer", Enabled = true + }, new + { + Id = "uvp", Name = "University place", Enabled = true + }, new + { + Id = "vac", Name = "Voice actor", Enabled = true + }, new + { + Id = "vdg", Name = "Videographer", Enabled = true + }, new + { + Id = "voc", Name = "Vocalist", Enabled = false + }, new + { + Id = "wac", Name = "Writer of added commentary", Enabled = true + }, new + { + Id = "wal", Name = "Writer of added lyrics", Enabled = true + }, new + { + Id = "wam", Name = "Writer of accompanying material", Enabled = true + }, new + { + Id = "wat", Name = "Writer of added text", Enabled = true + }, new + { + Id = "wdc", Name = "Woodcutter", Enabled = true + }, new + { + Id = "wde", Name = "Wood engraver", Enabled = true + }, new + { + Id = "win", Name = "Writer of introduction", Enabled = true + }, new + { + Id = "wit", Name = "Witness", Enabled = true + }, new + { + Id = "wpr", Name = "Writer of preface", Enabled = true + }, new + { + Id = "wst", Name = "Writer of supplementary textual content", Enabled = true + }); } } \ No newline at end of file diff --git a/Marechai.Database/Seeders/License.cs b/Marechai.Database/Seeders/License.cs index 7be50633..a03b7bab 100644 --- a/Marechai.Database/Seeders/License.cs +++ b/Marechai.Database/Seeders/License.cs @@ -4,3193 +4,1637 @@ namespace Marechai.Database.Seeders { public static class License { - public static void Seed(ModelBuilder modelBuilder) + public static void Seed(ModelBuilder modelBuilder) => modelBuilder.Entity().HasData(new { - modelBuilder.Entity() - .HasData(new {Id = 1, Name = "Fair use", FsfApproved = false, OsiApproved = false}, - new {Id = 2, Name = "Advertisement use", FsfApproved = false, OsiApproved = false}, - new {Id = 3, Name = "All rights reserved", FsfApproved = false, OsiApproved = false}, - new - { - Id = 4, - Name = "BSD Zero Clause License", - SPDX = "0BSD", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/0BSD.html#licenseText" - }, - new - { - Id = 5, - Name = "Attribution Assurance License", - SPDX = "AAL", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/AAL.html#licenseText" - }, new - { - Id = 6, - Name = "Abstyles License", - SPDX = "Abstyles", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Abstyles.html#licenseText" - }, - new - { - Id = 7, - Name = "Adobe Systems Incorporated Source Code License Agreement", - SPDX = "Adobe-2006", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Adobe-2006.html#licenseText" - }, - new - { - Id = 8, - Name = "Adobe Glyph List License", - SPDX = "Adobe-Glyph", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Adobe-Glyph.html#licenseText" - }, - new - { - Id = 9, - Name = "Amazon Digital Services License", - SPDX = "ADSL", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/ADSL.html#licenseText" - }, - new - { - Id = 10, - Name = "Academic Free License v1.1", - SPDX = "AFL-1.1", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/AFL-1.1.html#licenseText" - }, - new - { - Id = 11, - Name = "Academic Free License v1.2", - SPDX = "AFL-1.2", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/AFL-1.2.html#licenseText" - }, - new - { - Id = 12, - Name = "Academic Free License v2.0", - SPDX = "AFL-2.0", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/AFL-2.0.html#licenseText" - }, - new - { - Id = 13, - Name = "Academic Free License v2.1", - SPDX = "AFL-2.1", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/AFL-2.1.html#licenseText" - }, - new - { - Id = 14, - Name = "Academic Free License v3.0", - SPDX = "AFL-3.0", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/AFL-3.0.html#licenseText" - }, new - { - Id = 15, - Name = "Afmparse License", - SPDX = "Afmparse", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Afmparse.html#licenseText" - }, - new - { - Id = 16, - Name = "Affero General Public License v1.0 only", - SPDX = "AGPL-1.0-only", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/AGPL-1.0-only.html#licenseText" - }, - new - { - Id = 17, - Name = "Affero General Public License v1.0 or later", - SPDX = "AGPL-1.0-or-later", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/AGPL-1.0-or-later.html#licenseText" - }, - new - { - Id = 18, - Name = "GNU Affero General Public License v3.0 only", - SPDX = "AGPL-3.0-only", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/AGPL-3.0-only.html#licenseText" - }, - new - { - Id = 19, - Name = "GNU Affero General Public License v3.0 or later", - SPDX = "AGPL-3.0-or-later", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/AGPL-3.0-or-later.html#licenseText" - }, - new - { - Id = 20, - Name = "Aladdin Free Public License", - SPDX = "Aladdin", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Aladdin.html#licenseText" - }, - new - { - Id = 21, - Name = "AMD's plpa_map.c License", - SPDX = "AMDPLPA", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/AMDPLPA.html#licenseText" - }, new - { - Id = 22, - Name = "Apple MIT License", - SPDX = "AML", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/AML.html#licenseText" - }, - new - { - Id = 23, - Name = "Academy of Motion Picture Arts and Sciences BSD", - SPDX = "AMPAS", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/AMPAS.html#licenseText" - }, - new - { - Id = 24, - Name = "ANTLR Software Rights Notice", - SPDX = "ANTLR-PD", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/ANTLR-PD.html#licenseText" - }, - new - { - Id = 25, - Name = "Apache License 1.0", - SPDX = "Apache-1.0", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/Apache-1.0.html#licenseText" - }, new - { - Id = 26, - Name = "Apache License 1.1", - SPDX = "Apache-1.1", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/Apache-1.1.html#licenseText" - }, new - { - Id = 27, - Name = "Apache License 2.0", - SPDX = "Apache-2.0", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/Apache-2.0.html#licenseText" - }, - new - { - Id = 28, - Name = "Adobe Postscript AFM License", - SPDX = "APAFML", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/APAFML.html#licenseText" - }, - new - { - Id = 29, - Name = "Adaptive Public License 1.0", - SPDX = "APL-1.0", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/APL-1.0.html#licenseText" - }, - new - { - Id = 30, - Name = "Apple Public Source License 1.0", - SPDX = "APSL-1.0", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/APSL-1.0.html#licenseText" - }, - new - { - Id = 31, - Name = "Apple Public Source License 1.1", - SPDX = "APSL-1.1", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/APSL-1.1.html#licenseText" - }, - new - { - Id = 32, - Name = "Apple Public Source License 1.2", - SPDX = "APSL-1.2", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/APSL-1.2.html#licenseText" - }, - new - { - Id = 33, - Name = "Apple Public Source License 2.0", - SPDX = "APSL-2.0", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/APSL-2.0.html#licenseText" - }, - new - { - Id = 34, - Name = "Artistic License 1.0", - SPDX = "Artistic-1.0", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/Artistic-1.0.html#licenseText" - }, - new - { - Id = 35, - Name = "Artistic License 1.0 w/clause 8", - SPDX = "Artistic-1.0-cl8", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/Artistic-1.0-cl8.html#licenseText" - }, - new - { - Id = 36, - Name = "Artistic License 1.0 (Perl)", - SPDX = "Artistic-1.0-Perl", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/Artistic-1.0-Perl.html#licenseText" - }, - new - { - Id = 37, - Name = "Artistic License 2.0", - SPDX = "Artistic-2.0", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/Artistic-2.0.html#licenseText" - }, new - { - Id = 38, - Name = "Bahyph License", - SPDX = "Bahyph", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Bahyph.html#licenseText" - }, new - { - Id = 39, - Name = "Barr License", - SPDX = "Barr", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Barr.html#licenseText" - }, new - { - Id = 40, - Name = "Beerware License", - SPDX = "Beerware", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Beerware.html#licenseText" - }, - new - { - Id = 41, - Name = "BitTorrent Open Source License v1.0", - SPDX = "BitTorrent-1.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/BitTorrent-1.0.html#licenseText" - }, - new - { - Id = 42, - Name = "BitTorrent Open Source License v1.1", - SPDX = "BitTorrent-1.1", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/BitTorrent-1.1.html#licenseText" - }, new - { - Id = 43, - Name = "Borceux license", - SPDX = "Borceux", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Borceux.html#licenseText" - }, - new - { - Id = 44, - Name = "BSD 1-Clause License", - SPDX = "BSD-1-Clause", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/BSD-1-Clause.html#licenseText" - }, - new - { - Id = 45, - Name = "BSD 2-Clause \"Simplified\" License", - SPDX = "BSD-2-Clause", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/BSD-2-Clause.html#licenseText" - }, - new - { - Id = 46, - Name = "BSD 2-Clause FreeBSD License", - SPDX = "BSD-2-Clause-FreeBSD", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/BSD-2-Clause-FreeBSD.html#licenseText" - }, - new - { - Id = 47, - Name = "BSD 2-Clause NetBSD License", - SPDX = "BSD-2-Clause-NetBSD", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/BSD-2-Clause-NetBSD.html#licenseText" - }, - new - { - Id = 48, - Name = "BSD-2-Clause Plus Patent License", - SPDX = "BSD-2-Clause-Patent", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/BSD-2-Clause-Patent.html#licenseText" - }, - new - { - Id = 49, - Name = "BSD 3-Clause \"New\" or \"Revised\" License", - SPDX = "BSD-3-Clause", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/BSD-3-Clause.html#licenseText" - }, - new - { - Id = 50, - Name = "BSD with attribution", - SPDX = "BSD-3-Clause-Attribution", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/BSD-3-Clause-Attribution.html#licenseText" - }, - new - { - Id = 51, - Name = "BSD 3-Clause Clear License", - SPDX = "BSD-3-Clause-Clear", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/BSD-3-Clause-Clear.html#licenseText" - }, - new - { - Id = 52, - Name = "Lawrence Berkeley National Labs BSD variant license", - SPDX = "BSD-3-Clause-LBNL", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/BSD-3-Clause-LBNL.html#licenseText" - }, - new - { - Id = 53, - Name = "BSD 3-Clause No Nuclear License", - SPDX = "BSD-3-Clause-No-Nuclear-License", - FsfApproved = false, - OsiApproved = false, - Link = - "https://spdx.org/licenses/BSD-3-Clause-No-Nuclear-License.html#licenseText" - }, - new - { - Id = 54, - Name = "BSD 3-Clause No Nuclear License 2014", - SPDX = "BSD-3-Clause-No-Nuclear-License-2014", - FsfApproved = false, - OsiApproved = false, - Link = - "https://spdx.org/licenses/BSD-3-Clause-No-Nuclear-License-2014.html#licenseText" - }, - new - { - Id = 55, - Name = "BSD 3-Clause No Nuclear Warranty", - SPDX = "BSD-3-Clause-No-Nuclear-Warranty", - FsfApproved = false, - OsiApproved = false, - Link = - "https://spdx.org/licenses/BSD-3-Clause-No-Nuclear-Warranty.html#licenseText" - }, - new - { - Id = 56, - Name = "BSD 4-Clause \"Original\" or \"Old\" License", - SPDX = "BSD-4-Clause", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/BSD-4-Clause.html#licenseText" - }, - new - { - Id = 57, - Name = "BSD-4-Clause (University of California-Specific)", - SPDX = "BSD-4-Clause-UC", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/BSD-4-Clause-UC.html#licenseText" - }, - new - { - Id = 58, - Name = "BSD Protection License", - SPDX = "BSD-Protection", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/BSD-Protection.html#licenseText" - }, - new - { - Id = 59, - Name = "BSD Source Code Attribution", - SPDX = "BSD-Source-Code", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/BSD-Source-Code.html#licenseText" - }, - new - { - Id = 60, - Name = "Boost Software License 1.0", - SPDX = "BSL-1.0", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/BSL-1.0.html#licenseText" - }, - new - { - Id = 61, - Name = "bzip2 and libbzip2 License v1.0.5", - SPDX = "bzip2-1.0.5", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/bzip2-1.0.5.html#licenseText" - }, - new - { - Id = 62, - Name = "bzip2 and libbzip2 License v1.0.6", - SPDX = "bzip2-1.0.6", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/bzip2-1.0.6.html#licenseText" - }, new - { - Id = 63, - Name = "Caldera License", - SPDX = "Caldera", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Caldera.html#licenseText" - }, - new - { - Id = 64, - Name = "Computer Associates Trusted Open Source License 1.1", - SPDX = "CATOSL-1.1", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/CATOSL-1.1.html#licenseText" - }, - new - { - Id = 65, - Name = "Creative Commons Attribution 1.0 Generic", - SPDX = "CC-BY-1.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CC-BY-1.0.html#licenseText" - }, - new - { - Id = 66, - Name = "Creative Commons Attribution 2.0 Generic", - SPDX = "CC-BY-2.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CC-BY-2.0.html#licenseText" - }, - new - { - Id = 67, - Name = "Creative Commons Attribution 2.5 Generic", - SPDX = "CC-BY-2.5", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CC-BY-2.5.html#licenseText" - }, - new - { - Id = 68, - Name = "Creative Commons Attribution 3.0 Unported", - SPDX = "CC-BY-3.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CC-BY-3.0.html#licenseText" - }, - new - { - Id = 69, - Name = "Creative Commons Attribution 4.0 International", - SPDX = "CC-BY-4.0", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/CC-BY-4.0.html#licenseText" - }, - new - { - Id = 70, - Name = "Creative Commons Attribution Non Commercial 1.0 Generic", - SPDX = "CC-BY-NC-1.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CC-BY-NC-1.0.html#licenseText" - }, - new - { - Id = 71, - Name = "Creative Commons Attribution Non Commercial 2.0 Generic", - SPDX = "CC-BY-NC-2.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CC-BY-NC-2.0.html#licenseText" - }, - new - { - Id = 72, - Name = "Creative Commons Attribution Non Commercial 2.5 Generic", - SPDX = "CC-BY-NC-2.5", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CC-BY-NC-2.5.html#licenseText" - }, - new - { - Id = 73, - Name = "Creative Commons Attribution Non Commercial 3.0 Unported", - SPDX = "CC-BY-NC-3.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CC-BY-NC-3.0.html#licenseText" - }, - new - { - Id = 74, - Name = "Creative Commons Attribution Non Commercial 4.0 International", - SPDX = "CC-BY-NC-4.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CC-BY-NC-4.0.html#licenseText" - }, - new - { - Id = 75, - Name = - "Creative Commons Attribution Non Commercial No Derivatives 1.0 Generic", - SPDX = "CC-BY-NC-ND-1.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CC-BY-NC-ND-1.0.html#licenseText" - }, - new - { - Id = 76, - Name = - "Creative Commons Attribution Non Commercial No Derivatives 2.0 Generic", - SPDX = "CC-BY-NC-ND-2.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CC-BY-NC-ND-2.0.html#licenseText" - }, - new - { - Id = 77, - Name = - "Creative Commons Attribution Non Commercial No Derivatives 2.5 Generic", - SPDX = "CC-BY-NC-ND-2.5", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CC-BY-NC-ND-2.5.html#licenseText" - }, - new - { - Id = 78, - Name = - "Creative Commons Attribution Non Commercial No Derivatives 3.0 Unported", - SPDX = "CC-BY-NC-ND-3.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CC-BY-NC-ND-3.0.html#licenseText" - }, - new - { - Id = 79, - Name = - "Creative Commons Attribution Non Commercial No Derivatives 4.0 International", - SPDX = "CC-BY-NC-ND-4.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CC-BY-NC-ND-4.0.html#licenseText" - }, - new - { - Id = 80, - Name = - "Creative Commons Attribution Non Commercial Share Alike 1.0 Generic", - SPDX = "CC-BY-NC-SA-1.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CC-BY-NC-SA-1.0.html#licenseText" - }, - new - { - Id = 81, - Name = - "Creative Commons Attribution Non Commercial Share Alike 2.0 Generic", - SPDX = "CC-BY-NC-SA-2.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CC-BY-NC-SA-2.0.html#licenseText" - }, - new - { - Id = 82, - Name = - "Creative Commons Attribution Non Commercial Share Alike 2.5 Generic", - SPDX = "CC-BY-NC-SA-2.5", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CC-BY-NC-SA-2.5.html#licenseText" - }, - new - { - Id = 83, - Name = - "Creative Commons Attribution Non Commercial Share Alike 3.0 Unported", - SPDX = "CC-BY-NC-SA-3.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CC-BY-NC-SA-3.0.html#licenseText" - }, - new - { - Id = 84, - Name = - "Creative Commons Attribution Non Commercial Share Alike 4.0 International", - SPDX = "CC-BY-NC-SA-4.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CC-BY-NC-SA-4.0.html#licenseText" - }, - new - { - Id = 85, - Name = "Creative Commons Attribution No Derivatives 1.0 Generic", - SPDX = "CC-BY-ND-1.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CC-BY-ND-1.0.html#licenseText" - }, - new - { - Id = 86, - Name = "Creative Commons Attribution No Derivatives 2.0 Generic", - SPDX = "CC-BY-ND-2.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CC-BY-ND-2.0.html#licenseText" - }, - new - { - Id = 87, - Name = "Creative Commons Attribution No Derivatives 2.5 Generic", - SPDX = "CC-BY-ND-2.5", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CC-BY-ND-2.5.html#licenseText" - }, - new - { - Id = 88, - Name = "Creative Commons Attribution No Derivatives 3.0 Unported", - SPDX = "CC-BY-ND-3.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CC-BY-ND-3.0.html#licenseText" - }, - new - { - Id = 89, - Name = "Creative Commons Attribution No Derivatives 4.0 International", - SPDX = "CC-BY-ND-4.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CC-BY-ND-4.0.html#licenseText" - }, - new - { - Id = 90, - Name = "Creative Commons Attribution Share Alike 1.0 Generic", - SPDX = "CC-BY-SA-1.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CC-BY-SA-1.0.html#licenseText" - }, - new - { - Id = 91, - Name = "Creative Commons Attribution Share Alike 2.0 Generic", - SPDX = "CC-BY-SA-2.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CC-BY-SA-2.0.html#licenseText" - }, - new - { - Id = 92, - Name = "Creative Commons Attribution Share Alike 2.5 Generic", - SPDX = "CC-BY-SA-2.5", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CC-BY-SA-2.5.html#licenseText" - }, - new - { - Id = 93, - Name = "Creative Commons Attribution Share Alike 3.0 Unported", - SPDX = "CC-BY-SA-3.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CC-BY-SA-3.0.html#licenseText" - }, - new - { - Id = 94, - Name = "Creative Commons Attribution Share Alike 4.0 International", - SPDX = "CC-BY-SA-4.0", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/CC-BY-SA-4.0.html#licenseText" - }, - new - { - Id = 95, - Name = "Creative Commons Zero v1.0 Universal", - SPDX = "CC0-1.0", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/CC0-1.0.html#licenseText" - }, - new - { - Id = 96, - Name = "Common Development and Distribution License 1.0", - SPDX = "CDDL-1.0", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/CDDL-1.0.html#licenseText" - }, - new - { - Id = 97, - Name = "Common Development and Distribution License 1.1", - SPDX = "CDDL-1.1", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CDDL-1.1.html#licenseText" - }, - new - { - Id = 98, - Name = "Community Data License Agreement Permissive 1.0", - SPDX = "CDLA-Permissive-1.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CDLA-Permissive-1.0.html#licenseText" - }, - new - { - Id = 99, - Name = "Community Data License Agreement Sharing 1.0", - SPDX = "CDLA-Sharing-1.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CDLA-Sharing-1.0.html#licenseText" - }, - new - { - Id = 100, - Name = "CeCILL Free Software License Agreement v1.0", - SPDX = "CECILL-1.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CECILL-1.0.html#licenseText" - }, - new - { - Id = 101, - Name = "CeCILL Free Software License Agreement v1.1", - SPDX = "CECILL-1.1", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CECILL-1.1.html#licenseText" - }, - new - { - Id = 102, - Name = "CeCILL Free Software License Agreement v2.0", - SPDX = "CECILL-2.0", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/CECILL-2.0.html#licenseText" - }, - new - { - Id = 103, - Name = "CeCILL Free Software License Agreement v2.1", - SPDX = "CECILL-2.1", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/CECILL-2.1.html#licenseText" - }, - new - { - Id = 104, - Name = "CeCILL-B Free Software License Agreement", - SPDX = "CECILL-B", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/CECILL-B.html#licenseText" - }, - new - { - Id = 105, - Name = "CeCILL-C Free Software License Agreement", - SPDX = "CECILL-C", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/CECILL-C.html#licenseText" - }, - new - { - Id = 106, - Name = "CERN Open Hardware License v1.1", - SPDX = "CERN-OHL-1.1", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CERN-OHL-1.1.html#licenseText" - }, - new - { - Id = 107, - Name = "CERN Open Hardware Licence v1.2", - SPDX = "CERN-OHL-1.2", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CERN-OHL-1.2.html#licenseText" - }, - new - { - Id = 108, - Name = "Clarified Artistic License", - SPDX = "ClArtistic", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/ClArtistic.html#licenseText" - }, - new - { - Id = 109, - Name = "CNRI Jython License", - SPDX = "CNRI-Jython", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CNRI-Jython.html#licenseText" - }, - new - { - Id = 110, - Name = "CNRI Python License", - SPDX = "CNRI-Python", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/CNRI-Python.html#licenseText" - }, - new - { - Id = 111, - Name = "CNRI Python Open Source GPL Compatible License Agreement", - SPDX = "CNRI-Python-GPL-Compatible", - FsfApproved = false, - OsiApproved = false, - Link = - "https://spdx.org/licenses/CNRI-Python-GPL-Compatible.html#licenseText" - }, - new - { - Id = 112, - Name = "Condor Public License v1.1", - SPDX = "Condor-1.1", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/Condor-1.1.html#licenseText" - }, - new - { - Id = 113, - Name = "copyleft-next 0.3.0", - SPDX = "copyleft-next-0.3.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/copyleft-next-0.3.0.html#licenseText" - }, - new - { - Id = 114, - Name = "copyleft-next 0.3.1", - SPDX = "copyleft-next-0.3.1", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/copyleft-next-0.3.1.html#licenseText" - }, - new - { - Id = 115, - Name = "Common Public Attribution License 1.0", - SPDX = "CPAL-1.0", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/CPAL-1.0.html#licenseText" - }, - new - { - Id = 116, - Name = "Common Public License 1.0", - SPDX = "CPL-1.0", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/CPL-1.0.html#licenseText" - }, - new - { - Id = 117, - Name = "Code Project Open License 1.02", - SPDX = "CPOL-1.02", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CPOL-1.02.html#licenseText" - }, - new - { - Id = 118, - Name = "Crossword License", - SPDX = "Crossword", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Crossword.html#licenseText" - }, - new - { - Id = 119, - Name = "CrystalStacker License", - SPDX = "CrystalStacker", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/CrystalStacker.html#licenseText" - }, - new - { - Id = 120, - Name = "CUA Office Public License v1.0", - SPDX = "CUA-OPL-1.0", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/CUA-OPL-1.0.html#licenseText" - }, new - { - Id = 121, - Name = "Cube License", - SPDX = "Cube", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Cube.html#licenseText" - }, new - { - Id = 122, - Name = "curl License", - SPDX = "curl", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/curl.html#licenseText" - }, - new - { - Id = 123, - Name = "Deutsche Freie Software Lizenz", - SPDX = "D-FSL-1.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/D-FSL-1.0.html#licenseText" - }, - new - { - Id = 124, - Name = "diffmark license", - SPDX = "diffmark", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/diffmark.html#licenseText" - }, new - { - Id = 125, - Name = "DOC License", - SPDX = "DOC", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/DOC.html#licenseText" - }, new - { - Id = 126, - Name = "Dotseqn License", - SPDX = "Dotseqn", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Dotseqn.html#licenseText" - }, new - { - Id = 127, - Name = "DSDP License", - SPDX = "DSDP", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/DSDP.html#licenseText" - }, new - { - Id = 128, - Name = "dvipdfm License", - SPDX = "dvipdfm", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/dvipdfm.html#licenseText" - }, - new - { - Id = 129, - Name = "Educational Community License v1.0", - SPDX = "ECL-1.0", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/ECL-1.0.html#licenseText" - }, - new - { - Id = 130, - Name = "Educational Community License v2.0", - SPDX = "ECL-2.0", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/ECL-2.0.html#licenseText" - }, - new - { - Id = 131, - Name = "Eiffel Forum License v1.0", - SPDX = "EFL-1.0", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/EFL-1.0.html#licenseText" - }, - new - { - Id = 132, - Name = "Eiffel Forum License v2.0", - SPDX = "EFL-2.0", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/EFL-2.0.html#licenseText" - }, - new - { - Id = 133, - Name = "eGenix.com Public License 1.1.0", - SPDX = "eGenix", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/eGenix.html#licenseText" - }, - new - { - Id = 134, - Name = "Entessa Public License v1.0", - SPDX = "Entessa", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/Entessa.html#licenseText" - }, - new - { - Id = 135, - Name = "Eclipse Public License 1.0", - SPDX = "EPL-1.0", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/EPL-1.0.html#licenseText" - }, - new - { - Id = 136, - Name = "Eclipse Public License 2.0", - SPDX = "EPL-2.0", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/EPL-2.0.html#licenseText" - }, - new - { - Id = 137, - Name = "Erlang Public License v1.1", - SPDX = "ErlPL-1.1", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/ErlPL-1.1.html#licenseText" - }, - new - { - Id = 138, - Name = "EU DataGrid Software License", - SPDX = "EUDatagrid", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/EUDatagrid.html#licenseText" - }, - new - { - Id = 139, - Name = "European Union Public License 1.0", - SPDX = "EUPL-1.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/EUPL-1.0.html#licenseText" - }, - new - { - Id = 140, - Name = "European Union Public License 1.1", - SPDX = "EUPL-1.1", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/EUPL-1.1.html#licenseText" - }, - new - { - Id = 141, - Name = "European Union Public License 1.2", - SPDX = "EUPL-1.2", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/EUPL-1.2.html#licenseText" - }, new - { - Id = 142, - Name = "Eurosym License", - SPDX = "Eurosym", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Eurosym.html#licenseText" - }, new - { - Id = 143, - Name = "Fair License", - SPDX = "Fair", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/Fair.html#licenseText" - }, - new - { - Id = 144, - Name = "Frameworx Open License 1.0", - SPDX = "Frameworx-1.0", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/Frameworx-1.0.html#licenseText" - }, - new - { - Id = 145, - Name = "FreeImage Public License v1.0", - SPDX = "FreeImage", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/FreeImage.html#licenseText" - }, - new - { - Id = 146, - Name = "FSF All Permissive License", - SPDX = "FSFAP", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/FSFAP.html#licenseText" - }, new - { - Id = 147, - Name = "FSF Unlimited License", - SPDX = "FSFUL", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/FSFUL.html#licenseText" - }, - new - { - Id = 148, - Name = "FSF Unlimited License (with License Retention)", - SPDX = "FSFULLR", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/FSFULLR.html#licenseText" - }, - new - { - Id = 149, - Name = "Freetype Project License", - SPDX = "FTL", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/FTL.html#licenseText" - }, - new - { - Id = 150, - Name = "GNU Free Documentation License v1.1 only", - SPDX = "GFDL-1.1-only", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/GFDL-1.1-only.html#licenseText" - }, - new - { - Id = 151, - Name = "GNU Free Documentation License v1.1 or later", - SPDX = "GFDL-1.1-or-later", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/GFDL-1.1-or-later.html#licenseText" - }, - new - { - Id = 152, - Name = "GNU Free Documentation License v1.2 only", - SPDX = "GFDL-1.2-only", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/GFDL-1.2-only.html#licenseText" - }, - new - { - Id = 153, - Name = "GNU Free Documentation License v1.2 or later", - SPDX = "GFDL-1.2-or-later", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/GFDL-1.2-or-later.html#licenseText" - }, - new - { - Id = 154, - Name = "GNU Free Documentation License v1.3 only", - SPDX = "GFDL-1.3-only", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/GFDL-1.3-only.html#licenseText" - }, - new - { - Id = 155, - Name = "GNU Free Documentation License v1.3 or later", - SPDX = "GFDL-1.3-or-later", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/GFDL-1.3-or-later.html#licenseText" - }, - new - { - Id = 156, - Name = "Giftware License", - SPDX = "Giftware", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Giftware.html#licenseText" - }, new - { - Id = 157, - Name = "GL2PS License", - SPDX = "GL2PS", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/GL2PS.html#licenseText" - }, new - { - Id = 158, - Name = "3dfx Glide License", - SPDX = "Glide", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Glide.html#licenseText" - }, new - { - Id = 159, - Name = "Glulxe License", - SPDX = "Glulxe", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Glulxe.html#licenseText" - }, new - { - Id = 160, - Name = "gnuplot License", - SPDX = "gnuplot", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/gnuplot.html#licenseText" - }, - new - { - Id = 161, - Name = "GNU General Public License v1.0 only", - SPDX = "GPL-1.0-only", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/GPL-1.0-only.html#licenseText" - }, - new - { - Id = 162, - Name = "GNU General Public License v1.0 or later", - SPDX = "GPL-1.0-or-later", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/GPL-1.0-or-later.html#licenseText" - }, - new - { - Id = 163, - Name = "GNU General Public License v2.0 only", - SPDX = "GPL-2.0-only", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/GPL-2.0-only.html#licenseText" - }, - new - { - Id = 164, - Name = "GNU General Public License v2.0 or later", - SPDX = "GPL-2.0-or-later", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/GPL-2.0-or-later.html#licenseText" - }, - new - { - Id = 165, - Name = "GNU General Public License v3.0 only", - SPDX = "GPL-3.0-only", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/GPL-3.0-only.html#licenseText" - }, - new - { - Id = 166, - Name = "GNU General Public License v3.0 or later", - SPDX = "GPL-3.0-or-later", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/GPL-3.0-or-later.html#licenseText" - }, - new - { - Id = 167, - Name = "gSOAP Public License v1.3b", - SPDX = "gSOAP-1.3b", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/gSOAP-1.3b.html#licenseText" - }, - new - { - Id = 168, - Name = "Haskell Language Report License", - SPDX = "HaskellReport", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/HaskellReport.html#licenseText" - }, - new - { - Id = 169, - Name = "Historical Permission Notice and Disclaimer", - SPDX = "HPND", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/HPND.html#licenseText" - }, - new - { - Id = 170, - Name = "Historical Permission Notice and Disclaimer - sell variant", - SPDX = "HPND-sell-variant", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/HPND-sell-variant.html#licenseText" - }, - new - { - Id = 171, - Name = "IBM PowerPC Initialization and Boot Software", - SPDX = "IBM-pibs", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/IBM-pibs.html#licenseText" - }, new - { - Id = 172, - Name = "ICU License", - SPDX = "ICU", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/ICU.html#licenseText" - }, - new - { - Id = 173, - Name = "Independent JPEG Group License", - SPDX = "IJG", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/IJG.html#licenseText" - }, - new - { - Id = 174, - Name = "ImageMagick License", - SPDX = "ImageMagick", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/ImageMagick.html#licenseText" - }, - new - { - Id = 175, - Name = "iMatix Standard Function Library Agreement", - SPDX = "iMatix", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/iMatix.html#licenseText" - }, new - { - Id = 176, - Name = "Imlib2 License", - SPDX = "Imlib2", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/Imlib2.html#licenseText" - }, new - { - Id = 177, - Name = "Info-ZIP License", - SPDX = "Info-ZIP", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Info-ZIP.html#licenseText" - }, - new - { - Id = 178, - Name = "Intel Open Source License", - SPDX = "Intel", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/Intel.html#licenseText" - }, - new - { - Id = 179, - Name = "Intel ACPI Software License Agreement", - SPDX = "Intel-ACPI", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Intel-ACPI.html#licenseText" - }, - new - { - Id = 180, - Name = "Interbase Public License v1.0", - SPDX = "Interbase-1.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Interbase-1.0.html#licenseText" - }, new - { - Id = 181, - Name = "IPA Font License", - SPDX = "IPA", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/IPA.html#licenseText" - }, - new - { - Id = 182, - Name = "IBM Public License v1.0", - SPDX = "IPL-1.0", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/IPL-1.0.html#licenseText" - }, new - { - Id = 183, - Name = "ISC License", - SPDX = "ISC", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/ISC.html#licenseText" - }, new - { - Id = 184, - Name = "JasPer License", - SPDX = "JasPer-2.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/JasPer-2.0.html#licenseText" - }, - new - { - Id = 185, - Name = "Japan Network Information Center License", - SPDX = "JPNIC", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/JPNIC.html#licenseText" - }, new - { - Id = 186, - Name = "JSON License", - SPDX = "JSON", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/JSON.html#licenseText" - }, - new - { - Id = 187, - Name = "Licence Art Libre 1.2", - SPDX = "LAL-1.2", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/LAL-1.2.html#licenseText" - }, - new - { - Id = 188, - Name = "Licence Art Libre 1.3", - SPDX = "LAL-1.3", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/LAL-1.3.html#licenseText" - }, new - { - Id = 189, - Name = "Latex2e License", - SPDX = "Latex2e", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Latex2e.html#licenseText" - }, new - { - Id = 190, - Name = "Leptonica License", - SPDX = "Leptonica", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Leptonica.html#licenseText" - }, - new - { - Id = 191, - Name = "GNU Library General Public License v2 only", - SPDX = "LGPL-2.0-only", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/LGPL-2.0-only.html#licenseText" - }, - new - { - Id = 192, - Name = "GNU Library General Public License v2 or later", - SPDX = "LGPL-2.0-or-later", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/LGPL-2.0-or-later.html#licenseText" - }, - new - { - Id = 193, - Name = "GNU Lesser General Public License v2.1 only", - SPDX = "LGPL-2.1-only", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/LGPL-2.1-only.html#licenseText" - }, - new - { - Id = 194, - Name = "GNU Lesser General Public License v2.1 or later", - SPDX = "LGPL-2.1-or-later", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/LGPL-2.1-or-later.html#licenseText" - }, - new - { - Id = 195, - Name = "GNU Lesser General Public License v3.0 only", - SPDX = "LGPL-3.0-only", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/LGPL-3.0-only.html#licenseText" - }, - new - { - Id = 196, - Name = "GNU Lesser General Public License v3.0 or later", - SPDX = "LGPL-3.0-or-later", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/LGPL-3.0-or-later.html#licenseText" - }, - new - { - Id = 197, - Name = "Lesser General Public License For Linguistic Resources", - SPDX = "LGPLLR", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/LGPLLR.html#licenseText" - }, new - { - Id = 198, - Name = "libpng License", - SPDX = "Libpng", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Libpng.html#licenseText" - }, - new - { - Id = 199, - Name = "PNG Reference Library version 2", - SPDX = "libpng-2.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/libpng-2.0.html#licenseText" - }, new - { - Id = 200, - Name = "libtiff License", - SPDX = "libtiff", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/libtiff.html#licenseText" - }, - new - { - Id = 201, - Name = "Licence Libre du Québec – Permissive version 1.1", - SPDX = "LiLiQ-P-1.1", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/LiLiQ-P-1.1.html#licenseText" - }, - new - { - Id = 202, - Name = "Licence Libre du Québec – Réciprocité version 1.1", - SPDX = "LiLiQ-R-1.1", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/LiLiQ-R-1.1.html#licenseText" - }, - new - { - Id = 203, - Name = "Licence Libre du Québec – Réciprocité forte version 1.1", - SPDX = "LiLiQ-Rplus-1.1", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/LiLiQ-Rplus-1.1.html#licenseText" - }, - new - { - Id = 204, - Name = "Linux Kernel Variant of OpenIB.org license", - SPDX = "Linux-OpenIB", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Linux-OpenIB.html#licenseText" - }, - new - { - Id = 205, - Name = "Lucent Public License Version 1.0", - SPDX = "LPL-1.0", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/LPL-1.0.html#licenseText" - }, - new - { - Id = 206, - Name = "Lucent Public License v1.02", - SPDX = "LPL-1.02", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/LPL-1.02.html#licenseText" - }, - new - { - Id = 207, - Name = "LaTeX Project Public License v1.0", - SPDX = "LPPL-1.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/LPPL-1.0.html#licenseText" - }, - new - { - Id = 208, - Name = "LaTeX Project Public License v1.1", - SPDX = "LPPL-1.1", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/LPPL-1.1.html#licenseText" - }, - new - { - Id = 209, - Name = "LaTeX Project Public License v1.2", - SPDX = "LPPL-1.2", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/LPPL-1.2.html#licenseText" - }, - new - { - Id = 210, - Name = "LaTeX Project Public License v1.3a", - SPDX = "LPPL-1.3a", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/LPPL-1.3a.html#licenseText" - }, - new - { - Id = 211, - Name = "LaTeX Project Public License v1.3c", - SPDX = "LPPL-1.3c", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/LPPL-1.3c.html#licenseText" - }, - new - { - Id = 212, - Name = "MakeIndex License", - SPDX = "MakeIndex", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/MakeIndex.html#licenseText" - }, new - { - Id = 213, - Name = "MirOS License", - SPDX = "MirOS", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/MirOS.html#licenseText" - }, new - { - Id = 214, - Name = "MIT License", - SPDX = "MIT", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/MIT.html#licenseText" - }, new - { - Id = 215, - Name = "MIT No Attribution", - SPDX = "MIT-0", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/MIT-0.html#licenseText" - }, - new - { - Id = 216, - Name = "Enlightenment License (e16)", - SPDX = "MIT-advertising", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/MIT-advertising.html#licenseText" - }, new - { - Id = 217, - Name = "CMU License", - SPDX = "MIT-CMU", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/MIT-CMU.html#licenseText" - }, new - { - Id = 218, - Name = "enna License", - SPDX = "MIT-enna", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/MIT-enna.html#licenseText" - }, new - { - Id = 219, - Name = "feh License", - SPDX = "MIT-feh", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/MIT-feh.html#licenseText" - }, - new - { - Id = 220, - Name = "MIT +no-false-attribs license", - SPDX = "MITNFA", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/MITNFA.html#licenseText" - }, - new - { - Id = 221, - Name = "Motosoto License", - SPDX = "Motosoto", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/Motosoto.html#licenseText" - }, new - { - Id = 222, - Name = "mpich2 License", - SPDX = "mpich2", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/mpich2.html#licenseText" - }, - new - { - Id = 223, - Name = "Mozilla Public License 1.0", - SPDX = "MPL-1.0", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/MPL-1.0.html#licenseText" - }, - new - { - Id = 224, - Name = "Mozilla Public License 1.1", - SPDX = "MPL-1.1", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/MPL-1.1.html#licenseText" - }, - new - { - Id = 225, - Name = "Mozilla Public License 2.0", - SPDX = "MPL-2.0", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/MPL-2.0.html#licenseText" - }, - new - { - Id = 226, - Name = "Mozilla Public License 2.0 (no copyleft exception)", - SPDX = "MPL-2.0-no-copyleft-exception", - FsfApproved = false, - OsiApproved = true, - Link = - "https://spdx.org/licenses/MPL-2.0-no-copyleft-exception.html#licenseText" - }, - new - { - Id = 227, - Name = "Microsoft Public License", - SPDX = "MS-PL", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/MS-PL.html#licenseText" - }, - new - { - Id = 228, - Name = "Microsoft Reciprocal License", - SPDX = "MS-RL", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/MS-RL.html#licenseText" - }, - new - { - Id = 229, - Name = "Matrix Template Library License", - SPDX = "MTLL", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/MTLL.html#licenseText" - }, new - { - Id = 230, - Name = "Multics License", - SPDX = "Multics", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/Multics.html#licenseText" - }, new - { - Id = 231, - Name = "Mup License", - SPDX = "Mup", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Mup.html#licenseText" - }, - new - { - Id = 232, - Name = "NASA Open Source Agreement 1.3", - SPDX = "NASA-1.3", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/NASA-1.3.html#licenseText" - }, - new - { - Id = 233, - Name = "Naumen Public License", - SPDX = "Naumen", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/Naumen.html#licenseText" - }, - new - { - Id = 234, - Name = "Net Boolean Public License v1", - SPDX = "NBPL-1.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/NBPL-1.0.html#licenseText" - }, - new - { - Id = 235, - Name = "University of Illinois/NCSA Open Source License", - SPDX = "NCSA", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/NCSA.html#licenseText" - }, - new - { - Id = 236, - Name = "Net-SNMP License", - SPDX = "Net-SNMP", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Net-SNMP.html#licenseText" - }, new - { - Id = 237, - Name = "NetCDF license", - SPDX = "NetCDF", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/NetCDF.html#licenseText" - }, new - { - Id = 238, - Name = "Newsletr License", - SPDX = "Newsletr", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Newsletr.html#licenseText" - }, - new - { - Id = 239, - Name = "Nethack General Public License", - SPDX = "NGPL", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/NGPL.html#licenseText" - }, - new - { - Id = 240, - Name = "Norwegian Licence for Open Government Data", - SPDX = "NLOD-1.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/NLOD-1.0.html#licenseText" - }, - new - { - Id = 241, - Name = "No Limit Public License", - SPDX = "NLPL", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/NLPL.html#licenseText" - }, - new - { - Id = 242, - Name = "Nokia Open Source License", - SPDX = "Nokia", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/Nokia.html#licenseText" - }, - new - { - Id = 243, - Name = "Netizen Open Source License", - SPDX = "NOSL", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/NOSL.html#licenseText" - }, new - { - Id = 244, - Name = "Noweb License", - SPDX = "Noweb", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Noweb.html#licenseText" - }, - new - { - Id = 245, - Name = "Netscape Public License v1.0", - SPDX = "NPL-1.0", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/NPL-1.0.html#licenseText" - }, - new - { - Id = 246, - Name = "Netscape Public License v1.1", - SPDX = "NPL-1.1", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/NPL-1.1.html#licenseText" - }, - new - { - Id = 247, - Name = "Non-Profit Open Software License 3.0", - SPDX = "NPOSL-3.0", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/NPOSL-3.0.html#licenseText" - }, new - { - Id = 248, - Name = "NRL License", - SPDX = "NRL", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/NRL.html#licenseText" - }, new - { - Id = 249, - Name = "NTP License", - SPDX = "NTP", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/NTP.html#licenseText" - }, - new - { - Id = 250, - Name = "Open CASCADE Technology Public License", - SPDX = "OCCT-PL", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/OCCT-PL.html#licenseText" - }, - new - { - Id = 251, - Name = "OCLC Research Public License 2.0", - SPDX = "OCLC-2.0", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/OCLC-2.0.html#licenseText" - }, - new - { - Id = 252, - Name = "ODC Open Database License v1.0", - SPDX = "ODbL-1.0", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/ODbL-1.0.html#licenseText" - }, - new - { - Id = 253, - Name = "Open Data Commons Attribution License v1.0", - SPDX = "ODC-By-1.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/ODC-By-1.0.html#licenseText" - }, - new - { - Id = 254, - Name = "SIL Open Font License 1.0", - SPDX = "OFL-1.0", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/OFL-1.0.html#licenseText" - }, - new - { - Id = 255, - Name = "SIL Open Font License 1.1", - SPDX = "OFL-1.1", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/OFL-1.1.html#licenseText" - }, - new - { - Id = 256, - Name = "Open Government Licence v1.0", - SPDX = "OGL-UK-1.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/OGL-UK-1.0.html#licenseText" - }, - new - { - Id = 257, - Name = "Open Government Licence v2.0", - SPDX = "OGL-UK-2.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/OGL-UK-2.0.html#licenseText" - }, - new - { - Id = 258, - Name = "Open Government Licence v3.0", - SPDX = "OGL-UK-3.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/OGL-UK-3.0.html#licenseText" - }, - new - { - Id = 259, - Name = "Open Group Test Suite License", - SPDX = "OGTSL", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/OGTSL.html#licenseText" - }, - new - { - Id = 260, - Name = "Open LDAP Public License v1.1", - SPDX = "OLDAP-1.1", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/OLDAP-1.1.html#licenseText" - }, - new - { - Id = 261, - Name = "Open LDAP Public License v1.2", - SPDX = "OLDAP-1.2", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/OLDAP-1.2.html#licenseText" - }, - new - { - Id = 262, - Name = "Open LDAP Public License v1.3", - SPDX = "OLDAP-1.3", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/OLDAP-1.3.html#licenseText" - }, - new - { - Id = 263, - Name = "Open LDAP Public License v1.4", - SPDX = "OLDAP-1.4", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/OLDAP-1.4.html#licenseText" - }, - new - { - Id = 264, - Name = "Open LDAP Public License v2.0 (or possibly 2.0A and 2.0B)", - SPDX = "OLDAP-2.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/OLDAP-2.0.html#licenseText" - }, - new - { - Id = 265, - Name = "Open LDAP Public License v2.0.1", - SPDX = "OLDAP-2.0.1", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/OLDAP-2.0.1.html#licenseText" - }, - new - { - Id = 266, - Name = "Open LDAP Public License v2.1", - SPDX = "OLDAP-2.1", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/OLDAP-2.1.html#licenseText" - }, - new - { - Id = 267, - Name = "Open LDAP Public License v2.2", - SPDX = "OLDAP-2.2", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/OLDAP-2.2.html#licenseText" - }, - new - { - Id = 268, - Name = "Open LDAP Public License v2.2.1", - SPDX = "OLDAP-2.2.1", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/OLDAP-2.2.1.html#licenseText" - }, - new - { - Id = 269, - Name = "Open LDAP Public License 2.2.2", - SPDX = "OLDAP-2.2.2", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/OLDAP-2.2.2.html#licenseText" - }, - new - { - Id = 270, - Name = "Open LDAP Public License v2.3", - SPDX = "OLDAP-2.3", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/OLDAP-2.3.html#licenseText" - }, - new - { - Id = 271, - Name = "Open LDAP Public License v2.4", - SPDX = "OLDAP-2.4", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/OLDAP-2.4.html#licenseText" - }, - new - { - Id = 272, - Name = "Open LDAP Public License v2.5", - SPDX = "OLDAP-2.5", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/OLDAP-2.5.html#licenseText" - }, - new - { - Id = 273, - Name = "Open LDAP Public License v2.6", - SPDX = "OLDAP-2.6", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/OLDAP-2.6.html#licenseText" - }, - new - { - Id = 274, - Name = "Open LDAP Public License v2.7", - SPDX = "OLDAP-2.7", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/OLDAP-2.7.html#licenseText" - }, - new - { - Id = 275, - Name = "Open LDAP Public License v2.8", - SPDX = "OLDAP-2.8", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/OLDAP-2.8.html#licenseText" - }, new - { - Id = 276, - Name = "Open Market License", - SPDX = "OML", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/OML.html#licenseText" - }, new - { - Id = 277, - Name = "OpenSSL License", - SPDX = "OpenSSL", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/OpenSSL.html#licenseText" - }, - new - { - Id = 278, - Name = "Open Public License v1.0", - SPDX = "OPL-1.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/OPL-1.0.html#licenseText" - }, - new - { - Id = 279, - Name = "OSET Public License version 2.1", - SPDX = "OSET-PL-2.1", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/OSET-PL-2.1.html#licenseText" - }, - new - { - Id = 280, - Name = "Open Software License 1.0", - SPDX = "OSL-1.0", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/OSL-1.0.html#licenseText" - }, - new - { - Id = 281, - Name = "Open Software License 1.1", - SPDX = "OSL-1.1", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/OSL-1.1.html#licenseText" - }, - new - { - Id = 282, - Name = "Open Software License 2.0", - SPDX = "OSL-2.0", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/OSL-2.0.html#licenseText" - }, - new - { - Id = 283, - Name = "Open Software License 2.1", - SPDX = "OSL-2.1", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/OSL-2.1.html#licenseText" - }, - new - { - Id = 284, - Name = "Open Software License 3.0", - SPDX = "OSL-3.0", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/OSL-3.0.html#licenseText" - }, - new - { - Id = 285, - Name = "ODC Public Domain Dedication & License 1.0", - SPDX = "PDDL-1.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/PDDL-1.0.html#licenseText" - }, new - { - Id = 286, - Name = "PHP License v3.0", - SPDX = "PHP-3.0", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/PHP-3.0.html#licenseText" - }, new - { - Id = 287, - Name = "PHP License v3.01", - SPDX = "PHP-3.01", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/PHP-3.01.html#licenseText" - }, - new - { - Id = 288, - Name = "Plexus Classworlds License", - SPDX = "Plexus", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Plexus.html#licenseText" - }, - new - { - Id = 289, - Name = "PostgreSQL License", - SPDX = "PostgreSQL", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/PostgreSQL.html#licenseText" - }, new - { - Id = 290, - Name = "psfrag License", - SPDX = "psfrag", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/psfrag.html#licenseText" - }, new - { - Id = 291, - Name = "psutils License", - SPDX = "psutils", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/psutils.html#licenseText" - }, new - { - Id = 292, - Name = "Python License 2.0", - SPDX = "Python-2.0", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/Python-2.0.html#licenseText" - }, new - { - Id = 293, - Name = "Qhull License", - SPDX = "Qhull", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Qhull.html#licenseText" - }, new - { - Id = 294, - Name = "Q Public License 1.0", - SPDX = "QPL-1.0", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/QPL-1.0.html#licenseText" - }, new - { - Id = 295, - Name = "Rdisc License", - SPDX = "Rdisc", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Rdisc.html#licenseText" - }, - new - { - Id = 296, - Name = "Red Hat eCos Public License v1.1", - SPDX = "RHeCos-1.1", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/RHeCos-1.1.html#licenseText" - }, - new - { - Id = 297, - Name = "Reciprocal Public License 1.1", - SPDX = "RPL-1.1", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/RPL-1.1.html#licenseText" - }, - new - { - Id = 298, - Name = "Reciprocal Public License 1.5", - SPDX = "RPL-1.5", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/RPL-1.5.html#licenseText" - }, - new - { - Id = 299, - Name = "RealNetworks Public Source License v1.0", - SPDX = "RPSL-1.0", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/RPSL-1.0.html#licenseText" - }, - new - { - Id = 300, - Name = "RSA Message-Digest License", - SPDX = "RSA-MD", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/RSA-MD.html#licenseText" - }, - new - { - Id = 301, - Name = "Ricoh Source Code Public License", - SPDX = "RSCPL", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/RSCPL.html#licenseText" - }, new - { - Id = 302, - Name = "Ruby License", - SPDX = "Ruby", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/Ruby.html#licenseText" - }, - new - { - Id = 303, - Name = "Sax Public Domain Notice", - SPDX = "SAX-PD", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/SAX-PD.html#licenseText" - }, new - { - Id = 304, - Name = "Saxpath License", - SPDX = "Saxpath", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Saxpath.html#licenseText" - }, - new - { - Id = 305, - Name = "SCEA Shared Source License", - SPDX = "SCEA", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/SCEA.html#licenseText" - }, new - { - Id = 306, - Name = "Sendmail License", - SPDX = "Sendmail", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Sendmail.html#licenseText" - }, - new - { - Id = 307, - Name = "Sendmail License 8.23", - SPDX = "Sendmail-8.23", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Sendmail-8.23.html#licenseText" - }, - new - { - Id = 308, - Name = "SGI Free Software License B v1.0", - SPDX = "SGI-B-1.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/SGI-B-1.0.html#licenseText" - }, - new - { - Id = 309, - Name = "SGI Free Software License B v1.1", - SPDX = "SGI-B-1.1", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/SGI-B-1.1.html#licenseText" - }, - new - { - Id = 310, - Name = "SGI Free Software License B v2.0", - SPDX = "SGI-B-2.0", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/SGI-B-2.0.html#licenseText" - }, - new - { - Id = 311, - Name = "Simple Public License 2.0", - SPDX = "SimPL-2.0", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/SimPL-2.0.html#licenseText" - }, - new - { - Id = 312, - Name = "Sun Industry Standards Source License v1.1", - SPDX = "SISSL", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/SISSL.html#licenseText" - }, - new - { - Id = 313, - Name = "Sun Industry Standards Source License v1.2", - SPDX = "SISSL-1.2", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/SISSL-1.2.html#licenseText" - }, - new - { - Id = 314, - Name = "Sleepycat License", - SPDX = "Sleepycat", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/Sleepycat.html#licenseText" - }, - new - { - Id = 315, - Name = "Standard ML of New Jersey License", - SPDX = "SMLNJ", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/SMLNJ.html#licenseText" - }, - new - { - Id = 316, - Name = "Secure Messaging Protocol Public License", - SPDX = "SMPPL", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/SMPPL.html#licenseText" - }, - new - { - Id = 317, - Name = "SNIA Public License 1.1", - SPDX = "SNIA", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/SNIA.html#licenseText" - }, - new - { - Id = 318, - Name = "Spencer License 86", - SPDX = "Spencer-86", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Spencer-86.html#licenseText" - }, - new - { - Id = 319, - Name = "Spencer License 94", - SPDX = "Spencer-94", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Spencer-94.html#licenseText" - }, - new - { - Id = 320, - Name = "Spencer License 99", - SPDX = "Spencer-99", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Spencer-99.html#licenseText" - }, - new - { - Id = 321, - Name = "Sun Public License v1.0", - SPDX = "SPL-1.0", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/SPL-1.0.html#licenseText" - }, - new - { - Id = 322, - Name = "SugarCRM Public License v1.1.3", - SPDX = "SugarCRM-1.1.3", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/SugarCRM-1.1.3.html#licenseText" - }, - new - { - Id = 323, - Name = "Scheme Widget Library (SWL) Software License Agreement", - SPDX = "SWL", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/SWL.html#licenseText" - }, - new - { - Id = 324, - Name = "TAPR Open Hardware License v1.0", - SPDX = "TAPR-OHL-1.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/TAPR-OHL-1.0.html#licenseText" - }, new - { - Id = 325, - Name = "TCL/TK License", - SPDX = "TCL", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/TCL.html#licenseText" - }, - new - { - Id = 326, - Name = "TCP Wrappers License", - SPDX = "TCP-wrappers", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/TCP-wrappers.html#licenseText" - }, - new - { - Id = 327, - Name = "TMate Open Source License", - SPDX = "TMate", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/TMate.html#licenseText" - }, - new - { - Id = 328, - Name = "TORQUE v2.5+ Software License v1.1", - SPDX = "TORQUE-1.1", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/TORQUE-1.1.html#licenseText" - }, - new - { - Id = 329, - Name = "Trusster Open Source License", - SPDX = "TOSL", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/TOSL.html#licenseText" - }, - new - { - Id = 330, - Name = "Technische Universitaet Berlin License 1.0", - SPDX = "TU-Berlin-1.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/TU-Berlin-1.0.html#licenseText" - }, - new - { - Id = 331, - Name = "Technische Universitaet Berlin License 2.0", - SPDX = "TU-Berlin-2.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/TU-Berlin-2.0.html#licenseText" - }, - new - { - Id = 332, - Name = "Unicode License Agreement - Data Files and Software (2015)", - SPDX = "Unicode-DFS-2015", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Unicode-DFS-2015.html#licenseText" - }, - new - { - Id = 333, - Name = "Unicode License Agreement - Data Files and Software (2016)", - SPDX = "Unicode-DFS-2016", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Unicode-DFS-2016.html#licenseText" - }, - new - { - Id = 334, - Name = "Unicode Terms of Use", - SPDX = "Unicode-TOU", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Unicode-TOU.html#licenseText" - }, new - { - Id = 335, - Name = "The Unlicense", - SPDX = "Unlicense", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/Unlicense.html#licenseText" - }, - new - { - Id = 336, - Name = "Universal Permissive License v1.0", - SPDX = "UPL-1.0", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/UPL-1.0.html#licenseText" - }, new - { - Id = 337, - Name = "Vim License", - SPDX = "Vim", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/Vim.html#licenseText" - }, - new - { - Id = 338, - Name = "VOSTROM Public License for Open Source", - SPDX = "VOSTROM", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/VOSTROM.html#licenseText" - }, - new - { - Id = 339, - Name = "Vovida Software License v1.0", - SPDX = "VSL-1.0", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/VSL-1.0.html#licenseText" - }, - new - { - Id = 340, - Name = "W3C Software Notice and License (2002-12-31)", - SPDX = "W3C", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/W3C.html#licenseText" - }, - new - { - Id = 341, - Name = "W3C Software Notice and License (1998-07-20)", - SPDX = "W3C-19980720", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/W3C-19980720.html#licenseText" - }, - new - { - Id = 342, - Name = "W3C Software Notice and Document License (2015-05-13)", - SPDX = "W3C-20150513", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/W3C-20150513.html#licenseText" - }, - new - { - Id = 343, - Name = "Sybase Open Watcom Public License 1.0", - SPDX = "Watcom-1.0", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/Watcom-1.0.html#licenseText" - }, new - { - Id = 344, - Name = "Wsuipa License", - SPDX = "Wsuipa", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Wsuipa.html#licenseText" - }, - new - { - Id = 345, - Name = "Do What The F*ck You Want To Public License", - SPDX = "WTFPL", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/WTFPL.html#licenseText" - }, new - { - Id = 346, - Name = "X11 License", - SPDX = "X11", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/X11.html#licenseText" - }, new - { - Id = 347, - Name = "Xerox License", - SPDX = "Xerox", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Xerox.html#licenseText" - }, - new - { - Id = 348, - Name = "XFree86 License 1.1", - SPDX = "XFree86-1.1", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/XFree86-1.1.html#licenseText" - }, new - { - Id = 349, - Name = "xinetd License", - SPDX = "xinetd", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/xinetd.html#licenseText" - }, new - { - Id = 350, - Name = "X.Net License", - SPDX = "Xnet", - FsfApproved = false, - OsiApproved = true, - Link = "https://spdx.org/licenses/Xnet.html#licenseText" - }, new - { - Id = 351, - Name = "XPP License", - SPDX = "xpp", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/xpp.html#licenseText" - }, new - { - Id = 352, - Name = "XSkat License", - SPDX = "XSkat", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/XSkat.html#licenseText" - }, - new - { - Id = 353, - Name = "Yahoo! Public License v1.0", - SPDX = "YPL-1.0", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/YPL-1.0.html#licenseText" - }, - new - { - Id = 354, - Name = "Yahoo! Public License v1.1", - SPDX = "YPL-1.1", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/YPL-1.1.html#licenseText" - }, new - { - Id = 355, - Name = "Zed License", - SPDX = "Zed", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Zed.html#licenseText" - }, new - { - Id = 356, - Name = "Zend License v2.0", - SPDX = "Zend-2.0", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/Zend-2.0.html#licenseText" - }, - new - { - Id = 357, - Name = "Zimbra Public License v1.3", - SPDX = "Zimbra-1.3", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/Zimbra-1.3.html#licenseText" - }, - new - { - Id = 358, - Name = "Zimbra Public License v1.4", - SPDX = "Zimbra-1.4", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/Zimbra-1.4.html#licenseText" - }, new - { - Id = 359, - Name = "zlib License", - SPDX = "Zlib", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/Zlib.html#licenseText" - }, - new - { - Id = 360, - Name = "zlib/libpng License with Acknowledgement", - SPDX = "zlib-acknowledgement", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/zlib-acknowledgement.html#licenseText" - }, - new - { - Id = 361, - Name = "Zope Public License 1.1", - SPDX = "ZPL-1.1", - FsfApproved = false, - OsiApproved = false, - Link = "https://spdx.org/licenses/ZPL-1.1.html#licenseText" - }, - new - { - Id = 362, - Name = "Zope Public License 2.0", - SPDX = "ZPL-2.0", - FsfApproved = true, - OsiApproved = true, - Link = "https://spdx.org/licenses/ZPL-2.0.html#licenseText" - }, - new - { - Id = 363, - Name = "Zope Public License 2.1", - SPDX = "ZPL-2.1", - FsfApproved = true, - OsiApproved = false, - Link = "https://spdx.org/licenses/ZPL-2.1.html#licenseText" - }); - } + Id = 1, Name = "Fair use", FsfApproved = false, OsiApproved = false + }, new + { + Id = 2, Name = "Advertisement use", FsfApproved = false, OsiApproved = false + }, new + { + Id = 3, Name = "All rights reserved", FsfApproved = false, OsiApproved = false + }, new + { + Id = 4, Name = "BSD Zero Clause License", SPDX = "0BSD", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/0BSD.html#licenseText" + }, new + { + Id = 5, Name = "Attribution Assurance License", SPDX = "AAL", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/AAL.html#licenseText" + }, new + { + Id = 6, Name = "Abstyles License", SPDX = "Abstyles", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Abstyles.html#licenseText" + }, new + { + Id = 7, Name = "Adobe Systems Incorporated Source Code License Agreement", + SPDX = "Adobe-2006", + FsfApproved = false, OsiApproved = false, + Link = + "https://spdx.org/licenses/Adobe-2006.html#licenseText" + }, new + { + Id = 8, Name = "Adobe Glyph List License", SPDX = "Adobe-Glyph", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Adobe-Glyph.html#licenseText" + }, new + { + Id = 9, Name = "Amazon Digital Services License", SPDX = "ADSL", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/ADSL.html#licenseText" + }, new + { + Id = 10, Name = "Academic Free License v1.1", SPDX = "AFL-1.1", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/AFL-1.1.html#licenseText" + }, new + { + Id = 11, Name = "Academic Free License v1.2", SPDX = "AFL-1.2", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/AFL-1.2.html#licenseText" + }, new + { + Id = 12, Name = "Academic Free License v2.0", SPDX = "AFL-2.0", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/AFL-2.0.html#licenseText" + }, new + { + Id = 13, Name = "Academic Free License v2.1", SPDX = "AFL-2.1", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/AFL-2.1.html#licenseText" + }, new + { + Id = 14, Name = "Academic Free License v3.0", SPDX = "AFL-3.0", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/AFL-3.0.html#licenseText" + }, new + { + Id = 15, Name = "Afmparse License", SPDX = "Afmparse", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Afmparse.html#licenseText" + }, new + { + Id = 16, Name = "Affero General Public License v1.0 only", SPDX = "AGPL-1.0-only", + FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/AGPL-1.0-only.html#licenseText" + }, new + { + Id = 17, Name = "Affero General Public License v1.0 or later", + SPDX = "AGPL-1.0-or-later", + FsfApproved = false, OsiApproved = false, + Link = "https://spdx.org/licenses/AGPL-1.0-or-later.html#licenseText" + }, new + { + Id = 18, Name = "GNU Affero General Public License v3.0 only", SPDX = "AGPL-3.0-only", + FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/AGPL-3.0-only.html#licenseText" + }, new + { + Id = 19, Name = "GNU Affero General Public License v3.0 or later", + SPDX = "AGPL-3.0-or-later", + FsfApproved = true, OsiApproved = true, + Link = "https://spdx.org/licenses/AGPL-3.0-or-later.html#licenseText" + }, new + { + Id = 20, Name = "Aladdin Free Public License", SPDX = "Aladdin", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Aladdin.html#licenseText" + }, new + { + Id = 21, Name = "AMD's plpa_map.c License", SPDX = "AMDPLPA", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/AMDPLPA.html#licenseText" + }, new + { + Id = 22, Name = "Apple MIT License", SPDX = "AML", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/AML.html#licenseText" + }, new + { + Id = 23, Name = "Academy of Motion Picture Arts and Sciences BSD", SPDX = "AMPAS", + FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/AMPAS.html#licenseText" + }, new + { + Id = 24, Name = "ANTLR Software Rights Notice", SPDX = "ANTLR-PD", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/ANTLR-PD.html#licenseText" + }, new + { + Id = 25, Name = "Apache License 1.0", SPDX = "Apache-1.0", FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/Apache-1.0.html#licenseText" + }, new + { + Id = 26, Name = "Apache License 1.1", SPDX = "Apache-1.1", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/Apache-1.1.html#licenseText" + }, new + { + Id = 27, Name = "Apache License 2.0", SPDX = "Apache-2.0", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/Apache-2.0.html#licenseText" + }, new + { + Id = 28, Name = "Adobe Postscript AFM License", SPDX = "APAFML", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/APAFML.html#licenseText" + }, new + { + Id = 29, Name = "Adaptive Public License 1.0", SPDX = "APL-1.0", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/APL-1.0.html#licenseText" + }, new + { + Id = 30, Name = "Apple Public Source License 1.0", SPDX = "APSL-1.0", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/APSL-1.0.html#licenseText" + }, new + { + Id = 31, Name = "Apple Public Source License 1.1", SPDX = "APSL-1.1", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/APSL-1.1.html#licenseText" + }, new + { + Id = 32, Name = "Apple Public Source License 1.2", SPDX = "APSL-1.2", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/APSL-1.2.html#licenseText" + }, new + { + Id = 33, Name = "Apple Public Source License 2.0", SPDX = "APSL-2.0", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/APSL-2.0.html#licenseText" + }, new + { + Id = 34, Name = "Artistic License 1.0", SPDX = "Artistic-1.0", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/Artistic-1.0.html#licenseText" + }, new + { + Id = 35, Name = "Artistic License 1.0 w/clause 8", SPDX = "Artistic-1.0-cl8", + FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/Artistic-1.0-cl8.html#licenseText" + }, new + { + Id = 36, Name = "Artistic License 1.0 (Perl)", SPDX = "Artistic-1.0-Perl", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/Artistic-1.0-Perl.html#licenseText" + }, new + { + Id = 37, Name = "Artistic License 2.0", SPDX = "Artistic-2.0", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/Artistic-2.0.html#licenseText" + }, new + { + Id = 38, Name = "Bahyph License", SPDX = "Bahyph", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Bahyph.html#licenseText" + }, new + { + Id = 39, Name = "Barr License", SPDX = "Barr", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Barr.html#licenseText" + }, new + { + Id = 40, Name = "Beerware License", SPDX = "Beerware", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Beerware.html#licenseText" + }, new + { + Id = 41, Name = "BitTorrent Open Source License v1.0", SPDX = "BitTorrent-1.0", + FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/BitTorrent-1.0.html#licenseText" + }, new + { + Id = 42, Name = "BitTorrent Open Source License v1.1", SPDX = "BitTorrent-1.1", + FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/BitTorrent-1.1.html#licenseText" + }, new + { + Id = 43, Name = "Borceux license", SPDX = "Borceux", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Borceux.html#licenseText" + }, new + { + Id = 44, Name = "BSD 1-Clause License", SPDX = "BSD-1-Clause", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/BSD-1-Clause.html#licenseText" + }, new + { + Id = 45, Name = "BSD 2-Clause \"Simplified\" License", SPDX = "BSD-2-Clause", + FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/BSD-2-Clause.html#licenseText" + }, new + { + Id = 46, Name = "BSD 2-Clause FreeBSD License", SPDX = "BSD-2-Clause-FreeBSD", + FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/BSD-2-Clause-FreeBSD.html#licenseText" + }, new + { + Id = 47, Name = "BSD 2-Clause NetBSD License", SPDX = "BSD-2-Clause-NetBSD", + FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/BSD-2-Clause-NetBSD.html#licenseText" + }, new + { + Id = 48, Name = "BSD-2-Clause Plus Patent License", SPDX = "BSD-2-Clause-Patent", + FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/BSD-2-Clause-Patent.html#licenseText" + }, new + { + Id = 49, Name = "BSD 3-Clause \"New\" or \"Revised\" License", SPDX = "BSD-3-Clause", + FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/BSD-3-Clause.html#licenseText" + }, new + { + Id = 50, Name = "BSD with attribution", SPDX = "BSD-3-Clause-Attribution", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/BSD-3-Clause-Attribution.html#licenseText" + }, new + { + Id = 51, Name = "BSD 3-Clause Clear License", SPDX = "BSD-3-Clause-Clear", FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/BSD-3-Clause-Clear.html#licenseText" + }, new + { + Id = 52, Name = "Lawrence Berkeley National Labs BSD variant license", + SPDX = "BSD-3-Clause-LBNL", + FsfApproved = false, OsiApproved = false, + Link = "https://spdx.org/licenses/BSD-3-Clause-LBNL.html#licenseText" + }, new + { + Id = 53, Name = "BSD 3-Clause No Nuclear License", + SPDX = "BSD-3-Clause-No-Nuclear-License", + FsfApproved = false, OsiApproved = false, + Link = "https://spdx.org/licenses/BSD-3-Clause-No-Nuclear-License.html#licenseText" + }, new + { + Id = 54, Name = "BSD 3-Clause No Nuclear License 2014", + SPDX = "BSD-3-Clause-No-Nuclear-License-2014", + FsfApproved = false, OsiApproved = false, + Link = "https://spdx.org/licenses/BSD-3-Clause-No-Nuclear-License-2014.html#licenseText" + }, new + { + Id = 55, Name = "BSD 3-Clause No Nuclear Warranty", + SPDX = "BSD-3-Clause-No-Nuclear-Warranty", + FsfApproved = false, OsiApproved = false, + Link = "https://spdx.org/licenses/BSD-3-Clause-No-Nuclear-Warranty.html#licenseText" + }, new + { + Id = 56, Name = "BSD 4-Clause \"Original\" or \"Old\" License", SPDX = "BSD-4-Clause", + FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/BSD-4-Clause.html#licenseText" + }, new + { + Id = 57, Name = "BSD-4-Clause (University of California-Specific)", + SPDX = "BSD-4-Clause-UC", + FsfApproved = false, OsiApproved = false, + Link = "https://spdx.org/licenses/BSD-4-Clause-UC.html#licenseText" + }, new + { + Id = 58, Name = "BSD Protection License", SPDX = "BSD-Protection", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/BSD-Protection.html#licenseText" + }, new + { + Id = 59, Name = "BSD Source Code Attribution", SPDX = "BSD-Source-Code", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/BSD-Source-Code.html#licenseText" + }, new + { + Id = 60, Name = "Boost Software License 1.0", SPDX = "BSL-1.0", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/BSL-1.0.html#licenseText" + }, new + { + Id = 61, Name = "bzip2 and libbzip2 License v1.0.5", SPDX = "bzip2-1.0.5", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/bzip2-1.0.5.html#licenseText" + }, new + { + Id = 62, Name = "bzip2 and libbzip2 License v1.0.6", SPDX = "bzip2-1.0.6", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/bzip2-1.0.6.html#licenseText" + }, new + { + Id = 63, Name = "Caldera License", SPDX = "Caldera", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Caldera.html#licenseText" + }, new + { + Id = 64, Name = "Computer Associates Trusted Open Source License 1.1", + SPDX = "CATOSL-1.1", + FsfApproved = false, OsiApproved = true, + Link = + "https://spdx.org/licenses/CATOSL-1.1.html#licenseText" + }, new + { + Id = 65, Name = "Creative Commons Attribution 1.0 Generic", SPDX = "CC-BY-1.0", + FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/CC-BY-1.0.html#licenseText" + }, new + { + Id = 66, Name = "Creative Commons Attribution 2.0 Generic", SPDX = "CC-BY-2.0", + FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/CC-BY-2.0.html#licenseText" + }, new + { + Id = 67, Name = "Creative Commons Attribution 2.5 Generic", SPDX = "CC-BY-2.5", + FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/CC-BY-2.5.html#licenseText" + }, new + { + Id = 68, Name = "Creative Commons Attribution 3.0 Unported", SPDX = "CC-BY-3.0", + FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/CC-BY-3.0.html#licenseText" + }, new + { + Id = 69, Name = "Creative Commons Attribution 4.0 International", SPDX = "CC-BY-4.0", + FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/CC-BY-4.0.html#licenseText" + }, new + { + Id = 70, Name = "Creative Commons Attribution Non Commercial 1.0 Generic", + SPDX = "CC-BY-NC-1.0", + FsfApproved = false, OsiApproved = false, + Link = + "https://spdx.org/licenses/CC-BY-NC-1.0.html#licenseText" + }, new + { + Id = 71, Name = "Creative Commons Attribution Non Commercial 2.0 Generic", + SPDX = "CC-BY-NC-2.0", + FsfApproved = false, OsiApproved = false, + Link = + "https://spdx.org/licenses/CC-BY-NC-2.0.html#licenseText" + }, new + { + Id = 72, Name = "Creative Commons Attribution Non Commercial 2.5 Generic", + SPDX = "CC-BY-NC-2.5", + FsfApproved = false, OsiApproved = false, + Link = + "https://spdx.org/licenses/CC-BY-NC-2.5.html#licenseText" + }, new + { + Id = 73, Name = "Creative Commons Attribution Non Commercial 3.0 Unported", + SPDX = "CC-BY-NC-3.0", + FsfApproved = false, OsiApproved = false, + Link = + "https://spdx.org/licenses/CC-BY-NC-3.0.html#licenseText" + }, new + { + Id = 74, Name = "Creative Commons Attribution Non Commercial 4.0 International", + SPDX = "CC-BY-NC-4.0", + FsfApproved = false, OsiApproved = false, + Link = + "https://spdx.org/licenses/CC-BY-NC-4.0.html#licenseText" + }, new + { + Id = 75, + Name = "Creative Commons Attribution Non Commercial No Derivatives 1.0 Generic", + SPDX = "CC-BY-NC-ND-1.0", FsfApproved = false, OsiApproved = false, + Link = "https://spdx.org/licenses/CC-BY-NC-ND-1.0.html#licenseText" + }, new + { + Id = 76, + Name = "Creative Commons Attribution Non Commercial No Derivatives 2.0 Generic", + SPDX = "CC-BY-NC-ND-2.0", FsfApproved = false, OsiApproved = false, + Link = "https://spdx.org/licenses/CC-BY-NC-ND-2.0.html#licenseText" + }, new + { + Id = 77, + Name = "Creative Commons Attribution Non Commercial No Derivatives 2.5 Generic", + SPDX = "CC-BY-NC-ND-2.5", FsfApproved = false, OsiApproved = false, + Link = "https://spdx.org/licenses/CC-BY-NC-ND-2.5.html#licenseText" + }, new + { + Id = 78, + Name = "Creative Commons Attribution Non Commercial No Derivatives 3.0 Unported", + SPDX = "CC-BY-NC-ND-3.0", FsfApproved = false, OsiApproved = false, + Link = "https://spdx.org/licenses/CC-BY-NC-ND-3.0.html#licenseText" + }, new + { + Id = 79, + Name = "Creative Commons Attribution Non Commercial No Derivatives 4.0 International", + SPDX = "CC-BY-NC-ND-4.0", FsfApproved = false, OsiApproved = false, + Link = "https://spdx.org/licenses/CC-BY-NC-ND-4.0.html#licenseText" + }, new + { + Id = 80, + Name = "Creative Commons Attribution Non Commercial Share Alike 1.0 Generic", + SPDX = "CC-BY-NC-SA-1.0", FsfApproved = false, OsiApproved = false, + Link = "https://spdx.org/licenses/CC-BY-NC-SA-1.0.html#licenseText" + }, new + { + Id = 81, + Name = "Creative Commons Attribution Non Commercial Share Alike 2.0 Generic", + SPDX = "CC-BY-NC-SA-2.0", FsfApproved = false, OsiApproved = false, + Link = "https://spdx.org/licenses/CC-BY-NC-SA-2.0.html#licenseText" + }, new + { + Id = 82, + Name = "Creative Commons Attribution Non Commercial Share Alike 2.5 Generic", + SPDX = "CC-BY-NC-SA-2.5", FsfApproved = false, OsiApproved = false, + Link = "https://spdx.org/licenses/CC-BY-NC-SA-2.5.html#licenseText" + }, new + { + Id = 83, + Name = "Creative Commons Attribution Non Commercial Share Alike 3.0 Unported", + SPDX = "CC-BY-NC-SA-3.0", FsfApproved = false, OsiApproved = false, + Link = "https://spdx.org/licenses/CC-BY-NC-SA-3.0.html#licenseText" + }, new + { + Id = 84, + Name = "Creative Commons Attribution Non Commercial Share Alike 4.0 International", + SPDX = "CC-BY-NC-SA-4.0", FsfApproved = false, OsiApproved = false, + Link = "https://spdx.org/licenses/CC-BY-NC-SA-4.0.html#licenseText" + }, new + { + Id = 85, Name = "Creative Commons Attribution No Derivatives 1.0 Generic", + SPDX = "CC-BY-ND-1.0", + FsfApproved = false, OsiApproved = false, + Link = + "https://spdx.org/licenses/CC-BY-ND-1.0.html#licenseText" + }, new + { + Id = 86, Name = "Creative Commons Attribution No Derivatives 2.0 Generic", + SPDX = "CC-BY-ND-2.0", + FsfApproved = false, OsiApproved = false, + Link = + "https://spdx.org/licenses/CC-BY-ND-2.0.html#licenseText" + }, new + { + Id = 87, Name = "Creative Commons Attribution No Derivatives 2.5 Generic", + SPDX = "CC-BY-ND-2.5", + FsfApproved = false, OsiApproved = false, + Link = + "https://spdx.org/licenses/CC-BY-ND-2.5.html#licenseText" + }, new + { + Id = 88, Name = "Creative Commons Attribution No Derivatives 3.0 Unported", + SPDX = "CC-BY-ND-3.0", + FsfApproved = false, OsiApproved = false, + Link = + "https://spdx.org/licenses/CC-BY-ND-3.0.html#licenseText" + }, new + { + Id = 89, Name = "Creative Commons Attribution No Derivatives 4.0 International", + SPDX = "CC-BY-ND-4.0", + FsfApproved = false, OsiApproved = false, + Link = + "https://spdx.org/licenses/CC-BY-ND-4.0.html#licenseText" + }, new + { + Id = 90, Name = "Creative Commons Attribution Share Alike 1.0 Generic", + SPDX = "CC-BY-SA-1.0", + FsfApproved = false, OsiApproved = false, + Link = + "https://spdx.org/licenses/CC-BY-SA-1.0.html#licenseText" + }, new + { + Id = 91, Name = "Creative Commons Attribution Share Alike 2.0 Generic", + SPDX = "CC-BY-SA-2.0", + FsfApproved = false, OsiApproved = false, + Link = + "https://spdx.org/licenses/CC-BY-SA-2.0.html#licenseText" + }, new + { + Id = 92, Name = "Creative Commons Attribution Share Alike 2.5 Generic", + SPDX = "CC-BY-SA-2.5", + FsfApproved = false, OsiApproved = false, + Link = + "https://spdx.org/licenses/CC-BY-SA-2.5.html#licenseText" + }, new + { + Id = 93, Name = "Creative Commons Attribution Share Alike 3.0 Unported", + SPDX = "CC-BY-SA-3.0", + FsfApproved = false, OsiApproved = false, + Link = + "https://spdx.org/licenses/CC-BY-SA-3.0.html#licenseText" + }, new + { + Id = 94, Name = "Creative Commons Attribution Share Alike 4.0 International", + SPDX = "CC-BY-SA-4.0", + FsfApproved = true, OsiApproved = false, + Link = + "https://spdx.org/licenses/CC-BY-SA-4.0.html#licenseText" + }, new + { + Id = 95, Name = "Creative Commons Zero v1.0 Universal", SPDX = "CC0-1.0", FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/CC0-1.0.html#licenseText" + }, new + { + Id = 96, Name = "Common Development and Distribution License 1.0", SPDX = "CDDL-1.0", + FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/CDDL-1.0.html#licenseText" + }, new + { + Id = 97, Name = "Common Development and Distribution License 1.1", SPDX = "CDDL-1.1", + FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/CDDL-1.1.html#licenseText" + }, new + { + Id = 98, Name = "Community Data License Agreement Permissive 1.0", + SPDX = "CDLA-Permissive-1.0", + FsfApproved = false, OsiApproved = false, + Link = "https://spdx.org/licenses/CDLA-Permissive-1.0.html#licenseText" + }, new + { + Id = 99, Name = "Community Data License Agreement Sharing 1.0", + SPDX = "CDLA-Sharing-1.0", + FsfApproved = false, OsiApproved = false, + Link = "https://spdx.org/licenses/CDLA-Sharing-1.0.html#licenseText" + }, new + { + Id = 100, Name = "CeCILL Free Software License Agreement v1.0", SPDX = "CECILL-1.0", + FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/CECILL-1.0.html#licenseText" + }, new + { + Id = 101, Name = "CeCILL Free Software License Agreement v1.1", SPDX = "CECILL-1.1", + FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/CECILL-1.1.html#licenseText" + }, new + { + Id = 102, Name = "CeCILL Free Software License Agreement v2.0", SPDX = "CECILL-2.0", + FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/CECILL-2.0.html#licenseText" + }, new + { + Id = 103, Name = "CeCILL Free Software License Agreement v2.1", SPDX = "CECILL-2.1", + FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/CECILL-2.1.html#licenseText" + }, new + { + Id = 104, Name = "CeCILL-B Free Software License Agreement", SPDX = "CECILL-B", + FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/CECILL-B.html#licenseText" + }, new + { + Id = 105, Name = "CeCILL-C Free Software License Agreement", SPDX = "CECILL-C", + FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/CECILL-C.html#licenseText" + }, new + { + Id = 106, Name = "CERN Open Hardware License v1.1", SPDX = "CERN-OHL-1.1", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/CERN-OHL-1.1.html#licenseText" + }, new + { + Id = 107, Name = "CERN Open Hardware Licence v1.2", SPDX = "CERN-OHL-1.2", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/CERN-OHL-1.2.html#licenseText" + }, new + { + Id = 108, Name = "Clarified Artistic License", SPDX = "ClArtistic", FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/ClArtistic.html#licenseText" + }, new + { + Id = 109, Name = "CNRI Jython License", SPDX = "CNRI-Jython", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/CNRI-Jython.html#licenseText" + }, new + { + Id = 110, Name = "CNRI Python License", SPDX = "CNRI-Python", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/CNRI-Python.html#licenseText" + }, new + { + Id = 111, + Name = "CNRI Python Open Source GPL Compatible License Agreement", + SPDX = "CNRI-Python-GPL-Compatible", FsfApproved = false, OsiApproved = false, + Link = "https://spdx.org/licenses/CNRI-Python-GPL-Compatible.html#licenseText" + }, new + { + Id = 112, Name = "Condor Public License v1.1", SPDX = "Condor-1.1", FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/Condor-1.1.html#licenseText" + }, new + { + Id = 113, Name = "copyleft-next 0.3.0", SPDX = "copyleft-next-0.3.0", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/copyleft-next-0.3.0.html#licenseText" + }, new + { + Id = 114, Name = "copyleft-next 0.3.1", SPDX = "copyleft-next-0.3.1", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/copyleft-next-0.3.1.html#licenseText" + }, new + { + Id = 115, Name = "Common Public Attribution License 1.0", SPDX = "CPAL-1.0", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/CPAL-1.0.html#licenseText" + }, new + { + Id = 116, Name = "Common Public License 1.0", SPDX = "CPL-1.0", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/CPL-1.0.html#licenseText" + }, new + { + Id = 117, Name = "Code Project Open License 1.02", SPDX = "CPOL-1.02", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/CPOL-1.02.html#licenseText" + }, new + { + Id = 118, Name = "Crossword License", SPDX = "Crossword", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Crossword.html#licenseText" + }, new + { + Id = 119, Name = "CrystalStacker License", SPDX = "CrystalStacker", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/CrystalStacker.html#licenseText" + }, new + { + Id = 120, Name = "CUA Office Public License v1.0", SPDX = "CUA-OPL-1.0", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/CUA-OPL-1.0.html#licenseText" + }, new + { + Id = 121, Name = "Cube License", SPDX = "Cube", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Cube.html#licenseText" + }, new + { + Id = 122, Name = "curl License", SPDX = "curl", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/curl.html#licenseText" + }, new + { + Id = 123, Name = "Deutsche Freie Software Lizenz", SPDX = "D-FSL-1.0", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/D-FSL-1.0.html#licenseText" + }, new + { + Id = 124, Name = "diffmark license", SPDX = "diffmark", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/diffmark.html#licenseText" + }, new + { + Id = 125, Name = "DOC License", SPDX = "DOC", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/DOC.html#licenseText" + }, new + { + Id = 126, Name = "Dotseqn License", SPDX = "Dotseqn", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Dotseqn.html#licenseText" + }, new + { + Id = 127, Name = "DSDP License", SPDX = "DSDP", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/DSDP.html#licenseText" + }, new + { + Id = 128, Name = "dvipdfm License", SPDX = "dvipdfm", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/dvipdfm.html#licenseText" + }, new + { + Id = 129, Name = "Educational Community License v1.0", SPDX = "ECL-1.0", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/ECL-1.0.html#licenseText" + }, new + { + Id = 130, Name = "Educational Community License v2.0", SPDX = "ECL-2.0", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/ECL-2.0.html#licenseText" + }, new + { + Id = 131, Name = "Eiffel Forum License v1.0", SPDX = "EFL-1.0", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/EFL-1.0.html#licenseText" + }, new + { + Id = 132, Name = "Eiffel Forum License v2.0", SPDX = "EFL-2.0", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/EFL-2.0.html#licenseText" + }, new + { + Id = 133, Name = "eGenix.com Public License 1.1.0", SPDX = "eGenix", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/eGenix.html#licenseText" + }, new + { + Id = 134, Name = "Entessa Public License v1.0", SPDX = "Entessa", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/Entessa.html#licenseText" + }, new + { + Id = 135, Name = "Eclipse Public License 1.0", SPDX = "EPL-1.0", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/EPL-1.0.html#licenseText" + }, new + { + Id = 136, Name = "Eclipse Public License 2.0", SPDX = "EPL-2.0", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/EPL-2.0.html#licenseText" + }, new + { + Id = 137, Name = "Erlang Public License v1.1", SPDX = "ErlPL-1.1", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/ErlPL-1.1.html#licenseText" + }, new + { + Id = 138, Name = "EU DataGrid Software License", SPDX = "EUDatagrid", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/EUDatagrid.html#licenseText" + }, new + { + Id = 139, Name = "European Union Public License 1.0", SPDX = "EUPL-1.0", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/EUPL-1.0.html#licenseText" + }, new + { + Id = 140, Name = "European Union Public License 1.1", SPDX = "EUPL-1.1", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/EUPL-1.1.html#licenseText" + }, new + { + Id = 141, Name = "European Union Public License 1.2", SPDX = "EUPL-1.2", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/EUPL-1.2.html#licenseText" + }, new + { + Id = 142, Name = "Eurosym License", SPDX = "Eurosym", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Eurosym.html#licenseText" + }, new + { + Id = 143, Name = "Fair License", SPDX = "Fair", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/Fair.html#licenseText" + }, new + { + Id = 144, Name = "Frameworx Open License 1.0", SPDX = "Frameworx-1.0", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/Frameworx-1.0.html#licenseText" + }, new + { + Id = 145, Name = "FreeImage Public License v1.0", SPDX = "FreeImage", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/FreeImage.html#licenseText" + }, new + { + Id = 146, Name = "FSF All Permissive License", SPDX = "FSFAP", FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/FSFAP.html#licenseText" + }, new + { + Id = 147, Name = "FSF Unlimited License", SPDX = "FSFUL", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/FSFUL.html#licenseText" + }, new + { + Id = 148, Name = "FSF Unlimited License (with License Retention)", SPDX = "FSFULLR", + FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/FSFULLR.html#licenseText" + }, new + { + Id = 149, Name = "Freetype Project License", SPDX = "FTL", FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/FTL.html#licenseText" + }, new + { + Id = 150, Name = "GNU Free Documentation License v1.1 only", SPDX = "GFDL-1.1-only", + FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/GFDL-1.1-only.html#licenseText" + }, new + { + Id = 151, Name = "GNU Free Documentation License v1.1 or later", + SPDX = "GFDL-1.1-or-later", + FsfApproved = true, OsiApproved = false, + Link = "https://spdx.org/licenses/GFDL-1.1-or-later.html#licenseText" + }, new + { + Id = 152, Name = "GNU Free Documentation License v1.2 only", SPDX = "GFDL-1.2-only", + FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/GFDL-1.2-only.html#licenseText" + }, new + { + Id = 153, Name = "GNU Free Documentation License v1.2 or later", + SPDX = "GFDL-1.2-or-later", + FsfApproved = true, OsiApproved = false, + Link = "https://spdx.org/licenses/GFDL-1.2-or-later.html#licenseText" + }, new + { + Id = 154, Name = "GNU Free Documentation License v1.3 only", SPDX = "GFDL-1.3-only", + FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/GFDL-1.3-only.html#licenseText" + }, new + { + Id = 155, Name = "GNU Free Documentation License v1.3 or later", + SPDX = "GFDL-1.3-or-later", + FsfApproved = true, OsiApproved = false, + Link = "https://spdx.org/licenses/GFDL-1.3-or-later.html#licenseText" + }, new + { + Id = 156, Name = "Giftware License", SPDX = "Giftware", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Giftware.html#licenseText" + }, new + { + Id = 157, Name = "GL2PS License", SPDX = "GL2PS", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/GL2PS.html#licenseText" + }, new + { + Id = 158, Name = "3dfx Glide License", SPDX = "Glide", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Glide.html#licenseText" + }, new + { + Id = 159, Name = "Glulxe License", SPDX = "Glulxe", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Glulxe.html#licenseText" + }, new + { + Id = 160, Name = "gnuplot License", SPDX = "gnuplot", FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/gnuplot.html#licenseText" + }, new + { + Id = 161, Name = "GNU General Public License v1.0 only", SPDX = "GPL-1.0-only", + FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/GPL-1.0-only.html#licenseText" + }, new + { + Id = 162, Name = "GNU General Public License v1.0 or later", SPDX = "GPL-1.0-or-later", + FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/GPL-1.0-or-later.html#licenseText" + }, new + { + Id = 163, Name = "GNU General Public License v2.0 only", SPDX = "GPL-2.0-only", + FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/GPL-2.0-only.html#licenseText" + }, new + { + Id = 164, Name = "GNU General Public License v2.0 or later", SPDX = "GPL-2.0-or-later", + FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/GPL-2.0-or-later.html#licenseText" + }, new + { + Id = 165, Name = "GNU General Public License v3.0 only", SPDX = "GPL-3.0-only", + FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/GPL-3.0-only.html#licenseText" + }, new + { + Id = 166, Name = "GNU General Public License v3.0 or later", SPDX = "GPL-3.0-or-later", + FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/GPL-3.0-or-later.html#licenseText" + }, new + { + Id = 167, Name = "gSOAP Public License v1.3b", SPDX = "gSOAP-1.3b", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/gSOAP-1.3b.html#licenseText" + }, new + { + Id = 168, Name = "Haskell Language Report License", SPDX = "HaskellReport", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/HaskellReport.html#licenseText" + }, new + { + Id = 169, Name = "Historical Permission Notice and Disclaimer", SPDX = "HPND", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/HPND.html#licenseText" + }, new + { + Id = 170, Name = "Historical Permission Notice and Disclaimer - sell variant", + SPDX = "HPND-sell-variant", + FsfApproved = false, OsiApproved = false, + Link = "https://spdx.org/licenses/HPND-sell-variant.html#licenseText" + }, new + { + Id = 171, Name = "IBM PowerPC Initialization and Boot Software", SPDX = "IBM-pibs", + FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/IBM-pibs.html#licenseText" + }, new + { + Id = 172, Name = "ICU License", SPDX = "ICU", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/ICU.html#licenseText" + }, new + { + Id = 173, Name = "Independent JPEG Group License", SPDX = "IJG", FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/IJG.html#licenseText" + }, new + { + Id = 174, Name = "ImageMagick License", SPDX = "ImageMagick", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/ImageMagick.html#licenseText" + }, new + { + Id = 175, Name = "iMatix Standard Function Library Agreement", SPDX = "iMatix", + FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/iMatix.html#licenseText" + }, new + { + Id = 176, Name = "Imlib2 License", SPDX = "Imlib2", FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/Imlib2.html#licenseText" + }, new + { + Id = 177, Name = "Info-ZIP License", SPDX = "Info-ZIP", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Info-ZIP.html#licenseText" + }, new + { + Id = 178, Name = "Intel Open Source License", SPDX = "Intel", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/Intel.html#licenseText" + }, new + { + Id = 179, Name = "Intel ACPI Software License Agreement", SPDX = "Intel-ACPI", + FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Intel-ACPI.html#licenseText" + }, new + { + Id = 180, Name = "Interbase Public License v1.0", SPDX = "Interbase-1.0", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Interbase-1.0.html#licenseText" + }, new + { + Id = 181, Name = "IPA Font License", SPDX = "IPA", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/IPA.html#licenseText" + }, new + { + Id = 182, Name = "IBM Public License v1.0", SPDX = "IPL-1.0", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/IPL-1.0.html#licenseText" + }, new + { + Id = 183, Name = "ISC License", SPDX = "ISC", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/ISC.html#licenseText" + }, new + { + Id = 184, Name = "JasPer License", SPDX = "JasPer-2.0", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/JasPer-2.0.html#licenseText" + }, new + { + Id = 185, Name = "Japan Network Information Center License", SPDX = "JPNIC", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/JPNIC.html#licenseText" + }, new + { + Id = 186, Name = "JSON License", SPDX = "JSON", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/JSON.html#licenseText" + }, new + { + Id = 187, Name = "Licence Art Libre 1.2", SPDX = "LAL-1.2", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/LAL-1.2.html#licenseText" + }, new + { + Id = 188, Name = "Licence Art Libre 1.3", SPDX = "LAL-1.3", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/LAL-1.3.html#licenseText" + }, new + { + Id = 189, Name = "Latex2e License", SPDX = "Latex2e", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Latex2e.html#licenseText" + }, new + { + Id = 190, Name = "Leptonica License", SPDX = "Leptonica", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Leptonica.html#licenseText" + }, new + { + Id = 191, Name = "GNU Library General Public License v2 only", SPDX = "LGPL-2.0-only", + FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/LGPL-2.0-only.html#licenseText" + }, new + { + Id = 192, Name = "GNU Library General Public License v2 or later", + SPDX = "LGPL-2.0-or-later", + FsfApproved = false, OsiApproved = true, + Link = "https://spdx.org/licenses/LGPL-2.0-or-later.html#licenseText" + }, new + { + Id = 193, Name = "GNU Lesser General Public License v2.1 only", SPDX = "LGPL-2.1-only", + FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/LGPL-2.1-only.html#licenseText" + }, new + { + Id = 194, Name = "GNU Lesser General Public License v2.1 or later", + SPDX = "LGPL-2.1-or-later", + FsfApproved = true, OsiApproved = true, + Link = "https://spdx.org/licenses/LGPL-2.1-or-later.html#licenseText" + }, new + { + Id = 195, Name = "GNU Lesser General Public License v3.0 only", SPDX = "LGPL-3.0-only", + FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/LGPL-3.0-only.html#licenseText" + }, new + { + Id = 196, Name = "GNU Lesser General Public License v3.0 or later", + SPDX = "LGPL-3.0-or-later", + FsfApproved = true, OsiApproved = true, + Link = "https://spdx.org/licenses/LGPL-3.0-or-later.html#licenseText" + }, new + { + Id = 197, Name = "Lesser General Public License For Linguistic Resources", + SPDX = "LGPLLR", + FsfApproved = false, OsiApproved = false, + Link = + "https://spdx.org/licenses/LGPLLR.html#licenseText" + }, new + { + Id = 198, Name = "libpng License", SPDX = "Libpng", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Libpng.html#licenseText" + }, new + { + Id = 199, Name = "PNG Reference Library version 2", SPDX = "libpng-2.0", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/libpng-2.0.html#licenseText" + }, new + { + Id = 200, Name = "libtiff License", SPDX = "libtiff", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/libtiff.html#licenseText" + }, new + { + Id = 201, Name = "Licence Libre du Québec – Permissive version 1.1", SPDX = "LiLiQ-P-1.1", + FsfApproved = false, OsiApproved = true, + Link = + "https://spdx.org/licenses/LiLiQ-P-1.1.html#licenseText" + }, new + { + Id = 202, Name = "Licence Libre du Québec – Réciprocité version 1.1", + SPDX = "LiLiQ-R-1.1", + FsfApproved = false, OsiApproved = true, + Link = + "https://spdx.org/licenses/LiLiQ-R-1.1.html#licenseText" + }, new + { + Id = 203, Name = "Licence Libre du Québec – Réciprocité forte version 1.1", + SPDX = "LiLiQ-Rplus-1.1", + FsfApproved = false, OsiApproved = true, + Link = + "https://spdx.org/licenses/LiLiQ-Rplus-1.1.html#licenseText" + }, new + { + Id = 204, Name = "Linux Kernel Variant of OpenIB.org license", SPDX = "Linux-OpenIB", + FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Linux-OpenIB.html#licenseText" + }, new + { + Id = 205, Name = "Lucent Public License Version 1.0", SPDX = "LPL-1.0", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/LPL-1.0.html#licenseText" + }, new + { + Id = 206, Name = "Lucent Public License v1.02", SPDX = "LPL-1.02", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/LPL-1.02.html#licenseText" + }, new + { + Id = 207, Name = "LaTeX Project Public License v1.0", SPDX = "LPPL-1.0", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/LPPL-1.0.html#licenseText" + }, new + { + Id = 208, Name = "LaTeX Project Public License v1.1", SPDX = "LPPL-1.1", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/LPPL-1.1.html#licenseText" + }, new + { + Id = 209, Name = "LaTeX Project Public License v1.2", SPDX = "LPPL-1.2", FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/LPPL-1.2.html#licenseText" + }, new + { + Id = 210, Name = "LaTeX Project Public License v1.3a", SPDX = "LPPL-1.3a", FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/LPPL-1.3a.html#licenseText" + }, new + { + Id = 211, Name = "LaTeX Project Public License v1.3c", SPDX = "LPPL-1.3c", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/LPPL-1.3c.html#licenseText" + }, new + { + Id = 212, Name = "MakeIndex License", SPDX = "MakeIndex", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/MakeIndex.html#licenseText" + }, new + { + Id = 213, Name = "MirOS License", SPDX = "MirOS", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/MirOS.html#licenseText" + }, new + { + Id = 214, Name = "MIT License", SPDX = "MIT", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/MIT.html#licenseText" + }, new + { + Id = 215, Name = "MIT No Attribution", SPDX = "MIT-0", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/MIT-0.html#licenseText" + }, new + { + Id = 216, Name = "Enlightenment License (e16)", SPDX = "MIT-advertising", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/MIT-advertising.html#licenseText" + }, new + { + Id = 217, Name = "CMU License", SPDX = "MIT-CMU", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/MIT-CMU.html#licenseText" + }, new + { + Id = 218, Name = "enna License", SPDX = "MIT-enna", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/MIT-enna.html#licenseText" + }, new + { + Id = 219, Name = "feh License", SPDX = "MIT-feh", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/MIT-feh.html#licenseText" + }, new + { + Id = 220, Name = "MIT +no-false-attribs license", SPDX = "MITNFA", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/MITNFA.html#licenseText" + }, new + { + Id = 221, Name = "Motosoto License", SPDX = "Motosoto", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/Motosoto.html#licenseText" + }, new + { + Id = 222, Name = "mpich2 License", SPDX = "mpich2", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/mpich2.html#licenseText" + }, new + { + Id = 223, Name = "Mozilla Public License 1.0", SPDX = "MPL-1.0", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/MPL-1.0.html#licenseText" + }, new + { + Id = 224, Name = "Mozilla Public License 1.1", SPDX = "MPL-1.1", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/MPL-1.1.html#licenseText" + }, new + { + Id = 225, Name = "Mozilla Public License 2.0", SPDX = "MPL-2.0", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/MPL-2.0.html#licenseText" + }, new + { + Id = 226, Name = "Mozilla Public License 2.0 (no copyleft exception)", + SPDX = "MPL-2.0-no-copyleft-exception", FsfApproved = false, OsiApproved = true, + Link = "https://spdx.org/licenses/MPL-2.0-no-copyleft-exception.html#licenseText" + }, new + { + Id = 227, Name = "Microsoft Public License", SPDX = "MS-PL", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/MS-PL.html#licenseText" + }, new + { + Id = 228, Name = "Microsoft Reciprocal License", SPDX = "MS-RL", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/MS-RL.html#licenseText" + }, new + { + Id = 229, Name = "Matrix Template Library License", SPDX = "MTLL", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/MTLL.html#licenseText" + }, new + { + Id = 230, Name = "Multics License", SPDX = "Multics", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/Multics.html#licenseText" + }, new + { + Id = 231, Name = "Mup License", SPDX = "Mup", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Mup.html#licenseText" + }, new + { + Id = 232, Name = "NASA Open Source Agreement 1.3", SPDX = "NASA-1.3", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/NASA-1.3.html#licenseText" + }, new + { + Id = 233, Name = "Naumen Public License", SPDX = "Naumen", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/Naumen.html#licenseText" + }, new + { + Id = 234, Name = "Net Boolean Public License v1", SPDX = "NBPL-1.0", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/NBPL-1.0.html#licenseText" + }, new + { + Id = 235, Name = "University of Illinois/NCSA Open Source License", SPDX = "NCSA", + FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/NCSA.html#licenseText" + }, new + { + Id = 236, Name = "Net-SNMP License", SPDX = "Net-SNMP", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Net-SNMP.html#licenseText" + }, new + { + Id = 237, Name = "NetCDF license", SPDX = "NetCDF", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/NetCDF.html#licenseText" + }, new + { + Id = 238, Name = "Newsletr License", SPDX = "Newsletr", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Newsletr.html#licenseText" + }, new + { + Id = 239, Name = "Nethack General Public License", SPDX = "NGPL", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/NGPL.html#licenseText" + }, new + { + Id = 240, Name = "Norwegian Licence for Open Government Data", SPDX = "NLOD-1.0", + FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/NLOD-1.0.html#licenseText" + }, new + { + Id = 241, Name = "No Limit Public License", SPDX = "NLPL", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/NLPL.html#licenseText" + }, new + { + Id = 242, Name = "Nokia Open Source License", SPDX = "Nokia", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/Nokia.html#licenseText" + }, new + { + Id = 243, Name = "Netizen Open Source License", SPDX = "NOSL", FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/NOSL.html#licenseText" + }, new + { + Id = 244, Name = "Noweb License", SPDX = "Noweb", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Noweb.html#licenseText" + }, new + { + Id = 245, Name = "Netscape Public License v1.0", SPDX = "NPL-1.0", FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/NPL-1.0.html#licenseText" + }, new + { + Id = 246, Name = "Netscape Public License v1.1", SPDX = "NPL-1.1", FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/NPL-1.1.html#licenseText" + }, new + { + Id = 247, Name = "Non-Profit Open Software License 3.0", SPDX = "NPOSL-3.0", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/NPOSL-3.0.html#licenseText" + }, new + { + Id = 248, Name = "NRL License", SPDX = "NRL", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/NRL.html#licenseText" + }, new + { + Id = 249, Name = "NTP License", SPDX = "NTP", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/NTP.html#licenseText" + }, new + { + Id = 250, Name = "Open CASCADE Technology Public License", SPDX = "OCCT-PL", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/OCCT-PL.html#licenseText" + }, new + { + Id = 251, Name = "OCLC Research Public License 2.0", SPDX = "OCLC-2.0", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/OCLC-2.0.html#licenseText" + }, new + { + Id = 252, Name = "ODC Open Database License v1.0", SPDX = "ODbL-1.0", FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/ODbL-1.0.html#licenseText" + }, new + { + Id = 253, Name = "Open Data Commons Attribution License v1.0", SPDX = "ODC-By-1.0", + FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/ODC-By-1.0.html#licenseText" + }, new + { + Id = 254, Name = "SIL Open Font License 1.0", SPDX = "OFL-1.0", FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/OFL-1.0.html#licenseText" + }, new + { + Id = 255, Name = "SIL Open Font License 1.1", SPDX = "OFL-1.1", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/OFL-1.1.html#licenseText" + }, new + { + Id = 256, Name = "Open Government Licence v1.0", SPDX = "OGL-UK-1.0", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/OGL-UK-1.0.html#licenseText" + }, new + { + Id = 257, Name = "Open Government Licence v2.0", SPDX = "OGL-UK-2.0", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/OGL-UK-2.0.html#licenseText" + }, new + { + Id = 258, Name = "Open Government Licence v3.0", SPDX = "OGL-UK-3.0", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/OGL-UK-3.0.html#licenseText" + }, new + { + Id = 259, Name = "Open Group Test Suite License", SPDX = "OGTSL", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/OGTSL.html#licenseText" + }, new + { + Id = 260, Name = "Open LDAP Public License v1.1", SPDX = "OLDAP-1.1", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/OLDAP-1.1.html#licenseText" + }, new + { + Id = 261, Name = "Open LDAP Public License v1.2", SPDX = "OLDAP-1.2", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/OLDAP-1.2.html#licenseText" + }, new + { + Id = 262, Name = "Open LDAP Public License v1.3", SPDX = "OLDAP-1.3", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/OLDAP-1.3.html#licenseText" + }, new + { + Id = 263, Name = "Open LDAP Public License v1.4", SPDX = "OLDAP-1.4", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/OLDAP-1.4.html#licenseText" + }, new + { + Id = 264, Name = "Open LDAP Public License v2.0 (or possibly 2.0A and 2.0B)", + SPDX = "OLDAP-2.0", + FsfApproved = false, OsiApproved = false, + Link = + "https://spdx.org/licenses/OLDAP-2.0.html#licenseText" + }, new + { + Id = 265, Name = "Open LDAP Public License v2.0.1", SPDX = "OLDAP-2.0.1", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/OLDAP-2.0.1.html#licenseText" + }, new + { + Id = 266, Name = "Open LDAP Public License v2.1", SPDX = "OLDAP-2.1", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/OLDAP-2.1.html#licenseText" + }, new + { + Id = 267, Name = "Open LDAP Public License v2.2", SPDX = "OLDAP-2.2", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/OLDAP-2.2.html#licenseText" + }, new + { + Id = 268, Name = "Open LDAP Public License v2.2.1", SPDX = "OLDAP-2.2.1", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/OLDAP-2.2.1.html#licenseText" + }, new + { + Id = 269, Name = "Open LDAP Public License 2.2.2", SPDX = "OLDAP-2.2.2", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/OLDAP-2.2.2.html#licenseText" + }, new + { + Id = 270, Name = "Open LDAP Public License v2.3", SPDX = "OLDAP-2.3", FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/OLDAP-2.3.html#licenseText" + }, new + { + Id = 271, Name = "Open LDAP Public License v2.4", SPDX = "OLDAP-2.4", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/OLDAP-2.4.html#licenseText" + }, new + { + Id = 272, Name = "Open LDAP Public License v2.5", SPDX = "OLDAP-2.5", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/OLDAP-2.5.html#licenseText" + }, new + { + Id = 273, Name = "Open LDAP Public License v2.6", SPDX = "OLDAP-2.6", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/OLDAP-2.6.html#licenseText" + }, new + { + Id = 274, Name = "Open LDAP Public License v2.7", SPDX = "OLDAP-2.7", FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/OLDAP-2.7.html#licenseText" + }, new + { + Id = 275, Name = "Open LDAP Public License v2.8", SPDX = "OLDAP-2.8", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/OLDAP-2.8.html#licenseText" + }, new + { + Id = 276, Name = "Open Market License", SPDX = "OML", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/OML.html#licenseText" + }, new + { + Id = 277, Name = "OpenSSL License", SPDX = "OpenSSL", FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/OpenSSL.html#licenseText" + }, new + { + Id = 278, Name = "Open Public License v1.0", SPDX = "OPL-1.0", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/OPL-1.0.html#licenseText" + }, new + { + Id = 279, Name = "OSET Public License version 2.1", SPDX = "OSET-PL-2.1", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/OSET-PL-2.1.html#licenseText" + }, new + { + Id = 280, Name = "Open Software License 1.0", SPDX = "OSL-1.0", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/OSL-1.0.html#licenseText" + }, new + { + Id = 281, Name = "Open Software License 1.1", SPDX = "OSL-1.1", FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/OSL-1.1.html#licenseText" + }, new + { + Id = 282, Name = "Open Software License 2.0", SPDX = "OSL-2.0", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/OSL-2.0.html#licenseText" + }, new + { + Id = 283, Name = "Open Software License 2.1", SPDX = "OSL-2.1", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/OSL-2.1.html#licenseText" + }, new + { + Id = 284, Name = "Open Software License 3.0", SPDX = "OSL-3.0", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/OSL-3.0.html#licenseText" + }, new + { + Id = 285, Name = "ODC Public Domain Dedication & License 1.0", SPDX = "PDDL-1.0", + FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/PDDL-1.0.html#licenseText" + }, new + { + Id = 286, Name = "PHP License v3.0", SPDX = "PHP-3.0", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/PHP-3.0.html#licenseText" + }, new + { + Id = 287, Name = "PHP License v3.01", SPDX = "PHP-3.01", FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/PHP-3.01.html#licenseText" + }, new + { + Id = 288, Name = "Plexus Classworlds License", SPDX = "Plexus", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Plexus.html#licenseText" + }, new + { + Id = 289, Name = "PostgreSQL License", SPDX = "PostgreSQL", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/PostgreSQL.html#licenseText" + }, new + { + Id = 290, Name = "psfrag License", SPDX = "psfrag", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/psfrag.html#licenseText" + }, new + { + Id = 291, Name = "psutils License", SPDX = "psutils", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/psutils.html#licenseText" + }, new + { + Id = 292, Name = "Python License 2.0", SPDX = "Python-2.0", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/Python-2.0.html#licenseText" + }, new + { + Id = 293, Name = "Qhull License", SPDX = "Qhull", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Qhull.html#licenseText" + }, new + { + Id = 294, Name = "Q Public License 1.0", SPDX = "QPL-1.0", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/QPL-1.0.html#licenseText" + }, new + { + Id = 295, Name = "Rdisc License", SPDX = "Rdisc", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Rdisc.html#licenseText" + }, new + { + Id = 296, Name = "Red Hat eCos Public License v1.1", SPDX = "RHeCos-1.1", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/RHeCos-1.1.html#licenseText" + }, new + { + Id = 297, Name = "Reciprocal Public License 1.1", SPDX = "RPL-1.1", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/RPL-1.1.html#licenseText" + }, new + { + Id = 298, Name = "Reciprocal Public License 1.5", SPDX = "RPL-1.5", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/RPL-1.5.html#licenseText" + }, new + { + Id = 299, Name = "RealNetworks Public Source License v1.0", SPDX = "RPSL-1.0", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/RPSL-1.0.html#licenseText" + }, new + { + Id = 300, Name = "RSA Message-Digest License", SPDX = "RSA-MD", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/RSA-MD.html#licenseText" + }, new + { + Id = 301, Name = "Ricoh Source Code Public License", SPDX = "RSCPL", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/RSCPL.html#licenseText" + }, new + { + Id = 302, Name = "Ruby License", SPDX = "Ruby", FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/Ruby.html#licenseText" + }, new + { + Id = 303, Name = "Sax Public Domain Notice", SPDX = "SAX-PD", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/SAX-PD.html#licenseText" + }, new + { + Id = 304, Name = "Saxpath License", SPDX = "Saxpath", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Saxpath.html#licenseText" + }, new + { + Id = 305, Name = "SCEA Shared Source License", SPDX = "SCEA", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/SCEA.html#licenseText" + }, new + { + Id = 306, Name = "Sendmail License", SPDX = "Sendmail", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Sendmail.html#licenseText" + }, new + { + Id = 307, Name = "Sendmail License 8.23", SPDX = "Sendmail-8.23", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Sendmail-8.23.html#licenseText" + }, new + { + Id = 308, Name = "SGI Free Software License B v1.0", SPDX = "SGI-B-1.0", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/SGI-B-1.0.html#licenseText" + }, new + { + Id = 309, Name = "SGI Free Software License B v1.1", SPDX = "SGI-B-1.1", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/SGI-B-1.1.html#licenseText" + }, new + { + Id = 310, Name = "SGI Free Software License B v2.0", SPDX = "SGI-B-2.0", FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/SGI-B-2.0.html#licenseText" + }, new + { + Id = 311, Name = "Simple Public License 2.0", SPDX = "SimPL-2.0", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/SimPL-2.0.html#licenseText" + }, new + { + Id = 312, Name = "Sun Industry Standards Source License v1.1", SPDX = "SISSL", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/SISSL.html#licenseText" + }, new + { + Id = 313, Name = "Sun Industry Standards Source License v1.2", SPDX = "SISSL-1.2", + FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/SISSL-1.2.html#licenseText" + }, new + { + Id = 314, Name = "Sleepycat License", SPDX = "Sleepycat", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/Sleepycat.html#licenseText" + }, new + { + Id = 315, Name = "Standard ML of New Jersey License", SPDX = "SMLNJ", FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/SMLNJ.html#licenseText" + }, new + { + Id = 316, Name = "Secure Messaging Protocol Public License", SPDX = "SMPPL", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/SMPPL.html#licenseText" + }, new + { + Id = 317, Name = "SNIA Public License 1.1", SPDX = "SNIA", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/SNIA.html#licenseText" + }, new + { + Id = 318, Name = "Spencer License 86", SPDX = "Spencer-86", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Spencer-86.html#licenseText" + }, new + { + Id = 319, Name = "Spencer License 94", SPDX = "Spencer-94", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Spencer-94.html#licenseText" + }, new + { + Id = 320, Name = "Spencer License 99", SPDX = "Spencer-99", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Spencer-99.html#licenseText" + }, new + { + Id = 321, Name = "Sun Public License v1.0", SPDX = "SPL-1.0", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/SPL-1.0.html#licenseText" + }, new + { + Id = 322, Name = "SugarCRM Public License v1.1.3", SPDX = "SugarCRM-1.1.3", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/SugarCRM-1.1.3.html#licenseText" + }, new + { + Id = 323, Name = "Scheme Widget Library (SWL) Software License Agreement", SPDX = "SWL", + FsfApproved = false, OsiApproved = false, + Link = "https://spdx.org/licenses/SWL.html#licenseText" + }, new + { + Id = 324, Name = "TAPR Open Hardware License v1.0", SPDX = "TAPR-OHL-1.0", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/TAPR-OHL-1.0.html#licenseText" + }, new + { + Id = 325, Name = "TCL/TK License", SPDX = "TCL", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/TCL.html#licenseText" + }, new + { + Id = 326, Name = "TCP Wrappers License", SPDX = "TCP-wrappers", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/TCP-wrappers.html#licenseText" + }, new + { + Id = 327, Name = "TMate Open Source License", SPDX = "TMate", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/TMate.html#licenseText" + }, new + { + Id = 328, Name = "TORQUE v2.5+ Software License v1.1", SPDX = "TORQUE-1.1", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/TORQUE-1.1.html#licenseText" + }, new + { + Id = 329, Name = "Trusster Open Source License", SPDX = "TOSL", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/TOSL.html#licenseText" + }, new + { + Id = 330, Name = "Technische Universitaet Berlin License 1.0", SPDX = "TU-Berlin-1.0", + FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/TU-Berlin-1.0.html#licenseText" + }, new + { + Id = 331, Name = "Technische Universitaet Berlin License 2.0", SPDX = "TU-Berlin-2.0", + FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/TU-Berlin-2.0.html#licenseText" + }, new + { + Id = 332, Name = "Unicode License Agreement - Data Files and Software (2015)", + SPDX = "Unicode-DFS-2015", + FsfApproved = false, OsiApproved = false, + Link = "https://spdx.org/licenses/Unicode-DFS-2015.html#licenseText" + }, new + { + Id = 333, Name = "Unicode License Agreement - Data Files and Software (2016)", + SPDX = "Unicode-DFS-2016", + FsfApproved = false, OsiApproved = false, + Link = "https://spdx.org/licenses/Unicode-DFS-2016.html#licenseText" + }, new + { + Id = 334, Name = "Unicode Terms of Use", SPDX = "Unicode-TOU", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Unicode-TOU.html#licenseText" + }, new + { + Id = 335, Name = "The Unlicense", SPDX = "Unlicense", FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/Unlicense.html#licenseText" + }, new + { + Id = 336, Name = "Universal Permissive License v1.0", SPDX = "UPL-1.0", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/UPL-1.0.html#licenseText" + }, new + { + Id = 337, Name = "Vim License", SPDX = "Vim", FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/Vim.html#licenseText" + }, new + { + Id = 338, Name = "VOSTROM Public License for Open Source", SPDX = "VOSTROM", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/VOSTROM.html#licenseText" + }, new + { + Id = 339, Name = "Vovida Software License v1.0", SPDX = "VSL-1.0", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/VSL-1.0.html#licenseText" + }, new + { + Id = 340, Name = "W3C Software Notice and License (2002-12-31)", SPDX = "W3C", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/W3C.html#licenseText" + }, new + { + Id = 341, Name = "W3C Software Notice and License (1998-07-20)", SPDX = "W3C-19980720", + FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/W3C-19980720.html#licenseText" + }, new + { + Id = 342, Name = "W3C Software Notice and Document License (2015-05-13)", + SPDX = "W3C-20150513", + FsfApproved = false, OsiApproved = false, + Link = + "https://spdx.org/licenses/W3C-20150513.html#licenseText" + }, new + { + Id = 343, Name = "Sybase Open Watcom Public License 1.0", SPDX = "Watcom-1.0", + FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/Watcom-1.0.html#licenseText" + }, new + { + Id = 344, Name = "Wsuipa License", SPDX = "Wsuipa", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Wsuipa.html#licenseText" + }, new + { + Id = 345, Name = "Do What The F*ck You Want To Public License", SPDX = "WTFPL", + FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/WTFPL.html#licenseText" + }, new + { + Id = 346, Name = "X11 License", SPDX = "X11", FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/X11.html#licenseText" + }, new + { + Id = 347, Name = "Xerox License", SPDX = "Xerox", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Xerox.html#licenseText" + }, new + { + Id = 348, Name = "XFree86 License 1.1", SPDX = "XFree86-1.1", FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/XFree86-1.1.html#licenseText" + }, new + { + Id = 349, Name = "xinetd License", SPDX = "xinetd", FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/xinetd.html#licenseText" + }, new + { + Id = 350, Name = "X.Net License", SPDX = "Xnet", FsfApproved = false, + OsiApproved = true, Link = "https://spdx.org/licenses/Xnet.html#licenseText" + }, new + { + Id = 351, Name = "XPP License", SPDX = "xpp", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/xpp.html#licenseText" + }, new + { + Id = 352, Name = "XSkat License", SPDX = "XSkat", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/XSkat.html#licenseText" + }, new + { + Id = 353, Name = "Yahoo! Public License v1.0", SPDX = "YPL-1.0", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/YPL-1.0.html#licenseText" + }, new + { + Id = 354, Name = "Yahoo! Public License v1.1", SPDX = "YPL-1.1", FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/YPL-1.1.html#licenseText" + }, new + { + Id = 355, Name = "Zed License", SPDX = "Zed", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Zed.html#licenseText" + }, new + { + Id = 356, Name = "Zend License v2.0", SPDX = "Zend-2.0", FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/Zend-2.0.html#licenseText" + }, new + { + Id = 357, Name = "Zimbra Public License v1.3", SPDX = "Zimbra-1.3", FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/Zimbra-1.3.html#licenseText" + }, new + { + Id = 358, Name = "Zimbra Public License v1.4", SPDX = "Zimbra-1.4", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/Zimbra-1.4.html#licenseText" + }, new + { + Id = 359, Name = "zlib License", SPDX = "Zlib", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/Zlib.html#licenseText" + }, new + { + Id = 360, Name = "zlib/libpng License with Acknowledgement", + SPDX = "zlib-acknowledgement", + FsfApproved = false, OsiApproved = false, + Link = "https://spdx.org/licenses/zlib-acknowledgement.html#licenseText" + }, new + { + Id = 361, Name = "Zope Public License 1.1", SPDX = "ZPL-1.1", FsfApproved = false, + OsiApproved = false, Link = "https://spdx.org/licenses/ZPL-1.1.html#licenseText" + }, new + { + Id = 362, Name = "Zope Public License 2.0", SPDX = "ZPL-2.0", FsfApproved = true, + OsiApproved = true, Link = "https://spdx.org/licenses/ZPL-2.0.html#licenseText" + }, new + { + Id = 363, Name = "Zope Public License 2.1", SPDX = "ZPL-2.1", FsfApproved = true, + OsiApproved = false, Link = "https://spdx.org/licenses/ZPL-2.1.html#licenseText" + }); } } \ No newline at end of file diff --git a/Marechai/Areas/Admin/Controllers/BrowserTestsController.cs b/Marechai/Areas/Admin/Controllers/BrowserTestsController.cs index 12f3fb87..b26c869d 100644 --- a/Marechai/Areas/Admin/Controllers/BrowserTestsController.cs +++ b/Marechai/Areas/Admin/Controllers/BrowserTestsController.cs @@ -37,29 +37,28 @@ using Microsoft.EntityFrameworkCore; namespace Marechai.Areas.Admin.Controllers { - [Area("Admin")] - [Authorize] + [Area("Admin"), Authorize] public class BrowserTestsController : Controller { readonly MarechaiContext _context; - public BrowserTestsController(MarechaiContext context) - { - _context = context; - } + public BrowserTestsController(MarechaiContext context) => _context = context; // GET: Admin/BrowserTests public async Task Index() => - View(await _context.BrowserTests.OrderBy(b => b.Browser).ThenBy(b => b.Version).ThenBy(b => b.Os) - .ThenBy(b => b.Platform).ThenBy(b => b.UserAgent).ToListAsync()); + View(await _context.BrowserTests.OrderBy(b => b.Browser).ThenBy(b => b.Version).ThenBy(b => b.Os). + ThenBy(b => b.Platform).ThenBy(b => b.UserAgent).ToListAsync()); // GET: Admin/BrowserTests/Details/5 public async Task Details(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); BrowserTest browserTest = await _context.BrowserTests.FirstOrDefaultAsync(m => m.Id == id); - if(browserTest == null) return NotFound(); + + if(browserTest == null) + return NotFound(); return View(browserTest); } @@ -67,10 +66,13 @@ namespace Marechai.Areas.Admin.Controllers // GET: Admin/BrowserTests/Edit/5 public async Task Edit(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); BrowserTest browserTest = await _context.BrowserTests.FindAsync(id); - if(browserTest == null) return NotFound(); + + if(browserTest == null) + return NotFound(); return View(browserTest); } @@ -78,16 +80,17 @@ namespace Marechai.Areas.Admin.Controllers // POST: Admin/BrowserTests/Edit/5 // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Edit( - int id, [Bind( - "Id,UserAgent,Browser,Version,Os,Platform,Gif87,Gif89,Jpeg,Png,Pngt,Agif,Table,Colors,Js,Frames,Flash")] + int id, + [Bind("Id,UserAgent,Browser,Version,Os,Platform,Gif87,Gif89,Jpeg,Png,Pngt,Agif,Table,Colors,Js,Frames,Flash")] BrowserTest browserTest) { - if(id != browserTest.Id) return NotFound(); + if(id != browserTest.Id) + return NotFound(); - if(!ModelState.IsValid) return View(browserTest); + if(!ModelState.IsValid) + return View(browserTest); try { @@ -96,7 +99,8 @@ namespace Marechai.Areas.Admin.Controllers } catch(DbUpdateConcurrencyException) { - if(!BrowserTestExists(browserTest.Id)) return NotFound(); + if(!BrowserTestExists(browserTest.Id)) + return NotFound(); throw; } @@ -107,29 +111,28 @@ namespace Marechai.Areas.Admin.Controllers // GET: Admin/BrowserTests/Delete/5 public async Task Delete(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); BrowserTest browserTest = await _context.BrowserTests.FirstOrDefaultAsync(m => m.Id == id); - if(browserTest == null) return NotFound(); + + if(browserTest == null) + return NotFound(); return View(browserTest); } // POST: Admin/BrowserTests/Delete/5 - [HttpPost] - [ActionName("Delete")] - [ValidateAntiForgeryToken] + [HttpPost, ActionName("Delete"), ValidateAntiForgeryToken] public async Task DeleteConfirmed(int id) { BrowserTest browserTest = await _context.BrowserTests.FindAsync(id); _context.BrowserTests.Remove(browserTest); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - bool BrowserTestExists(int id) - { - return _context.BrowserTests.Any(e => e.Id == id); - } + bool BrowserTestExists(int id) => _context.BrowserTests.Any(e => e.Id == id); } } \ No newline at end of file diff --git a/Marechai/Areas/Admin/Controllers/CompaniesController.cs b/Marechai/Areas/Admin/Controllers/CompaniesController.cs index 9338d8fb..ac2f3ab9 100644 --- a/Marechai/Areas/Admin/Controllers/CompaniesController.cs +++ b/Marechai/Areas/Admin/Controllers/CompaniesController.cs @@ -30,8 +30,8 @@ using System.Linq; using System.Threading.Tasks; -using Marechai.Database.Models; using Marechai.Areas.Admin.Models; +using Marechai.Database.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; @@ -40,42 +40,37 @@ using Microsoft.EntityFrameworkCore.Query; namespace Marechai.Areas.Admin.Controllers { - [Area("Admin")] - [Authorize] + [Area("Admin"), Authorize] public class CompaniesController : Controller { readonly MarechaiContext _context; - public CompaniesController(MarechaiContext context) - { - _context = context; - } + public CompaniesController(MarechaiContext context) => _context = context; // GET: Admin/Companies public async Task Index() { IIncludableQueryable marechaiContext = _context.Companies.Include(c => c.Country).Include(c => c.SoldTo); + return View(marechaiContext.OrderBy(c => c.Name).Select(c => new CompanyViewModel { - Id = c.Id, - Name = c.Name, - Founded = c.Founded, - Status = c.Status, - Country = c.Country.Name, - Sold = c.Sold, - SoldTo = c.SoldTo.Name + Id = c.Id, Name = c.Name, Founded = c.Founded, Status = c.Status, + Country = c.Country.Name, Sold = c.Sold, SoldTo = c.SoldTo.Name })); } // GET: Admin/Companies/Details/5 public async Task Details(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); - Company company = await _context.Companies.Include(c => c.Country).Include(c => c.SoldTo) - .FirstOrDefaultAsync(m => m.Id == id); - if(company == null) return NotFound(); + Company company = await _context.Companies.Include(c => c.Country).Include(c => c.SoldTo). + FirstOrDefaultAsync(m => m.Id == id); + + if(company == null) + return NotFound(); return View(company); } @@ -84,60 +79,67 @@ namespace Marechai.Areas.Admin.Controllers public IActionResult Create() { ViewData["CountryId"] = new SelectList(_context.Iso31661Numeric.OrderBy(c => c.Name), "Id", "Name"); - ViewData["SoldToId"] = new SelectList(_context.Companies.OrderBy(c => c.Name), "Id", "Name"); + ViewData["SoldToId"] = new SelectList(_context.Companies.OrderBy(c => c.Name), "Id", "Name"); + return View(); } // POST: Admin/Companies/Create // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Create( - [Bind( - "Id,Name,Founded,Website,Twitter,Facebook,Sold,SoldToId,Address,City,Province,PostalCode,CountryId,Status")] + [Bind("Id,Name,Founded,Website,Twitter,Facebook,Sold,SoldToId,Address,City,Province,PostalCode,CountryId,Status")] Company company) { if(ModelState.IsValid) { _context.Add(company); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } ViewData["CountryId"] = new SelectList(_context.Iso31661Numeric.OrderBy(c => c.Name), "Id", "Name", company.CountryId); + ViewData["SoldToId"] = new SelectList(_context.Companies.OrderBy(c => c.Name), "Id", "Name", company.SoldToId); + return View(company); } // GET: Admin/Companies/Edit/5 public async Task Edit(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); Company company = await _context.Companies.FindAsync(id); - if(company == null) return NotFound(); + + if(company == null) + return NotFound(); ViewData["CountryId"] = new SelectList(_context.Iso31661Numeric.OrderBy(c => c.Name), "Id", "Name", company.CountryId); + ViewData["SoldToId"] = new SelectList(_context.Companies.OrderBy(c => c.Name), "Id", "Name", company.SoldToId); + return View(company); } // POST: Admin/Companies/Edit/5 // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Edit( - int id, [Bind( - "Id,Name,Founded,Website,Twitter,Facebook,Sold,SoldToId,Address,City,Province,PostalCode,CountryId,Status")] + int id, + [Bind("Id,Name,Founded,Website,Twitter,Facebook,Sold,SoldToId,Address,City,Province,PostalCode,CountryId,Status")] Company company) { - if(id != company.Id) return NotFound(); + if(id != company.Id) + return NotFound(); if(ModelState.IsValid) { @@ -148,7 +150,8 @@ namespace Marechai.Areas.Admin.Controllers } catch(DbUpdateConcurrencyException) { - if(!CompanyExists(company.Id)) return NotFound(); + if(!CompanyExists(company.Id)) + return NotFound(); throw; } @@ -158,38 +161,39 @@ namespace Marechai.Areas.Admin.Controllers ViewData["CountryId"] = new SelectList(_context.Iso31661Numeric.OrderBy(c => c.Name), "Id", "Name", company.CountryId); + ViewData["SoldToId"] = new SelectList(_context.Companies.OrderBy(c => c.Name), "Id", "Name", company.SoldToId); + return View(company); } // GET: Admin/Companies/Delete/5 public async Task Delete(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); - Company company = await _context.Companies.Include(c => c.Country).Include(c => c.SoldTo) - .FirstOrDefaultAsync(m => m.Id == id); - if(company == null) return NotFound(); + Company company = await _context.Companies.Include(c => c.Country).Include(c => c.SoldTo). + FirstOrDefaultAsync(m => m.Id == id); + + if(company == null) + return NotFound(); return View(company); } // POST: Admin/Companies/Delete/5 - [HttpPost] - [ActionName("Delete")] - [ValidateAntiForgeryToken] + [HttpPost, ActionName("Delete"), ValidateAntiForgeryToken] public async Task DeleteConfirmed(int id) { Company company = await _context.Companies.FindAsync(id); _context.Companies.Remove(company); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - bool CompanyExists(int id) - { - return _context.Companies.Any(e => e.Id == id); - } + bool CompanyExists(int id) => _context.Companies.Any(e => e.Id == id); } } \ No newline at end of file diff --git a/Marechai/Areas/Admin/Controllers/CompanyDescriptionsController.cs b/Marechai/Areas/Admin/Controllers/CompanyDescriptionsController.cs index fa65c201..13b51de6 100644 --- a/Marechai/Areas/Admin/Controllers/CompanyDescriptionsController.cs +++ b/Marechai/Areas/Admin/Controllers/CompanyDescriptionsController.cs @@ -30,8 +30,8 @@ using System.Linq; using System.Threading.Tasks; -using Marechai.Database.Models; using Marechai.Areas.Admin.Models; +using Marechai.Database.Models; using Markdig; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; @@ -41,11 +41,10 @@ using Microsoft.EntityFrameworkCore.Query; namespace Marechai.Areas.Admin.Controllers { - [Area("Admin")] - [Authorize] + [Area("Admin"), Authorize] public class CompanyDescriptionsController : Controller { - readonly MarechaiContext _context; + readonly MarechaiContext _context; readonly MarkdownPipeline pipeline; public CompanyDescriptionsController(MarechaiContext context) @@ -59,22 +58,24 @@ namespace Marechai.Areas.Admin.Controllers { IIncludableQueryable marechaiContext = _context.CompanyDescriptions.Include(c => c.Company); - return View(await marechaiContext.OrderBy(c => c.Company.Name) - .Select(c => new CompanyDescriptionViewModel - { - Id = c.Id, Company = c.Company.Name - }).ToListAsync()); + + return View(await marechaiContext.OrderBy(c => c.Company.Name).Select(c => new CompanyDescriptionViewModel + { + Id = c.Id, Company = c.Company.Name + }).ToListAsync()); } // GET: CompanyDescription/Details/5 public async Task Details(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); - CompanyDescription companyDescription = await _context.CompanyDescriptions - .Include(c => c.Company) - .FirstOrDefaultAsync(m => m.Id == id); - if(companyDescription == null) return NotFound(); + CompanyDescription companyDescription = + await _context.CompanyDescriptions.Include(c => c.Company).FirstOrDefaultAsync(m => m.Id == id); + + if(companyDescription == null) + return NotFound(); return View(companyDescription); } @@ -83,14 +84,14 @@ namespace Marechai.Areas.Admin.Controllers public IActionResult Create() { ViewData["CompanyId"] = new SelectList(_context.Companies.OrderBy(c => c.Name), "Id", "Name"); + return View(); } // POST: CompanyDescription/Create - // To protect from overposting attacks, please enable the specific properties you want to bind to, for + // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Create([Bind("Id,CompanyId,Text")] CompanyDescription companyDescription) { if(ModelState.IsValid) @@ -98,35 +99,41 @@ namespace Marechai.Areas.Admin.Controllers companyDescription.Html = Markdown.ToHtml(companyDescription.Text, pipeline); _context.Add(companyDescription); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } ViewData["CompanyId"] = new SelectList(_context.Companies.OrderBy(c => c.Name), "Id", "Name", companyDescription.CompanyId); + return View(companyDescription); } // GET: CompanyDescription/Edit/5 public async Task Edit(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); CompanyDescription companyDescription = await _context.CompanyDescriptions.FindAsync(id); - if(companyDescription == null) return NotFound(); + + if(companyDescription == null) + return NotFound(); ViewData["CompanyId"] = new SelectList(_context.Companies.OrderBy(c => c.Name), "Id", "Name", companyDescription.CompanyId); + return View(companyDescription); } // POST: CompanyDescription/Edit/5 - // To protect from overposting attacks, please enable the specific properties you want to bind to, for + // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Edit(int id, [Bind("Id,CompanyId,Text")] CompanyDescription companyDescription) { - if(id != companyDescription.Id) return NotFound(); + if(id != companyDescription.Id) + return NotFound(); if(ModelState.IsValid) { @@ -138,7 +145,8 @@ namespace Marechai.Areas.Admin.Controllers } catch(DbUpdateConcurrencyException) { - if(!CompanyDescriptionExists(companyDescription.Id)) return NotFound(); + if(!CompanyDescriptionExists(companyDescription.Id)) + return NotFound(); throw; } @@ -148,37 +156,36 @@ namespace Marechai.Areas.Admin.Controllers ViewData["CompanyId"] = new SelectList(_context.Companies.OrderBy(c => c.Name), "Id", "Name", companyDescription.CompanyId); + return View(companyDescription); } // GET: CompanyDescription/Delete/5 public async Task Delete(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); - CompanyDescription companyDescription = await _context.CompanyDescriptions - .Include(c => c.Company) - .FirstOrDefaultAsync(m => m.Id == id); - if(companyDescription == null) return NotFound(); + CompanyDescription companyDescription = + await _context.CompanyDescriptions.Include(c => c.Company).FirstOrDefaultAsync(m => m.Id == id); + + if(companyDescription == null) + return NotFound(); return View(companyDescription); } // POST: CompanyDescription/Delete/5 - [HttpPost] - [ActionName("Delete")] - [ValidateAntiForgeryToken] + [HttpPost, ActionName("Delete"), ValidateAntiForgeryToken] public async Task DeleteConfirmed(int id) { CompanyDescription companyDescription = await _context.CompanyDescriptions.FindAsync(id); _context.CompanyDescriptions.Remove(companyDescription); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - bool CompanyDescriptionExists(int id) - { - return _context.CompanyDescriptions.Any(e => e.Id == id); - } + bool CompanyDescriptionExists(int id) => _context.CompanyDescriptions.Any(e => e.Id == id); } } \ No newline at end of file diff --git a/Marechai/Areas/Admin/Controllers/CompanyLogosController.cs b/Marechai/Areas/Admin/Controllers/CompanyLogosController.cs index a2c51669..d64387b9 100644 --- a/Marechai/Areas/Admin/Controllers/CompanyLogosController.cs +++ b/Marechai/Areas/Admin/Controllers/CompanyLogosController.cs @@ -4,8 +4,8 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Xml; -using Marechai.Database.Models; using Marechai.Areas.Admin.Models; +using Marechai.Database.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; @@ -17,11 +17,10 @@ using SKSvg = SkiaSharp.Extended.Svg.SKSvg; namespace Marechai.Areas.Admin.Controllers { - [Area("Admin")] - [Authorize] + [Area("Admin"), Authorize] public class CompanyLogosController : Controller { - readonly MarechaiContext _context; + readonly MarechaiContext _context; readonly IHostingEnvironment hostingEnvironment; public CompanyLogosController(MarechaiContext context, IHostingEnvironment env) @@ -34,21 +33,25 @@ namespace Marechai.Areas.Admin.Controllers public async Task Index() { IIncludableQueryable marechaiContext = _context.CompanyLogos.Include(c => c.Company); - return View(await marechaiContext.OrderBy(l => l.Company.Name).ThenBy(l => l.Year) - .Select(l => new CompanyLogoViewModel - { - Company = l.Company.Name, Id = l.Id, Year = l.Year - }).ToListAsync()); + + return View(await marechaiContext.OrderBy(l => l.Company.Name).ThenBy(l => l.Year). + Select(l => new CompanyLogoViewModel + { + Company = l.Company.Name, Id = l.Id, Year = l.Year + }).ToListAsync()); } // GET: CompanyLogos/Details/5 public async Task Details(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); - CompanyLogo companyLogo = await _context.CompanyLogos - .Include(c => c.Company).FirstOrDefaultAsync(m => m.Id == id); - if(companyLogo == null) return NotFound(); + CompanyLogo companyLogo = + await _context.CompanyLogos.Include(c => c.Company).FirstOrDefaultAsync(m => m.Id == id); + + if(companyLogo == null) + return NotFound(); return View(companyLogo); } @@ -57,10 +60,11 @@ namespace Marechai.Areas.Admin.Controllers // TODO: Upload public IActionResult Create() { - ViewData["CompanyId"] = - new - SelectList(_context.Companies.Select(c => new CompanyViewModel {Name = c.Name, Id = c.Id}).OrderBy(c => c.Name), - "Id", "Name"); + ViewData["CompanyId"] = new SelectList(_context.Companies.Select(c => new CompanyViewModel + { + Name = c.Name, Id = c.Id + }).OrderBy(c => c.Name), "Id", "Name"); + return View(); } @@ -68,20 +72,20 @@ namespace Marechai.Areas.Admin.Controllers // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. // TODO: Upload - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Create([Bind("Id,CompanyId,Year,SvgLogo")] CompanyLogo companyLogo) { if(!ModelState.IsValid) { - ViewData["CompanyId"] = - new - SelectList(_context.Companies.Select(c => new CompanyViewModel {Name = c.Name, Id = c.Id}).OrderBy(c => c.Name), - "Id", "Name", companyLogo.CompanyId); + ViewData["CompanyId"] = new SelectList(_context.Companies.Select(c => new CompanyViewModel + { + Name = c.Name, Id = c.Id + }).OrderBy(c => c.Name), "Id", "Name", companyLogo.CompanyId); + return View(companyLogo); } - using(MemoryStream svgMs = new MemoryStream()) + using(var svgMs = new MemoryStream()) { await companyLogo.SvgLogo.CopyToAsync(svgMs); @@ -89,9 +93,9 @@ namespace Marechai.Areas.Admin.Controllers try { - StreamReader sr = new StreamReader(svgMs, Encoding.UTF8); - string svgStr = await sr.ReadToEndAsync(); - XmlDocument xml = new XmlDocument(); + var sr = new StreamReader(svgMs, Encoding.UTF8); + string svgStr = await sr.ReadToEndAsync(); + var xml = new XmlDocument(); xml.LoadXml(svgStr); } catch(XmlException) @@ -99,10 +103,11 @@ namespace Marechai.Areas.Admin.Controllers companyLogo.SvgLogo = null; companyLogo.ErrorMessage = "Not a valid SVG file."; - ViewData["CompanyId"] = - new - SelectList(_context.Companies.Select(c => new CompanyViewModel {Name = c.Name, Id = c.Id}).OrderBy(c => c.Name), - "Id", "Name", companyLogo.CompanyId); + ViewData["CompanyId"] = new SelectList(_context.Companies.Select(c => new CompanyViewModel + { + Name = c.Name, Id = c.Id + }).OrderBy(c => c.Name), "Id", "Name", companyLogo.CompanyId); + return View(companyLogo); } @@ -111,19 +116,21 @@ namespace Marechai.Areas.Admin.Controllers string vectorial = Path.Combine(hostingEnvironment.WebRootPath, "assets/logos", companyLogo.Guid + ".svg"); + if(System.IO.File.Exists(vectorial)) { companyLogo.SvgLogo = null; companyLogo.ErrorMessage = "GUID clash, please retry and report to the administrator."; - ViewData["CompanyId"] = - new - SelectList(_context.Companies.Select(c => new CompanyViewModel {Name = c.Name, Id = c.Id}).OrderBy(c => c.Name), - "Id", "Name", companyLogo.CompanyId); + ViewData["CompanyId"] = new SelectList(_context.Companies.Select(c => new CompanyViewModel + { + Name = c.Name, Id = c.Id + }).OrderBy(c => c.Name), "Id", "Name", companyLogo.CompanyId); + return View(companyLogo); } - FileStream outSvg = new FileStream(vectorial, FileMode.CreateNew); + var outSvg = new FileStream(vectorial, FileMode.CreateNew); await svgMs.CopyToAsync(outSvg); svgMs.Position = 0; @@ -131,28 +138,39 @@ namespace Marechai.Areas.Admin.Controllers try { - foreach(string format in new[] {"png", "webp"}) + foreach(string format in new[] { - if(!Directory.Exists(Path.Combine(hostingEnvironment.WebRootPath, "assets/logos", format))) ; + "png", "webp" + }) + { + if(!Directory.Exists(Path.Combine(hostingEnvironment.WebRootPath, "assets/logos", format))) + ; + Directory.CreateDirectory(Path.Combine(hostingEnvironment.WebRootPath, "assets/logos", format)); SKEncodedImageFormat skFormat; + switch(format) { - case "webp": + case"webp": skFormat = SKEncodedImageFormat.Webp; + break; default: skFormat = SKEncodedImageFormat.Png; + break; } - foreach(int multiplier in new[] {1, 2, 3}) + foreach(int multiplier in new[] + { + 1, 2, 3 + }) { if(!Directory.Exists(Path.Combine(hostingEnvironment.WebRootPath, "assets/logos", format, $"{multiplier}x"))) - Directory.CreateDirectory(Path.Combine(hostingEnvironment.WebRootPath, "assets/logos", - format, $"{multiplier}x")); + Directory.CreateDirectory(Path.Combine(hostingEnvironment.WebRootPath, "assets/logos", + format, $"{multiplier}x")); string rendered = Path.Combine(hostingEnvironment.WebRootPath, "assets/logos", format, $"{multiplier}x", companyLogo.Guid + $".{format}"); @@ -163,29 +181,34 @@ namespace Marechai.Areas.Admin.Controllers companyLogo.ErrorMessage = "GUID clash, please retry and report to the administrator."; ViewData["CompanyId"] = - new - SelectList(_context.Companies.Select(c => new CompanyViewModel {Name = c.Name, Id = c.Id}).OrderBy(c => c.Name), - "Id", "Name", companyLogo.CompanyId); + new SelectList(_context.Companies.Select(c => new CompanyViewModel + { + Name = c.Name, Id = c.Id + }).OrderBy(c => c.Name), "Id", "Name", companyLogo.CompanyId); + return View(companyLogo); } Console.WriteLine("Rendering {0}", rendered); + if(svg == null) { svg = new SKSvg(); svg.Load(svgMs); } - SKRect svgSize = svg.Picture.CullRect; - SKMatrix matrix = SKMatrix.MakeScale(multiplier, multiplier); - SKBitmap bitmap = new SKBitmap((int)(svgSize.Width * multiplier), - (int)(svgSize.Height * multiplier)); - SKCanvas canvas = new SKCanvas(bitmap); + SKRect svgSize = svg.Picture.CullRect; + var matrix = SKMatrix.MakeScale(multiplier, multiplier); + + var bitmap = new SKBitmap((int)(svgSize.Width * multiplier), + (int)(svgSize.Height * multiplier)); + + var canvas = new SKCanvas(bitmap); canvas.DrawPicture(svg.Picture, ref matrix); canvas.Flush(); - SKImage image = SKImage.FromBitmap(bitmap); - SKData data = image.Encode(skFormat, 100); - FileStream outfs = new FileStream(rendered, FileMode.CreateNew); + var image = SKImage.FromBitmap(bitmap); + SKData data = image.Encode(skFormat, 100); + var outfs = new FileStream(rendered, FileMode.CreateNew); data.SaveTo(outfs); outfs.Close(); @@ -193,30 +216,40 @@ namespace Marechai.Areas.Admin.Controllers } } - foreach(string format in new[] {"png", "webp"}) + foreach(string format in new[] + { + "png", "webp" + }) { if(!Directory.Exists(Path.Combine(hostingEnvironment.WebRootPath, "assets/logos/thumbs", format))) - Directory.CreateDirectory(Path.Combine(hostingEnvironment.WebRootPath, "assets/logos/thumbs", - format)); + Directory.CreateDirectory(Path.Combine(hostingEnvironment.WebRootPath, + "assets/logos/thumbs", format)); SKEncodedImageFormat skFormat; + switch(format) { - case "webp": + case"webp": skFormat = SKEncodedImageFormat.Webp; + break; default: skFormat = SKEncodedImageFormat.Png; + break; } - foreach(int multiplier in new[] {1, 2, 3}) + foreach(int multiplier in new[] + { + 1, 2, 3 + }) { if(!Directory.Exists(Path.Combine(hostingEnvironment.WebRootPath, "assets/logos/thumbs", format, $"{multiplier}x"))) - Directory.CreateDirectory(Path.Combine(hostingEnvironment.WebRootPath, - "assets/logos/thumbs", format, $"{multiplier}x")); + Directory.CreateDirectory(Path.Combine(hostingEnvironment.WebRootPath, + "assets/logos/thumbs", format, + $"{multiplier}x")); string rendered = Path.Combine(hostingEnvironment.WebRootPath, "assets/logos/thumbs", format, $"{multiplier}x", companyLogo.Guid + $".{format}"); @@ -227,32 +260,37 @@ namespace Marechai.Areas.Admin.Controllers companyLogo.ErrorMessage = "GUID clash, please retry and report to the administrator."; ViewData["CompanyId"] = - new - SelectList(_context.Companies.Select(c => new CompanyViewModel {Name = c.Name, Id = c.Id}).OrderBy(c => c.Name), - "Id", "Name", companyLogo.CompanyId); + new SelectList(_context.Companies.Select(c => new CompanyViewModel + { + Name = c.Name, Id = c.Id + }).OrderBy(c => c.Name), "Id", "Name", companyLogo.CompanyId); + return View(companyLogo); } Console.WriteLine("Rendering {0}", rendered); + if(svg == null) { svg = new SKSvg(); svg.Load(svgMs); } - SKRect svgSize = svg.Picture.CullRect; - float svgMax = Math.Max(svgSize.Width, svgSize.Height); - float canvasMin = 32 * multiplier; - float scale = canvasMin / svgMax; - SKMatrix matrix = SKMatrix.MakeScale(scale, scale); - SKBitmap bitmap = + SKRect svgSize = svg.Picture.CullRect; + float svgMax = Math.Max(svgSize.Width, svgSize.Height); + float canvasMin = 32 * multiplier; + float scale = canvasMin / svgMax; + var matrix = SKMatrix.MakeScale(scale, scale); + + var bitmap = new SKBitmap((int)(svgSize.Width * scale), (int)(svgSize.Height * scale)); - SKCanvas canvas = new SKCanvas(bitmap); + + var canvas = new SKCanvas(bitmap); canvas.DrawPicture(svg.Picture, ref matrix); canvas.Flush(); - SKImage image = SKImage.FromBitmap(bitmap); - SKData data = image.Encode(skFormat, 100); - FileStream outfs = new FileStream(rendered, FileMode.CreateNew); + var image = SKImage.FromBitmap(bitmap); + SKData data = image.Encode(skFormat, 100); + var outfs = new FileStream(rendered, FileMode.CreateNew); data.SaveTo(outfs); outfs.Close(); @@ -263,36 +301,42 @@ namespace Marechai.Areas.Admin.Controllers catch(IOException e) { Console.WriteLine(e); + throw; } } _context.Add(companyLogo); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } // GET: CompanyLogos/Edit/5 public async Task Edit(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); CompanyLogo companyLogo = await _context.CompanyLogos.FirstOrDefaultAsync(c => c.Id == id); - if(companyLogo == null) return NotFound(); + + if(companyLogo == null) + return NotFound(); ViewData["CompanyId"] = new SelectList(_context.Companies.OrderBy(l => l.Name), "Id", "Name", companyLogo.CompanyId); + return View(companyLogo); } // POST: CompanyLogos/Edit/5 // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Edit(int id, [Bind("Id,CompanyId,Year,Guid")] CompanyLogo companyLogo) { - if(id != companyLogo.Id) return NotFound(); + if(id != companyLogo.Id) + return NotFound(); if(ModelState.IsValid) { @@ -303,7 +347,8 @@ namespace Marechai.Areas.Admin.Controllers } catch(DbUpdateConcurrencyException) { - if(!CompanyLogoExists(companyLogo.Id)) return NotFound(); + if(!CompanyLogoExists(companyLogo.Id)) + return NotFound(); throw; } @@ -313,38 +358,40 @@ namespace Marechai.Areas.Admin.Controllers ViewData["CompanyId"] = new SelectList(_context.Companies.OrderBy(l => l.Name), "Id", "Name", companyLogo.CompanyId); + return View(companyLogo); } // GET: CompanyLogos/Delete/5 public async Task Delete(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); - CompanyLogo companyLogo = await _context.CompanyLogos - .Include(c => c.Company).FirstOrDefaultAsync(m => m.Id == id); - if(companyLogo == null) return NotFound(); + CompanyLogo companyLogo = + await _context.CompanyLogos.Include(c => c.Company).FirstOrDefaultAsync(m => m.Id == id); + + if(companyLogo == null) + return NotFound(); return View(companyLogo); } // POST: CompanyLogos/Delete/5 - [HttpPost] - [ActionName("Delete")] - [ValidateAntiForgeryToken] + [HttpPost, ActionName("Delete"), ValidateAntiForgeryToken] public async Task DeleteConfirmed(int id) { CompanyLogo companyLogo = await _context.CompanyLogos.FirstOrDefaultAsync(m => m.Id == id); - if(companyLogo == null) return NotFound(); + + if(companyLogo == null) + return NotFound(); _context.CompanyLogos.Remove(companyLogo); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - bool CompanyLogoExists(int id) - { - return _context.CompanyLogos.Any(e => e.Id == id); - } + bool CompanyLogoExists(int id) => _context.CompanyLogos.Any(e => e.Id == id); } } \ No newline at end of file diff --git a/Marechai/Areas/Admin/Controllers/DocumentCompaniesController.cs b/Marechai/Areas/Admin/Controllers/DocumentCompaniesController.cs index aa5bdec0..83d2eb5b 100644 --- a/Marechai/Areas/Admin/Controllers/DocumentCompaniesController.cs +++ b/Marechai/Areas/Admin/Controllers/DocumentCompaniesController.cs @@ -1,7 +1,7 @@ using System.Linq; using System.Threading.Tasks; -using Marechai.Database.Models; using Marechai.Areas.Admin.Models; +using Marechai.Database.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; @@ -9,45 +9,37 @@ using Microsoft.EntityFrameworkCore; namespace Marechai.Areas.Admin.Controllers { - [Area("Admin")] - [Authorize] + [Area("Admin"), Authorize] public class DocumentCompaniesController : Controller { readonly MarechaiContext _context; - public DocumentCompaniesController(MarechaiContext context) - { - _context = context; - } + public DocumentCompaniesController(MarechaiContext context) => _context = context; // GET: DocumentCompanies - public async Task Index() - { - return View(await _context.DocumentCompanies.OrderBy(c => c.Name) - .Select(d => new DocumentCompanyViewModel - { - Id = d.Id, - Name = d.Name, - Company = d.Company.Name, - CompanyId = d.CompanyId - }).ToListAsync()); - } + public async Task Index() => View(await _context. + DocumentCompanies.OrderBy(c => c.Name). + Select(d => new DocumentCompanyViewModel + { + Id = d.Id, Name = d.Name, + Company = d.Company.Name, + CompanyId = d.CompanyId + }).ToListAsync()); // GET: DocumentCompanies/Details/5 public async Task Details(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); DocumentCompanyViewModel documentCompany = - await _context.DocumentCompanies - .Select(d => new DocumentCompanyViewModel - { - Id = d.Id, - Name = d.Name, - Company = d.Company.Name, - CompanyId = d.CompanyId - }).FirstOrDefaultAsync(m => m.Id == id); - if(documentCompany == null) return NotFound(); + await _context.DocumentCompanies.Select(d => new DocumentCompanyViewModel + { + Id = d.Id, Name = d.Name, Company = d.Company.Name, CompanyId = d.CompanyId + }).FirstOrDefaultAsync(m => m.Id == id); + + if(documentCompany == null) + return NotFound(); return View(documentCompany); } @@ -55,49 +47,56 @@ namespace Marechai.Areas.Admin.Controllers // GET: DocumentCompanies/Create public IActionResult Create() { - ViewData["CompanyId"] = - new SelectList(_context.Companies.OrderBy(c => c.Name).Select(c => new {c.Id, c.Name}), "Id", "Name"); + ViewData["CompanyId"] = new SelectList(_context.Companies.OrderBy(c => c.Name).Select(c => new + { + c.Id, c.Name + }), "Id", "Name"); + return View(); } // POST: DocumentCompanies/Create - // To protect from overposting attacks, please enable the specific properties you want to bind to, for + // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Create([Bind("Name,CompanyId,Id")] DocumentCompany documentCompany) { - if(!ModelState.IsValid) return View(documentCompany); + if(!ModelState.IsValid) + return View(documentCompany); _context.Add(documentCompany); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } // GET: DocumentCompanies/Edit/5 public async Task Edit(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); DocumentCompany documentCompany = await _context.DocumentCompanies.FindAsync(id); - if(documentCompany == null) return NotFound(); + if(documentCompany == null) + return NotFound(); - ViewData["CompanyId"] = - new SelectList(_context.Companies.OrderBy(c => c.Name).Select(c => new {c.Id, c.Name}), "Id", "Name", - documentCompany.CompanyId); + ViewData["CompanyId"] = new SelectList(_context.Companies.OrderBy(c => c.Name).Select(c => new + { + c.Id, c.Name + }), "Id", "Name", documentCompany.CompanyId); return View(documentCompany); } // POST: DocumentCompanies/Edit/5 - // To protect from overposting attacks, please enable the specific properties you want to bind to, for + // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Edit(int id, [Bind("Name,CompanyId,Id")] DocumentCompany documentCompany) { - if(id != documentCompany.Id) return NotFound(); + if(id != documentCompany.Id) + return NotFound(); if(ModelState.IsValid) { @@ -108,7 +107,8 @@ namespace Marechai.Areas.Admin.Controllers } catch(DbUpdateConcurrencyException) { - if(!DocumentCompanyExists(documentCompany.Id)) return NotFound(); + if(!DocumentCompanyExists(documentCompany.Id)) + return NotFound(); throw; } @@ -116,9 +116,10 @@ namespace Marechai.Areas.Admin.Controllers return RedirectToAction(nameof(Index)); } - ViewData["CompanyId"] = - new SelectList(_context.Companies.OrderBy(c => c.Name).Select(c => new {c.Id, c.Name}), "Id", "Name", - documentCompany.CompanyId); + ViewData["CompanyId"] = new SelectList(_context.Companies.OrderBy(c => c.Name).Select(c => new + { + c.Id, c.Name + }), "Id", "Name", documentCompany.CompanyId); return View(documentCompany); } @@ -126,37 +127,32 @@ namespace Marechai.Areas.Admin.Controllers // GET: DocumentCompanies/Delete/5 public async Task Delete(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); DocumentCompanyViewModel documentCompany = - await _context.DocumentCompanies - .Select(d => new DocumentCompanyViewModel - { - Id = d.Id, - Name = d.Name, - Company = d.Company.Name, - CompanyId = d.CompanyId - }).FirstOrDefaultAsync(m => m.Id == id); - if(documentCompany == null) return NotFound(); + await _context.DocumentCompanies.Select(d => new DocumentCompanyViewModel + { + Id = d.Id, Name = d.Name, Company = d.Company.Name, CompanyId = d.CompanyId + }).FirstOrDefaultAsync(m => m.Id == id); + + if(documentCompany == null) + return NotFound(); return View(documentCompany); } // POST: DocumentCompanies/Delete/5 - [HttpPost] - [ActionName("Delete")] - [ValidateAntiForgeryToken] + [HttpPost, ActionName("Delete"), ValidateAntiForgeryToken] public async Task DeleteConfirmed(int id) { DocumentCompany documentCompany = await _context.DocumentCompanies.FindAsync(id); _context.DocumentCompanies.Remove(documentCompany); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - bool DocumentCompanyExists(int id) - { - return _context.DocumentCompanies.Any(e => e.Id == id); - } + bool DocumentCompanyExists(int id) => _context.DocumentCompanies.Any(e => e.Id == id); } } \ No newline at end of file diff --git a/Marechai/Areas/Admin/Controllers/DocumentPeopleController.cs b/Marechai/Areas/Admin/Controllers/DocumentPeopleController.cs index 7ee445c3..c9b28811 100644 --- a/Marechai/Areas/Admin/Controllers/DocumentPeopleController.cs +++ b/Marechai/Areas/Admin/Controllers/DocumentPeopleController.cs @@ -1,7 +1,7 @@ using System.Linq; using System.Threading.Tasks; -using Marechai.Database.Models; using Marechai.Areas.Admin.Models; +using Marechai.Database.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; @@ -9,37 +9,32 @@ using Microsoft.EntityFrameworkCore; namespace Marechai.Areas.Admin.Controllers { - [Area("Admin")] - [Authorize] + [Area("Admin"), Authorize] public class DocumentPeopleController : Controller { readonly MarechaiContext _context; - public DocumentPeopleController(MarechaiContext context) - { - _context = context; - } + public DocumentPeopleController(MarechaiContext context) => _context = context; // GET: DocumentPeople - public async Task Index() - { - return View(await _context.DocumentPeople.OrderBy(d => d.FullName) - .Select(d => new DocumentPersonViewModel - { - Id = d.Id, - Name = d.FullName, - Person = d.Person.FullName, - PersonId = d.PersonId - }).ToListAsync()); - } + public async Task Index() => View(await _context. + DocumentPeople.OrderBy(d => d.FullName). + Select(d => new DocumentPersonViewModel + { + Id = d.Id, Name = d.FullName, + Person = d.Person.FullName, PersonId = d.PersonId + }).ToListAsync()); // GET: DocumentPeople/Details/5 public async Task Details(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); DocumentPerson documentPerson = await _context.DocumentPeople.FirstOrDefaultAsync(m => m.Id == id); - if(documentPerson == null) return NotFound(); + + if(documentPerson == null) + return NotFound(); return View(documentPerson); } @@ -47,39 +42,45 @@ namespace Marechai.Areas.Admin.Controllers // GET: DocumentPeople/Create public IActionResult Create() { - ViewData["PersonId"] = - new SelectList(_context.People.OrderBy(c => c.FullName).Select(c => new {c.Id, Name = c.FullName}), - "Id", "Name"); + ViewData["PersonId"] = new SelectList(_context.People.OrderBy(c => c.FullName).Select(c => new + { + c.Id, Name = c.FullName + }), "Id", "Name"); + return View(); } // POST: DocumentPeople/Create // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Create([Bind("Name,Surname,Alias,DisplayName,PersonId,Id")] DocumentPerson documentPerson) { - if(!ModelState.IsValid) return View(documentPerson); + if(!ModelState.IsValid) + return View(documentPerson); _context.Add(documentPerson); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } // GET: DocumentPeople/Edit/5 public async Task Edit(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); DocumentPerson documentPerson = await _context.DocumentPeople.FindAsync(id); - if(documentPerson == null) return NotFound(); + if(documentPerson == null) + return NotFound(); - ViewData["PersonId"] = - new SelectList(_context.People.OrderBy(c => c.FullName).Select(c => new {c.Id, Name = c.FullName}), - "Id", "Name", documentPerson.PersonId); + ViewData["PersonId"] = new SelectList(_context.People.OrderBy(c => c.FullName).Select(c => new + { + c.Id, Name = c.FullName + }), "Id", "Name", documentPerson.PersonId); return View(documentPerson); } @@ -87,12 +88,12 @@ namespace Marechai.Areas.Admin.Controllers // POST: DocumentPeople/Edit/5 // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Edit(int id, [Bind("Name,Surname,Alias,DisplayName,PersonId,Id")] DocumentPerson documentPerson) { - if(id != documentPerson.Id) return NotFound(); + if(id != documentPerson.Id) + return NotFound(); if(ModelState.IsValid) { @@ -103,7 +104,8 @@ namespace Marechai.Areas.Admin.Controllers } catch(DbUpdateConcurrencyException) { - if(!DocumentPersonExists(documentPerson.Id)) return NotFound(); + if(!DocumentPersonExists(documentPerson.Id)) + return NotFound(); throw; } @@ -111,9 +113,10 @@ namespace Marechai.Areas.Admin.Controllers return RedirectToAction(nameof(Index)); } - ViewData["PersonId"] = - new SelectList(_context.People.OrderBy(c => c.FullName).Select(c => new {c.Id, Name = c.FullName}), - "Id", "Name", documentPerson.PersonId); + ViewData["PersonId"] = new SelectList(_context.People.OrderBy(c => c.FullName).Select(c => new + { + c.Id, Name = c.FullName + }), "Id", "Name", documentPerson.PersonId); return View(documentPerson); } @@ -121,29 +124,28 @@ namespace Marechai.Areas.Admin.Controllers // GET: DocumentPeople/Delete/5 public async Task Delete(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); DocumentPerson documentPerson = await _context.DocumentPeople.FirstOrDefaultAsync(m => m.Id == id); - if(documentPerson == null) return NotFound(); + + if(documentPerson == null) + return NotFound(); return View(documentPerson); } // POST: DocumentPeople/Delete/5 - [HttpPost] - [ActionName("Delete")] - [ValidateAntiForgeryToken] + [HttpPost, ActionName("Delete"), ValidateAntiForgeryToken] public async Task DeleteConfirmed(int id) { DocumentPerson documentPerson = await _context.DocumentPeople.FindAsync(id); _context.DocumentPeople.Remove(documentPerson); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - bool DocumentPersonExists(int id) - { - return _context.DocumentPeople.Any(e => e.Id == id); - } + bool DocumentPersonExists(int id) => _context.DocumentPeople.Any(e => e.Id == id); } } \ No newline at end of file diff --git a/Marechai/Areas/Admin/Controllers/GpusByMachineController.cs b/Marechai/Areas/Admin/Controllers/GpusByMachineController.cs index 17ab2533..aa4a5663 100644 --- a/Marechai/Areas/Admin/Controllers/GpusByMachineController.cs +++ b/Marechai/Areas/Admin/Controllers/GpusByMachineController.cs @@ -1,7 +1,7 @@ using System.Linq; using System.Threading.Tasks; -using Marechai.Database.Models; using Marechai.Areas.Admin.Models; +using Marechai.Database.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; @@ -10,38 +10,38 @@ using Microsoft.EntityFrameworkCore.Query; namespace Marechai.Areas.Admin.Controllers { - [Area("Admin")] - [Authorize] + [Area("Admin"), Authorize] public class GpusByMachineController : Controller { readonly MarechaiContext _context; - public GpusByMachineController(MarechaiContext context) - { - _context = context; - } + public GpusByMachineController(MarechaiContext context) => _context = context; // GET: GpusByMachine public async Task Index() { IIncludableQueryable marechaiContext = _context.GpusByMachine.Include(g => g.Gpu).Include(g => g.Machine); - return View(await marechaiContext.OrderBy(g => g.Machine.Name).ThenBy(g => g.Gpu.Name) - .Select(g => new GpusByMachineViewModel - { - Id = g.Id, Gpu = g.Gpu.Name, Machine = g.Machine.Name - }).ToListAsync()); + + return View(await marechaiContext.OrderBy(g => g.Machine.Name).ThenBy(g => g.Gpu.Name). + Select(g => new GpusByMachineViewModel + { + Id = g.Id, Gpu = g.Gpu.Name, Machine = g.Machine.Name + }).ToListAsync()); } // GET: GpusByMachine/Details/5 public async Task Details(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); - GpusByMachine gpusByMachine = await _context.GpusByMachine - .Include(g => g.Gpu).Include(g => g.Machine) - .FirstOrDefaultAsync(m => m.Id == id); - if(gpusByMachine == null) return NotFound(); + GpusByMachine gpusByMachine = await _context. + GpusByMachine.Include(g => g.Gpu).Include(g => g.Machine). + FirstOrDefaultAsync(m => m.Id == id); + + if(gpusByMachine == null) + return NotFound(); return View(gpusByMachine); } @@ -49,53 +49,61 @@ namespace Marechai.Areas.Admin.Controllers // GET: GpusByMachine/Create public IActionResult Create() { - ViewData["GpuId"] = new SelectList(_context.Gpus.OrderBy(g => g.Name), "Id", "Name"); + ViewData["GpuId"] = new SelectList(_context.Gpus.OrderBy(g => g.Name), "Id", "Name"); ViewData["MachineId"] = new SelectList(_context.Machines.OrderBy(m => m.Name), "Id", "Name"); + return View(); } // POST: GpusByMachine/Create // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Create([Bind("GpuId,MachineId,Id")] GpusByMachine gpusByMachine) { if(ModelState.IsValid) { _context.Add(gpusByMachine); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } ViewData["GpuId"] = new SelectList(_context.Gpus.OrderBy(g => g.Name), "Id", "Name", gpusByMachine.GpuId); + ViewData["MachineId"] = new SelectList(_context.Machines.OrderBy(m => m.Name), "Id", "Name", gpusByMachine.MachineId); + return View(gpusByMachine); } // GET: GpusByMachine/Edit/5 public async Task Edit(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); GpusByMachine gpusByMachine = await _context.GpusByMachine.FindAsync(id); - if(gpusByMachine == null) return NotFound(); + + if(gpusByMachine == null) + return NotFound(); ViewData["GpuId"] = new SelectList(_context.Gpus.OrderBy(g => g.Name), "Id", "Name", gpusByMachine.GpuId); + ViewData["MachineId"] = new SelectList(_context.Machines.OrderBy(m => m.Name), "Id", "Name", gpusByMachine.MachineId); + return View(gpusByMachine); } // POST: GpusByMachine/Edit/5 // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Edit(long id, [Bind("GpuId,MachineId,Id")] GpusByMachine gpusByMachine) { - if(id != gpusByMachine.Id) return NotFound(); + if(id != gpusByMachine.Id) + return NotFound(); if(ModelState.IsValid) { @@ -106,7 +114,8 @@ namespace Marechai.Areas.Admin.Controllers } catch(DbUpdateConcurrencyException) { - if(!GpusByMachineExists(gpusByMachine.Id)) return NotFound(); + if(!GpusByMachineExists(gpusByMachine.Id)) + return NotFound(); throw; } @@ -115,39 +124,40 @@ namespace Marechai.Areas.Admin.Controllers } ViewData["GpuId"] = new SelectList(_context.Gpus.OrderBy(g => g.Name), "Id", "Name", gpusByMachine.GpuId); + ViewData["MachineId"] = new SelectList(_context.Machines.OrderBy(m => m.Name), "Id", "Name", gpusByMachine.MachineId); + return View(gpusByMachine); } // GET: GpusByMachine/Delete/5 public async Task Delete(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); - GpusByMachine gpusByMachine = await _context.GpusByMachine - .Include(g => g.Gpu).Include(g => g.Machine) - .FirstOrDefaultAsync(m => m.Id == id); - if(gpusByMachine == null) return NotFound(); + GpusByMachine gpusByMachine = await _context. + GpusByMachine.Include(g => g.Gpu).Include(g => g.Machine). + FirstOrDefaultAsync(m => m.Id == id); + + if(gpusByMachine == null) + return NotFound(); return View(gpusByMachine); } // POST: GpusByMachine/Delete/5 - [HttpPost] - [ActionName("Delete")] - [ValidateAntiForgeryToken] + [HttpPost, ActionName("Delete"), ValidateAntiForgeryToken] public async Task DeleteConfirmed(long id) { GpusByMachine gpusByMachine = await _context.GpusByMachine.FindAsync(id); _context.GpusByMachine.Remove(gpusByMachine); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - bool GpusByMachineExists(long id) - { - return _context.GpusByMachine.Any(e => e.Id == id); - } + bool GpusByMachineExists(long id) => _context.GpusByMachine.Any(e => e.Id == id); } } \ No newline at end of file diff --git a/Marechai/Areas/Admin/Controllers/GpusByOwnedMachineController.cs b/Marechai/Areas/Admin/Controllers/GpusByOwnedMachineController.cs index c19c5f30..edab85a8 100644 --- a/Marechai/Areas/Admin/Controllers/GpusByOwnedMachineController.cs +++ b/Marechai/Areas/Admin/Controllers/GpusByOwnedMachineController.cs @@ -1,7 +1,7 @@ using System.Linq; using System.Threading.Tasks; -using Marechai.Database.Models; using Marechai.Areas.Admin.Models; +using Marechai.Database.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; @@ -10,48 +10,45 @@ using Microsoft.EntityFrameworkCore.Query; namespace Marechai.Areas.Admin.Controllers { - [Area("Admin")] - [Authorize] + [Area("Admin"), Authorize] public class GpusByOwnedMachineController : Controller { readonly MarechaiContext _context; - public GpusByOwnedMachineController(MarechaiContext context) - { - _context = context; - } + public GpusByOwnedMachineController(MarechaiContext context) => _context = context; // GET: GpusByOwnedMachine public async Task Index() { IIncludableQueryable marechaiContext = _context.GpusByOwnedMachine.Include(g => g.Gpu).Include(g => g.OwnedMachine); - return View(await marechaiContext.OrderBy(g => g.OwnedMachine.Machine.Name).ThenBy(g => g.Gpu.Name) - .Select(g => new GpusByMachineViewModel - { - Id = g.Id, - Gpu = g.Gpu.Name, - Machine = - $"{g.OwnedMachine.Machine.Company.Name} {g.OwnedMachine.Machine.Name} <{g.OwnedMachine.User.UserName}>" - }).ToListAsync()); + + return View(await marechaiContext.OrderBy(g => g.OwnedMachine.Machine.Name).ThenBy(g => g.Gpu.Name). + Select(g => new GpusByMachineViewModel + { + Id = g.Id, Gpu = g.Gpu.Name, + Machine = + $"{g.OwnedMachine.Machine.Company.Name} {g.OwnedMachine.Machine.Name} <{g.OwnedMachine.User.UserName}>" + }).ToListAsync()); } // GET: GpusByOwnedMachine/Details/5 public async Task Details(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); - GpusByMachineViewModel gpusByOwnedMachine = await _context.GpusByOwnedMachine - .Include(g => g.Gpu).Include(g => g.OwnedMachine) - .Select(o => new GpusByMachineViewModel - { - Gpu = o.Gpu.Name, - Id = o.Id, - Machine = - $"{o.OwnedMachine.Machine.Company.Name} {o.OwnedMachine.Machine.Name} <{o.OwnedMachine.User.UserName}>" - }).FirstOrDefaultAsync(m => m.Id == - id); - if(gpusByOwnedMachine == null) return NotFound(); + GpusByMachineViewModel gpusByOwnedMachine = + await _context.GpusByOwnedMachine.Include(g => g.Gpu).Include(g => g.OwnedMachine). + Select(o => new GpusByMachineViewModel + { + Gpu = o.Gpu.Name, Id = o.Id, + Machine = + $"{o.OwnedMachine.Machine.Company.Name} {o.OwnedMachine.Machine.Name} <{o.OwnedMachine.User.UserName}>" + }).FirstOrDefaultAsync(m => m.Id == id); + + if(gpusByOwnedMachine == null) + return NotFound(); return View(gpusByOwnedMachine); } @@ -60,62 +57,83 @@ namespace Marechai.Areas.Admin.Controllers public IActionResult Create() { ViewData["GpuId"] = new SelectList(_context.Gpus.OrderBy(g => g.Name), "Id", "Name"); - ViewData["OwnedMachineId"] = - new - SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name).ThenBy(m => m.Machine.Name).ThenBy(m => m.User.UserName).Select(m => new {m.Id, Name = $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>"}), - "Id", "Name"); + + ViewData["OwnedMachineId"] = new SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name). + ThenBy(m => m.Machine.Name). + ThenBy(m => m.User.UserName).Select(m => new + { + m.Id, + Name = + $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>" + }), "Id", "Name"); + return View(); } // POST: GpusByOwnedMachine/Create - // To protect from overposting attacks, please enable the specific properties you want to bind to, for + // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Create([Bind("GpuId,OwnedMachineId,Id")] GpusByOwnedMachine gpusByOwnedMachine) { if(ModelState.IsValid) { _context.Add(gpusByOwnedMachine); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } ViewData["GpuId"] = new SelectList(_context.Gpus.OrderBy(g => g.Name), "Id", "Name", gpusByOwnedMachine.GpuId); - ViewData["OwnedMachineId"] = - new - SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name).ThenBy(m => m.Machine.Name).ThenBy(m => m.User.UserName).Select(m => new {m.Id, Name = $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>"}), - "Id", "Name", gpusByOwnedMachine.OwnedMachineId); + + ViewData["OwnedMachineId"] = new SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name). + ThenBy(m => m.Machine.Name). + ThenBy(m => m.User.UserName).Select(m => new + { + m.Id, + Name = + $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>" + }), "Id", "Name", gpusByOwnedMachine.OwnedMachineId); + return View(gpusByOwnedMachine); } // GET: GpusByOwnedMachine/Edit/5 public async Task Edit(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); GpusByOwnedMachine gpusByOwnedMachine = await _context.GpusByOwnedMachine.FindAsync(id); - if(gpusByOwnedMachine == null) return NotFound(); + + if(gpusByOwnedMachine == null) + return NotFound(); ViewData["GpuId"] = new SelectList(_context.Gpus.OrderBy(g => g.Name), "Id", "Name", gpusByOwnedMachine.GpuId); - ViewData["OwnedMachineId"] = - new - SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name).ThenBy(m => m.Machine.Name).ThenBy(m => m.User.UserName).Select(m => new {m.Id, Name = $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>"}), - "Id", "Name", gpusByOwnedMachine.OwnedMachineId); + + ViewData["OwnedMachineId"] = new SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name). + ThenBy(m => m.Machine.Name). + ThenBy(m => m.User.UserName).Select(m => new + { + m.Id, + Name = + $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>" + }), "Id", "Name", gpusByOwnedMachine.OwnedMachineId); + return View(gpusByOwnedMachine); } // POST: GpusByOwnedMachine/Edit/5 - // To protect from overposting attacks, please enable the specific properties you want to bind to, for + // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Edit( long id, [Bind("GpuId,OwnedMachineId,Id")] GpusByOwnedMachine gpusByOwnedMachine) { - if(id != gpusByOwnedMachine.Id) return NotFound(); + if(id != gpusByOwnedMachine.Id) + return NotFound(); if(ModelState.IsValid) { @@ -126,7 +144,8 @@ namespace Marechai.Areas.Admin.Controllers } catch(DbUpdateConcurrencyException) { - if(!GpusByOwnedMachineExists(gpusByOwnedMachine.Id)) return NotFound(); + if(!GpusByOwnedMachineExists(gpusByOwnedMachine.Id)) + return NotFound(); throw; } @@ -136,48 +155,51 @@ namespace Marechai.Areas.Admin.Controllers ViewData["GpuId"] = new SelectList(_context.Gpus.OrderBy(g => g.Name), "Id", "Name", gpusByOwnedMachine.GpuId); - ViewData["OwnedMachineId"] = - new - SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name).ThenBy(m => m.Machine.Name).ThenBy(m => m.User.UserName).Select(m => new {m.Id, Name = $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>"}), - "Id", "Name", gpusByOwnedMachine.OwnedMachineId); + + ViewData["OwnedMachineId"] = new SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name). + ThenBy(m => m.Machine.Name). + ThenBy(m => m.User.UserName).Select(m => new + { + m.Id, + Name = + $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>" + }), "Id", "Name", gpusByOwnedMachine.OwnedMachineId); + return View(gpusByOwnedMachine); } // GET: GpusByOwnedMachine/Delete/5 public async Task Delete(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); - GpusByMachineViewModel gpusByOwnedMachine = await _context.GpusByOwnedMachine - .Include(g => g.Gpu).Include(g => g.OwnedMachine) - .Select(o => new GpusByMachineViewModel - { - Gpu = o.Gpu.Name, - Id = o.Id, - Machine = - $"{o.OwnedMachine.Machine.Company.Name} {o.OwnedMachine.Machine.Name} <{o.OwnedMachine.User.UserName}>" - }).FirstOrDefaultAsync(m => m.Id == - id); - if(gpusByOwnedMachine == null) return NotFound(); + GpusByMachineViewModel gpusByOwnedMachine = + await _context.GpusByOwnedMachine.Include(g => g.Gpu).Include(g => g.OwnedMachine). + Select(o => new GpusByMachineViewModel + { + Gpu = o.Gpu.Name, Id = o.Id, + Machine = + $"{o.OwnedMachine.Machine.Company.Name} {o.OwnedMachine.Machine.Name} <{o.OwnedMachine.User.UserName}>" + }).FirstOrDefaultAsync(m => m.Id == id); + + if(gpusByOwnedMachine == null) + return NotFound(); return View(gpusByOwnedMachine); } // POST: GpusByOwnedMachine/Delete/5 - [HttpPost] - [ActionName("Delete")] - [ValidateAntiForgeryToken] + [HttpPost, ActionName("Delete"), ValidateAntiForgeryToken] public async Task DeleteConfirmed(long id) { GpusByOwnedMachine gpusByOwnedMachine = await _context.GpusByOwnedMachine.FindAsync(id); _context.GpusByOwnedMachine.Remove(gpusByOwnedMachine); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - bool GpusByOwnedMachineExists(long id) - { - return _context.GpusByOwnedMachine.Any(e => e.Id == id); - } + bool GpusByOwnedMachineExists(long id) => _context.GpusByOwnedMachine.Any(e => e.Id == id); } } \ No newline at end of file diff --git a/Marechai/Areas/Admin/Controllers/GpusController.cs b/Marechai/Areas/Admin/Controllers/GpusController.cs index 97efb22e..b4a998a5 100644 --- a/Marechai/Areas/Admin/Controllers/GpusController.cs +++ b/Marechai/Areas/Admin/Controllers/GpusController.cs @@ -30,8 +30,8 @@ using System.Linq; using System.Threading.Tasks; -using Marechai.Database.Models; using Marechai.Areas.Admin.Models; +using Marechai.Database.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; @@ -40,39 +40,37 @@ using Microsoft.EntityFrameworkCore.Query; namespace Marechai.Areas.Admin.Controllers { - [Area("Admin")] - [Authorize] + [Area("Admin"), Authorize] public class GpusController : Controller { readonly MarechaiContext _context; - public GpusController(MarechaiContext context) - { - _context = context; - } + public GpusController(MarechaiContext context) => _context = context; // GET: Admin/Gpus public async Task Index() { IIncludableQueryable marechaiContext = _context.Gpus.Include(g => g.Company); - return View(await marechaiContext.OrderBy(g => g.Company.Name).ThenBy(g => g.Name).ThenBy(g => g.Introduced) - .Select(g => new GpuViewModel - { - Id = g.Id, - Company = g.Company.Name, - Introduced = g.Introduced, - ModelCode = g.ModelCode, - Name = g.Name - }).ToListAsync()); + + return View(await marechaiContext.OrderBy(g => g.Company.Name).ThenBy(g => g.Name). + ThenBy(g => g.Introduced).Select(g => new GpuViewModel + { + Id = g.Id, Company = g.Company.Name, + Introduced = g.Introduced, + ModelCode = g.ModelCode, Name = g.Name + }).ToListAsync()); } // GET: Admin/Gpus/Details/5 public async Task Details(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); Gpu gpu = await _context.Gpus.Include(g => g.Company).FirstOrDefaultAsync(m => m.Id == id); - if(gpu == null) return NotFound(); + + if(gpu == null) + return NotFound(); return View(gpu); } @@ -81,14 +79,14 @@ namespace Marechai.Areas.Admin.Controllers public IActionResult Create() { ViewData["CompanyId"] = new SelectList(_context.Companies.OrderBy(c => c.Name), "Id", "Name"); + return View(); } // POST: Admin/Gpus/Create // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Create( [Bind("Id,Name,CompanyId,ModelCode,Introduced,Package,Process,ProcessNm,DieSize,Transistors")] Gpu gpu) @@ -97,37 +95,43 @@ namespace Marechai.Areas.Admin.Controllers { _context.Add(gpu); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } ViewData["CompanyId"] = new SelectList(_context.Companies.OrderBy(c => c.Name), "Id", "Name", gpu.CompanyId); + return View(gpu); } // GET: Admin/Gpus/Edit/5 public async Task Edit(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); Gpu gpu = await _context.Gpus.FindAsync(id); - if(gpu == null) return NotFound(); + + if(gpu == null) + return NotFound(); ViewData["CompanyId"] = new SelectList(_context.Companies.OrderBy(c => c.Name), "Id", "Name", gpu.CompanyId); + return View(gpu); } // POST: Admin/Gpus/Edit/5 // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Edit( int id, [Bind("Id,Name,CompanyId,ModelCode,Introduced,Package,Process,ProcessNm,DieSize,Transistors")] Gpu gpu) { - if(id != gpu.Id) return NotFound(); + if(id != gpu.Id) + return NotFound(); if(ModelState.IsValid) { @@ -138,7 +142,8 @@ namespace Marechai.Areas.Admin.Controllers } catch(DbUpdateConcurrencyException) { - if(!GpuExists(gpu.Id)) return NotFound(); + if(!GpuExists(gpu.Id)) + return NotFound(); throw; } @@ -148,35 +153,35 @@ namespace Marechai.Areas.Admin.Controllers ViewData["CompanyId"] = new SelectList(_context.Companies.OrderBy(c => c.Name), "Id", "Name", gpu.CompanyId); + return View(gpu); } // GET: Admin/Gpus/Delete/5 public async Task Delete(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); Gpu gpu = await _context.Gpus.Include(g => g.Company).FirstOrDefaultAsync(m => m.Id == id); - if(gpu == null) return NotFound(); + + if(gpu == null) + return NotFound(); return View(gpu); } // POST: Admin/Gpus/Delete/5 - [HttpPost] - [ActionName("Delete")] - [ValidateAntiForgeryToken] + [HttpPost, ActionName("Delete"), ValidateAntiForgeryToken] public async Task DeleteConfirmed(int id) { Gpu gpu = await _context.Gpus.FindAsync(id); _context.Gpus.Remove(gpu); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - bool GpuExists(int id) - { - return _context.Gpus.Any(e => e.Id == id); - } + bool GpuExists(int id) => _context.Gpus.Any(e => e.Id == id); } } \ No newline at end of file diff --git a/Marechai/Areas/Admin/Controllers/InstructionSetExtensionsByProcessorController.cs b/Marechai/Areas/Admin/Controllers/InstructionSetExtensionsByProcessorController.cs index 61bccf81..0db1213f 100644 --- a/Marechai/Areas/Admin/Controllers/InstructionSetExtensionsByProcessorController.cs +++ b/Marechai/Areas/Admin/Controllers/InstructionSetExtensionsByProcessorController.cs @@ -1,7 +1,7 @@ using System.Linq; using System.Threading.Tasks; -using Marechai.Database.Models; using Marechai.Areas.Admin.Models; +using Marechai.Database.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; @@ -10,40 +10,39 @@ using Microsoft.EntityFrameworkCore.Query; namespace Marechai.Areas.Admin.Controllers { - [Area("Admin")] - [Authorize] + [Area("Admin"), Authorize] public class InstructionSetExtensionsByProcessorController : Controller { readonly MarechaiContext _context; - public InstructionSetExtensionsByProcessorController(MarechaiContext context) - { - _context = context; - } + public InstructionSetExtensionsByProcessorController(MarechaiContext context) => _context = context; // GET: InstructionSetExtensionsByProcessor public async Task Index() { IIncludableQueryable marechaiContext = _context.InstructionSetExtensionsByProcessor.Include(i => i.Extension).Include(i => i.Processor); - return View(await marechaiContext.OrderBy(e => e.Processor.Name).ThenBy(e => e.Extension.Extension) - .Select(e => new InstructionSetExtensionsByProcessorViewModel - { - Id = e.Id, - Extension = e.Extension.Extension, - Processor = e.Processor.Name - }).ToListAsync()); + + return View(await marechaiContext.OrderBy(e => e.Processor.Name).ThenBy(e => e.Extension.Extension). + Select(e => new InstructionSetExtensionsByProcessorViewModel + { + Id = e.Id, Extension = e.Extension.Extension, + Processor = e.Processor.Name + }).ToListAsync()); } // GET: InstructionSetExtensionsByProcessor/Details/5 public async Task Details(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); InstructionSetExtensionsByProcessor instructionSetExtensionsByProcessor = - await _context.InstructionSetExtensionsByProcessor.Include(i => i.Extension).Include(i => i.Processor) - .FirstOrDefaultAsync(m => m.Id == id); - if(instructionSetExtensionsByProcessor == null) return NotFound(); + await _context.InstructionSetExtensionsByProcessor.Include(i => i.Extension).Include(i => i.Processor). + FirstOrDefaultAsync(m => m.Id == id); + + if(instructionSetExtensionsByProcessor == null) + return NotFound(); return View(instructionSetExtensionsByProcessor); } @@ -52,15 +51,15 @@ namespace Marechai.Areas.Admin.Controllers public IActionResult Create() { ViewData["ExtensionId"] = new SelectList(_context.InstructionSetExtensions, "Id", "Extension"); - ViewData["ProcessorId"] = new SelectList(_context.Processors, "Id", "Name"); + ViewData["ProcessorId"] = new SelectList(_context.Processors, "Id", "Name"); + return View(); } // POST: InstructionSetExtensionsByProcessor/Create - // To protect from overposting attacks, please enable the specific properties you want to bind to, for + // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Create( [Bind("Id,ProcessorId,ExtensionId")] InstructionSetExtensionsByProcessor instructionSetExtensionsByProcessor) @@ -69,43 +68,51 @@ namespace Marechai.Areas.Admin.Controllers { _context.Add(instructionSetExtensionsByProcessor); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } ViewData["ExtensionId"] = new SelectList(_context.InstructionSetExtensions, "Id", "Extension", instructionSetExtensionsByProcessor.ExtensionId); + ViewData["ProcessorId"] = new SelectList(_context.Processors, "Id", "Name", instructionSetExtensionsByProcessor.ProcessorId); + return View(instructionSetExtensionsByProcessor); } // GET: InstructionSetExtensionsByProcessor/Edit/5 public async Task Edit(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); InstructionSetExtensionsByProcessor instructionSetExtensionsByProcessor = await _context.InstructionSetExtensionsByProcessor.FirstOrDefaultAsync(e => e.Id == id); - if(instructionSetExtensionsByProcessor == null) return NotFound(); + + if(instructionSetExtensionsByProcessor == null) + return NotFound(); ViewData["ExtensionId"] = new SelectList(_context.InstructionSetExtensions, "Id", "Extension", instructionSetExtensionsByProcessor.ExtensionId); + ViewData["ProcessorId"] = new SelectList(_context.Processors, "Id", "Name", instructionSetExtensionsByProcessor.ProcessorId); + return View(instructionSetExtensionsByProcessor); } // POST: InstructionSetExtensionsByProcessor/Edit/5 - // To protect from overposting attacks, please enable the specific properties you want to bind to, for + // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Edit( int id, [Bind("Id,ProcessorId,ExtensionId")] InstructionSetExtensionsByProcessor instructionSetExtensionsByProcessor) { - if(id != instructionSetExtensionsByProcessor.Id) return NotFound(); + if(id != instructionSetExtensionsByProcessor.Id) + return NotFound(); if(ModelState.IsValid) { @@ -127,53 +134,49 @@ namespace Marechai.Areas.Admin.Controllers ViewData["ExtensionId"] = new SelectList(_context.InstructionSetExtensions, "Id", "Extension", instructionSetExtensionsByProcessor.ExtensionId); + ViewData["ProcessorId"] = new SelectList(_context.Processors, "Id", "Name", instructionSetExtensionsByProcessor.ProcessorId); + return View(instructionSetExtensionsByProcessor); } // GET: InstructionSetExtensionsByProcessor/Delete/5 public async Task Delete(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); InstructionSetExtensionsByProcessor instructionSetExtensionsByProcessor = - await _context.InstructionSetExtensionsByProcessor.Include(i => i.Extension).Include(i => i.Processor) - .FirstOrDefaultAsync(m => m.Id == id); - if(instructionSetExtensionsByProcessor == null) return NotFound(); + await _context.InstructionSetExtensionsByProcessor.Include(i => i.Extension).Include(i => i.Processor). + FirstOrDefaultAsync(m => m.Id == id); + + if(instructionSetExtensionsByProcessor == null) + return NotFound(); return View(instructionSetExtensionsByProcessor); } // POST: InstructionSetExtensionsByProcessor/Delete/5 - [HttpPost] - [ActionName("Delete")] - [ValidateAntiForgeryToken] + [HttpPost, ActionName("Delete"), ValidateAntiForgeryToken] public async Task DeleteConfirmed(int id) { InstructionSetExtensionsByProcessor instructionSetExtensionsByProcessor = await _context.InstructionSetExtensionsByProcessor.FirstOrDefaultAsync(e => e.Id == id); + _context.InstructionSetExtensionsByProcessor.Remove(instructionSetExtensionsByProcessor); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - bool InstructionSetExtensionsByProcessorExists(int id) - { - return _context.InstructionSetExtensionsByProcessor.Any(e => e.Id == id); - } + bool InstructionSetExtensionsByProcessorExists(int id) => + _context.InstructionSetExtensionsByProcessor.Any(e => e.Id == id); [AcceptVerbs("Get", "Post")] - public async Task VerifyUnique(int processorId, int extensionId) - { - return - await _context.InstructionSetExtensionsByProcessor.FirstOrDefaultAsync(i => - i.ProcessorId == - processorId && - i.ExtensionId == extensionId) - is null - ? Json(true) - : Json("The selected processor already has the selected extension."); - } + public async Task VerifyUnique(int processorId, int extensionId) => + await _context.InstructionSetExtensionsByProcessor.FirstOrDefaultAsync(i => i.ProcessorId == processorId && + i.ExtensionId == extensionId) is + null ? Json(true) : Json("The selected processor already has the selected extension."); } } \ No newline at end of file diff --git a/Marechai/Areas/Admin/Controllers/InstructionSetExtensionsController.cs b/Marechai/Areas/Admin/Controllers/InstructionSetExtensionsController.cs index 5e93bf86..70d22fd8 100644 --- a/Marechai/Areas/Admin/Controllers/InstructionSetExtensionsController.cs +++ b/Marechai/Areas/Admin/Controllers/InstructionSetExtensionsController.cs @@ -38,16 +38,12 @@ using Microsoft.EntityFrameworkCore; namespace Marechai.Areas.Admin.Controllers { - [Area("Admin")] - [Authorize] + [Area("Admin"), Authorize] public class InstructionSetExtensionsController : Controller { readonly MarechaiContext _context; - public InstructionSetExtensionsController(MarechaiContext context) - { - _context = context; - } + public InstructionSetExtensionsController(MarechaiContext context) => _context = context; // GET: Admin/InstructionSetExtensions public async Task Index() => @@ -56,15 +52,18 @@ namespace Marechai.Areas.Admin.Controllers // GET: Admin/InstructionSetExtensions/Details/5 public async Task Details(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); InstructionSetExtension instructionSetExtension = await _context.InstructionSetExtensions.FirstOrDefaultAsync(m => m.Id == id); - if(instructionSetExtension == null) return NotFound(); - ViewBag.Processors = _context.InstructionSetExtensionsByProcessor.Where(e => e.ExtensionId == id) - .Join(_context.Processors, p => p.ProcessorId, i => i.Id, (p, i) => i) - .Select(p => p.Name); + if(instructionSetExtension == null) + return NotFound(); + + ViewBag.Processors = _context.InstructionSetExtensionsByProcessor.Where(e => e.ExtensionId == id). + Join(_context.Processors, p => p.ProcessorId, i => i.Id, (p, i) => i). + Select(p => p.Name); return View(instructionSetExtension); } @@ -75,14 +74,14 @@ namespace Marechai.Areas.Admin.Controllers // POST: Admin/InstructionSetExtensions/Create // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Create([Bind("Id,Extension")] InstructionSetExtension instructionSetExtension) { if(ModelState.IsValid) { _context.Add(instructionSetExtension); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } @@ -92,10 +91,13 @@ namespace Marechai.Areas.Admin.Controllers // GET: Admin/InstructionSetExtensions/Edit/5 public async Task Edit(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); InstructionSetExtension instructionSetExtension = await _context.InstructionSetExtensions.FindAsync(id); - if(instructionSetExtension == null) return NotFound(); + + if(instructionSetExtension == null) + return NotFound(); return View(instructionSetExtension); } @@ -103,12 +105,12 @@ namespace Marechai.Areas.Admin.Controllers // POST: Admin/InstructionSetExtensions/Edit/5 // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Edit( int id, [Bind("Id,Extension")] InstructionSetExtension instructionSetExtension) { - if(id != instructionSetExtension.Id) return NotFound(); + if(id != instructionSetExtension.Id) + return NotFound(); if(ModelState.IsValid) { @@ -119,7 +121,8 @@ namespace Marechai.Areas.Admin.Controllers } catch(DbUpdateConcurrencyException) { - if(!InstructionSetExtensionExists(instructionSetExtension.Id)) return NotFound(); + if(!InstructionSetExtensionExists(instructionSetExtension.Id)) + return NotFound(); throw; } @@ -133,37 +136,35 @@ namespace Marechai.Areas.Admin.Controllers // GET: Admin/InstructionSetExtensions/Delete/5 public async Task Delete(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); InstructionSetExtension instructionSetExtension = await _context.InstructionSetExtensions.FirstOrDefaultAsync(m => m.Id == id); - if(instructionSetExtension == null) return NotFound(); + + if(instructionSetExtension == null) + return NotFound(); return View(instructionSetExtension); } // POST: Admin/InstructionSetExtensions/Delete/5 - [HttpPost] - [ActionName("Delete")] - [ValidateAntiForgeryToken] + [HttpPost, ActionName("Delete"), ValidateAntiForgeryToken] public async Task DeleteConfirmed(int id) { InstructionSetExtension instructionSetExtension = await _context.InstructionSetExtensions.FindAsync(id); _context.InstructionSetExtensions.Remove(instructionSetExtension); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - bool InstructionSetExtensionExists(int id) - { - return _context.InstructionSetExtensions.Any(e => e.Id == id); - } + bool InstructionSetExtensionExists(int id) => _context.InstructionSetExtensions.Any(e => e.Id == id); [AcceptVerbs("Get", "Post")] public IActionResult VerifyUnique(string extension) => _context.InstructionSetExtensions.Any(i => string.Equals(i.Extension, extension, StringComparison.InvariantCultureIgnoreCase)) - ? Json("Instruction set extension already exists.") - : Json(true); + ? Json("Instruction set extension already exists.") : Json(true); } } \ No newline at end of file diff --git a/Marechai/Areas/Admin/Controllers/InstructionSetsController.cs b/Marechai/Areas/Admin/Controllers/InstructionSetsController.cs index 62bb973e..fefec9ce 100644 --- a/Marechai/Areas/Admin/Controllers/InstructionSetsController.cs +++ b/Marechai/Areas/Admin/Controllers/InstructionSetsController.cs @@ -38,16 +38,12 @@ using Microsoft.EntityFrameworkCore; namespace Marechai.Areas.Admin.Controllers { - [Area("Admin")] - [Authorize] + [Area("Admin"), Authorize] public class InstructionSetsController : Controller { readonly MarechaiContext _context; - public InstructionSetsController(MarechaiContext context) - { - _context = context; - } + public InstructionSetsController(MarechaiContext context) => _context = context; // GET: Admin/InstructionSets public async Task Index() => @@ -56,10 +52,13 @@ namespace Marechai.Areas.Admin.Controllers // GET: Admin/InstructionSets/Details/5 public async Task Details(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); InstructionSet instructionSet = await _context.InstructionSets.FirstOrDefaultAsync(m => m.Id == id); - if(instructionSet == null) return NotFound(); + + if(instructionSet == null) + return NotFound(); return View(instructionSet); } @@ -70,24 +69,28 @@ namespace Marechai.Areas.Admin.Controllers // POST: Admin/InstructionSets/Create // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Create([Bind("Id,Name")] InstructionSet instructionSet) { - if(!ModelState.IsValid) return View(instructionSet); + if(!ModelState.IsValid) + return View(instructionSet); _context.Add(instructionSet); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } // GET: Admin/InstructionSets/Edit/5 public async Task Edit(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); InstructionSet instructionSet = await _context.InstructionSets.FindAsync(id); - if(instructionSet == null) return NotFound(); + + if(instructionSet == null) + return NotFound(); return View(instructionSet); } @@ -95,11 +98,11 @@ namespace Marechai.Areas.Admin.Controllers // POST: Admin/InstructionSets/Edit/5 // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Edit(int id, [Bind("Id,Name")] InstructionSet instructionSet) { - if(id != instructionSet.Id) return NotFound(); + if(id != instructionSet.Id) + return NotFound(); if(ModelState.IsValid) { @@ -110,7 +113,8 @@ namespace Marechai.Areas.Admin.Controllers } catch(DbUpdateConcurrencyException) { - if(!InstructionSetExists(instructionSet.Id)) return NotFound(); + if(!InstructionSetExists(instructionSet.Id)) + return NotFound(); throw; } @@ -124,35 +128,33 @@ namespace Marechai.Areas.Admin.Controllers // GET: Admin/InstructionSets/Delete/5 public async Task Delete(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); InstructionSet instructionSet = await _context.InstructionSets.FirstOrDefaultAsync(m => m.Id == id); - if(instructionSet == null) return NotFound(); + + if(instructionSet == null) + return NotFound(); return View(instructionSet); } // POST: Admin/InstructionSets/Delete/5 - [HttpPost] - [ActionName("Delete")] - [ValidateAntiForgeryToken] + [HttpPost, ActionName("Delete"), ValidateAntiForgeryToken] public async Task DeleteConfirmed(int id) { InstructionSet instructionSet = await _context.InstructionSets.FindAsync(id); _context.InstructionSets.Remove(instructionSet); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - bool InstructionSetExists(int id) - { - return _context.InstructionSets.Any(e => e.Id == id); - } + bool InstructionSetExists(int id) => _context.InstructionSets.Any(e => e.Id == id); [AcceptVerbs("Get", "Post")] public IActionResult VerifyUnique(string name) => _context.InstructionSets.Any(i => string.Equals(i.Name, name, StringComparison.InvariantCultureIgnoreCase)) - ? Json("Instruction set already exists.") - : Json(true); + ? Json("Instruction set already exists.") : Json(true); } } \ No newline at end of file diff --git a/Marechai/Areas/Admin/Controllers/LicensesController.cs b/Marechai/Areas/Admin/Controllers/LicensesController.cs index 4243c21a..1ff985e8 100644 --- a/Marechai/Areas/Admin/Controllers/LicensesController.cs +++ b/Marechai/Areas/Admin/Controllers/LicensesController.cs @@ -7,30 +7,26 @@ using Microsoft.EntityFrameworkCore; namespace Marechai { - [Area("Admin")] - [Authorize] + [Area("Admin"), Authorize] public class LicensesController : Controller { readonly MarechaiContext _context; - public LicensesController(MarechaiContext context) - { - _context = context; - } + public LicensesController(MarechaiContext context) => _context = context; // GET: Licenses - public async Task Index() - { - return View(await _context.Licenses.OrderBy(l => l.Name).ToListAsync()); - } + public async Task Index() => View(await _context.Licenses.OrderBy(l => l.Name).ToListAsync()); // GET: Licenses/Details/5 public async Task Details(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); License license = await _context.Licenses.FirstOrDefaultAsync(m => m.Id == id); - if(license == null) return NotFound(); + + if(license == null) + return NotFound(); return View(license); } @@ -39,10 +35,9 @@ namespace Marechai public IActionResult Create() => View(); // POST: Licenses/Create - // To protect from overposting attacks, please enable the specific properties you want to bind to, for + // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Create([Bind("Name,SPDX,FsfApproved,OsiApproved,Link,Text,Id")] License license) { @@ -50,6 +45,7 @@ namespace Marechai { _context.Add(license); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } @@ -59,23 +55,26 @@ namespace Marechai // GET: Licenses/Edit/5 public async Task Edit(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); License license = await _context.Licenses.FindAsync(id); - if(license == null) return NotFound(); + + if(license == null) + return NotFound(); return View(license); } // POST: Licenses/Edit/5 - // To protect from overposting attacks, please enable the specific properties you want to bind to, for + // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Edit(int id, [Bind("Name,SPDX,FsfApproved,OsiApproved,Link,Text,Id")] License license) { - if(id != license.Id) return NotFound(); + if(id != license.Id) + return NotFound(); if(ModelState.IsValid) { @@ -86,7 +85,8 @@ namespace Marechai } catch(DbUpdateConcurrencyException) { - if(!LicenseExists(license.Id)) return NotFound(); + if(!LicenseExists(license.Id)) + return NotFound(); throw; } @@ -100,29 +100,28 @@ namespace Marechai // GET: Licenses/Delete/5 public async Task Delete(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); License license = await _context.Licenses.FirstOrDefaultAsync(m => m.Id == id); - if(license == null) return NotFound(); + + if(license == null) + return NotFound(); return View(license); } // POST: Licenses/Delete/5 - [HttpPost] - [ActionName("Delete")] - [ValidateAntiForgeryToken] + [HttpPost, ActionName("Delete"), ValidateAntiForgeryToken] public async Task DeleteConfirmed(int id) { License license = await _context.Licenses.FindAsync(id); _context.Licenses.Remove(license); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - bool LicenseExists(int id) - { - return _context.Licenses.Any(e => e.Id == id); - } + bool LicenseExists(int id) => _context.Licenses.Any(e => e.Id == id); } } \ No newline at end of file diff --git a/Marechai/Areas/Admin/Controllers/MachineFamiliesController.cs b/Marechai/Areas/Admin/Controllers/MachineFamiliesController.cs index f08cc642..467e7e56 100644 --- a/Marechai/Areas/Admin/Controllers/MachineFamiliesController.cs +++ b/Marechai/Areas/Admin/Controllers/MachineFamiliesController.cs @@ -30,8 +30,8 @@ using System.Linq; using System.Threading.Tasks; -using Marechai.Database.Models; using Marechai.Areas.Admin.Models; +using Marechai.Database.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; @@ -40,36 +40,37 @@ using Microsoft.EntityFrameworkCore.Query; namespace Marechai.Areas.Admin.Controllers { - [Area("Admin")] - [Authorize] + [Area("Admin"), Authorize] public class MachineFamiliesController : Controller { readonly MarechaiContext _context; - public MachineFamiliesController(MarechaiContext context) - { - _context = context; - } + public MachineFamiliesController(MarechaiContext context) => _context = context; // GET: Admin/MachineFamilies public async Task Index() { - IIncludableQueryable marechaiContext = _context.MachineFamilies.Include(m => m.Company); - return View(await marechaiContext.OrderBy(m => m.Company.Name).ThenBy(m => m.Name) - .Select(m => new MachineFamilyViewModel - { - Id = m.Id, Company = m.Company.Name, Name = m.Name - }).ToListAsync()); + IIncludableQueryable marechaiContext = + _context.MachineFamilies.Include(m => m.Company); + + return View(await marechaiContext.OrderBy(m => m.Company.Name).ThenBy(m => m.Name). + Select(m => new MachineFamilyViewModel + { + Id = m.Id, Company = m.Company.Name, Name = m.Name + }).ToListAsync()); } // GET: Admin/MachineFamilies/Details/5 public async Task Details(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); MachineFamily machineFamily = await _context.MachineFamilies.Include(m => m.Company).FirstOrDefaultAsync(m => m.Id == id); - if(machineFamily == null) return NotFound(); + + if(machineFamily == null) + return NotFound(); return View(machineFamily); } @@ -78,47 +79,53 @@ namespace Marechai.Areas.Admin.Controllers public IActionResult Create() { ViewData["CompanyId"] = new SelectList(_context.Companies, "Id", "Name"); + return View(); } // POST: Admin/MachineFamilies/Create - // To protect from overposting attacks, please enable the specific properties you want to bind to, for + // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Create([Bind("Id,CompanyId,Name")] MachineFamily machineFamily) { if(ModelState.IsValid) { _context.Add(machineFamily); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } ViewData["CompanyId"] = new SelectList(_context.Companies, "Id", "Name", machineFamily.CompanyId); + return View(machineFamily); } // GET: Admin/MachineFamilies/Edit/5 public async Task Edit(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); MachineFamily machineFamily = await _context.MachineFamilies.FindAsync(id); - if(machineFamily == null) return NotFound(); + + if(machineFamily == null) + return NotFound(); ViewData["CompanyId"] = new SelectList(_context.Companies, "Id", "Name", machineFamily.CompanyId); + return View(machineFamily); } // POST: Admin/MachineFamilies/Edit/5 - // To protect from overposting attacks, please enable the specific properties you want to bind to, for + // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Edit(int id, [Bind("Id,CompanyId,Name")] MachineFamily machineFamily) { - if(id != machineFamily.Id) return NotFound(); + if(id != machineFamily.Id) + return NotFound(); if(ModelState.IsValid) { @@ -129,7 +136,8 @@ namespace Marechai.Areas.Admin.Controllers } catch(DbUpdateConcurrencyException) { - if(!MachineFamilyExists(machineFamily.Id)) return NotFound(); + if(!MachineFamilyExists(machineFamily.Id)) + return NotFound(); throw; } @@ -138,36 +146,36 @@ namespace Marechai.Areas.Admin.Controllers } ViewData["CompanyId"] = new SelectList(_context.Companies, "Id", "Name", machineFamily.CompanyId); + return View(machineFamily); } // GET: Admin/MachineFamilies/Delete/5 public async Task Delete(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); MachineFamily machineFamily = await _context.MachineFamilies.Include(m => m.Company).FirstOrDefaultAsync(m => m.Id == id); - if(machineFamily == null) return NotFound(); + + if(machineFamily == null) + return NotFound(); return View(machineFamily); } // POST: Admin/MachineFamilies/Delete/5 - [HttpPost] - [ActionName("Delete")] - [ValidateAntiForgeryToken] + [HttpPost, ActionName("Delete"), ValidateAntiForgeryToken] public async Task DeleteConfirmed(int id) { MachineFamily machineFamily = await _context.MachineFamilies.FindAsync(id); _context.MachineFamilies.Remove(machineFamily); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - bool MachineFamilyExists(int id) - { - return _context.MachineFamilies.Any(e => e.Id == id); - } + bool MachineFamilyExists(int id) => _context.MachineFamilies.Any(e => e.Id == id); } } \ No newline at end of file diff --git a/Marechai/Areas/Admin/Controllers/MachinePhotosController.cs b/Marechai/Areas/Admin/Controllers/MachinePhotosController.cs index e7f62307..90011983 100644 --- a/Marechai/Areas/Admin/Controllers/MachinePhotosController.cs +++ b/Marechai/Areas/Admin/Controllers/MachinePhotosController.cs @@ -2,8 +2,8 @@ using System; using System.IO; using System.Linq; using System.Threading.Tasks; -using Marechai.Database.Models; using Marechai.Areas.Admin.Models; +using Marechai.Database.Models; using Marechai.Helpers; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Hosting; @@ -16,15 +16,14 @@ using SixLabors.ImageSharp.Formats; namespace Marechai.Areas.Admin.Controllers { - [Area("Admin")] - [Authorize] + [Area("Admin"), Authorize] public class MachinePhotosController : Controller { - readonly MarechaiContext _context; + readonly MarechaiContext _context; readonly IHostingEnvironment hostingEnvironment; readonly UserManager userManager; - public MachinePhotosController(MarechaiContext context, IHostingEnvironment hostingEnvironment, + public MachinePhotosController(MarechaiContext context, IHostingEnvironment hostingEnvironment, UserManager userManager) { _context = context; @@ -33,74 +32,57 @@ namespace Marechai.Areas.Admin.Controllers } // GET: MachinePhotos - public async Task Index() - { - return View(await _context.MachinePhotos.Include(m => m.Machine).Include(m => m.Machine.Company) - .Include(m => m.User).Select(p => new MachinePhotoViewModel - { - Id = p.Id, - Author = p.Author, - License = p.License.Name, - Machine = - $"{p.Machine.Company.Name} {p.Machine.Name}", - UploadDate = p.UploadDate, - UploadUser = p.User.UserName, - LicenseId = p.License.Id - }).OrderBy(p => p.Machine) - .ThenBy(p => p.UploadUser).ThenBy(p => p.UploadDate).ToListAsync()); - } + public async Task Index() => View(await _context. + MachinePhotos.Include(m => m.Machine). + Include(m => m.Machine.Company).Include(m => m.User). + Select(p => new MachinePhotoViewModel + { + Id = p.Id, Author = p.Author, + License = p.License.Name, + Machine = + $"{p.Machine.Company.Name} {p.Machine.Name}", + UploadDate = p.UploadDate, + UploadUser = p.User.UserName, + LicenseId = p.License.Id + }).OrderBy(p => p.Machine).ThenBy(p => p.UploadUser). + ThenBy(p => p.UploadDate).ToListAsync()); // GET: MachinePhotos/Details/5 public async Task Details(Guid? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); - MachinePhotoDetailsViewModel machinePhoto = await _context - .MachinePhotos - .Select(m => new MachinePhotoDetailsViewModel - { - Id = m.Id, - CameraManufacturer = m.CameraManufacturer, - CameraModel = m.CameraModel, - ColorSpace = m.ColorSpace, - Comments = m.Comments, - Contrast = m.Contrast, - CreationDate = m.CreationDate, - DigitalZoomRatio = m.DigitalZoomRatio, - ExifVersion = m.ExifVersion, - Exposure = m.Exposure, - ExposureProgram = m.ExposureProgram, - Flash = m.Flash, - Focal = m.Focal, - FocalLength = m.FocalLength, - FocalLengthEquivalent = - m.FocalLengthEquivalent, - HorizontalResolution = - m.HorizontalResolution, - IsoRating = m.IsoRating, - Lens = m.Lens, - LightSource = m.LightSource, - MeteringMode = m.MeteringMode, - ResolutionUnit = m.ResolutionUnit, - Orientation = m.Orientation, - Saturation = m.Saturation, - SceneCaptureType = m.SceneCaptureType, - SensingMethod = m.SensingMethod, - Sharpness = m.Sharpness, - SoftwareUsed = m.SoftwareUsed, - SubjectDistanceRange = - m.SubjectDistanceRange, - UploadDate = m.UploadDate, - VerticalResolution = m.VerticalResolution, - WhiteBalance = m.WhiteBalance, - License = m.License.Name, - UploadUser = m.User.UserName, - Machine = - $"{m.Machine.Company.Name} {m.Machine.Name}", - MachineId = m.Machine.Id, - Source = m.Source - }).FirstOrDefaultAsync(m => m.Id == id); - if(machinePhoto == null) return NotFound(); + MachinePhotoDetailsViewModel machinePhoto = + await _context.MachinePhotos.Select(m => new MachinePhotoDetailsViewModel + { + Id = m.Id, CameraManufacturer = m.CameraManufacturer, + CameraModel = m.CameraModel, + ColorSpace = m.ColorSpace, Comments = m.Comments, + Contrast = m.Contrast, + CreationDate = m.CreationDate, DigitalZoomRatio = m.DigitalZoomRatio, + ExifVersion = m.ExifVersion, + Exposure = m.Exposure, ExposureProgram = m.ExposureProgram, + Flash = m.Flash, Focal = m.Focal, + FocalLength = m.FocalLength, FocalLengthEquivalent = m.FocalLengthEquivalent, + HorizontalResolution = m.HorizontalResolution, IsoRating = m.IsoRating, + Lens = m.Lens, + LightSource = m.LightSource, MeteringMode = m.MeteringMode, + ResolutionUnit = m.ResolutionUnit, + Orientation = m.Orientation, Saturation = m.Saturation, + SceneCaptureType = m.SceneCaptureType, + SensingMethod = m.SensingMethod, Sharpness = m.Sharpness, + SoftwareUsed = m.SoftwareUsed, + SubjectDistanceRange = m.SubjectDistanceRange, UploadDate = m.UploadDate, + VerticalResolution = m.VerticalResolution, WhiteBalance = m.WhiteBalance, + License = m.License.Name, + UploadUser = m.User.UserName, + Machine = $"{m.Machine.Company.Name} {m.Machine.Name}", + MachineId = m.Machine.Id, Source = m.Source + }).FirstOrDefaultAsync(m => m.Id == id); + + if(machinePhoto == null) + return NotFound(); return View(machinePhoto); } @@ -108,26 +90,31 @@ namespace Marechai.Areas.Admin.Controllers // GET: MachinePhotos/Create public IActionResult Create() { - ViewData["MachineId"] = - new - SelectList(_context.Machines.OrderBy(c => c.Company.Name).ThenBy(c => c.Name).Select(m => new {m.Id, Name = $"{m.Company.Name} {m.Name}"}), - "Id", "Name"); - ViewData["LicenseId"] = - new SelectList(_context.Licenses.OrderBy(c => c.Name).Select(l => new {l.Id, l.Name}), "Id", "Name"); + ViewData["MachineId"] = new SelectList(_context.Machines.OrderBy(c => c.Company.Name).ThenBy(c => c.Name). + Select(m => new + { + m.Id, Name = $"{m.Company.Name} {m.Name}" + }), "Id", "Name"); + + ViewData["LicenseId"] = new SelectList(_context.Licenses.OrderBy(c => c.Name).Select(l => new + { + l.Id, l.Name + }), "Id", "Name"); + return View(); } // POST: MachinePhotos/Create - // To protect from overposting attacks, please enable the specific properties you want to bind to, for + // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Create([Bind("MachineId,LicenseId,Photo,Source")] MachinePhotoViewModel machinePhoto) { - if(!ModelState.IsValid) return View(machinePhoto); + if(!ModelState.IsValid) + return View(machinePhoto); - Guid newId = Guid.NewGuid(); + var newId = Guid.NewGuid(); string tmpPath = Path.GetTempPath(); string tmpFileName = newId + ".tmp"; string tmpFile = Path.Combine(tmpPath, tmpFileName); @@ -135,26 +122,31 @@ namespace Marechai.Areas.Admin.Controllers if(System.IO.File.Exists(tmpFile)) { machinePhoto.ErrorMessage = "Colliding temp file please retry."; + return View(machinePhoto); } - using(FileStream tmpStream = new FileStream(tmpFile, FileMode.CreateNew)) + using(var tmpStream = new FileStream(tmpFile, FileMode.CreateNew)) await machinePhoto.Photo.CopyToAsync(tmpStream); IImageFormat imageinfo = Image.DetectFormat(tmpFile); string extension; + switch(imageinfo?.Name) { - case "JPEG": + case"JPEG": extension = ".jpg"; + break; - case "PNG": + case"PNG": extension = ".png"; + break; default: System.IO.File.Delete(tmpFile); machinePhoto.ErrorMessage = "Unsupported file format, only JPEG and PNG are allowed at the moment."; + return View(machinePhoto); } @@ -168,40 +160,52 @@ namespace Marechai.Areas.Admin.Controllers _context.Add(photo); await _context.SaveChangesAsync(); - return RedirectToAction(nameof(Details), new {Id = newId}); + + return RedirectToAction(nameof(Details), new + { + Id = newId + }); } // GET: MachinePhotos/Edit/5 public async Task Edit(Guid? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); MachinePhoto machinePhoto = await _context.MachinePhotos.FindAsync(id); - if(machinePhoto == null) return NotFound(); - ViewData["MachineId"] = - new - SelectList(_context.Machines.OrderBy(m => m.Company.Name).ThenBy(m => m.Name).Select(m => new {m.Id, Name = $"{m.Company.Name} {m.Name}"}), - "Id", "Name", machinePhoto.MachineId); - ViewData["LicenseId"] = - new SelectList(_context.Licenses.OrderBy(l => l.Name).Select(l => new {l.Id, l.Name}), "Id", "Name", - machinePhoto.LicenseId); + if(machinePhoto == null) + return NotFound(); + + ViewData["MachineId"] = new SelectList(_context.Machines.OrderBy(m => m.Company.Name).ThenBy(m => m.Name). + Select(m => new + { + m.Id, Name = $"{m.Company.Name} {m.Name}" + }), "Id", "Name", machinePhoto.MachineId); + + ViewData["LicenseId"] = new SelectList(_context.Licenses.OrderBy(l => l.Name).Select(l => new + { + l.Id, l.Name + }), "Id", "Name", machinePhoto.LicenseId); return View(machinePhoto); } // POST: MachinePhotos/Edit/5 - // To protect from overposting attacks, please enable the specific properties you want to bind to, for + // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] - public async Task Edit(Guid id, [Bind( - "Author,CameraManufacturer,CameraModel,ColorSpace,Comments,Contrast,CreationDate,DigitalZoomRatio,ExifVersion,Exposure,ExposureMethod,ExposureProgram,Flash,Focal,FocalLength,FocalLengthEquivalent,HorizontalResolution,IsoRating,Lens,LicenseId,LightSource,MachineId,MeteringMode,ResolutionUnit,Orientation,Saturation,SceneCaptureType,SensingMethod,Sharpness,SoftwareUsed,SubjectDistanceRange,VerticalResolution,WhiteBalance,Id,Source")] - MachinePhoto machinePhoto) + [HttpPost, ValidateAntiForgeryToken] + public async Task Edit( + Guid id, + [Bind("Author,CameraManufacturer,CameraModel,ColorSpace,Comments,Contrast,CreationDate,DigitalZoomRatio,ExifVersion,Exposure,ExposureMethod,ExposureProgram,Flash,Focal,FocalLength,FocalLengthEquivalent,HorizontalResolution,IsoRating,Lens,LicenseId,LightSource,MachineId,MeteringMode,ResolutionUnit,Orientation,Saturation,SceneCaptureType,SensingMethod,Sharpness,SoftwareUsed,SubjectDistanceRange,VerticalResolution,WhiteBalance,Id,Source")] + MachinePhoto machinePhoto) { - if(id != machinePhoto.Id) return NotFound(); + if(id != machinePhoto.Id) + return NotFound(); - if(!ModelState.IsValid) return View(machinePhoto); + if(!ModelState.IsValid) + return View(machinePhoto); try { @@ -210,7 +214,8 @@ namespace Marechai.Areas.Admin.Controllers } catch(DbUpdateConcurrencyException) { - if(!MachinePhotoExists(machinePhoto.Id)) return NotFound(); + if(!MachinePhotoExists(machinePhoto.Id)) + return NotFound(); throw; } @@ -221,42 +226,43 @@ namespace Marechai.Areas.Admin.Controllers // GET: MachinePhotos/Delete/5 public async Task Delete(Guid? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); - MachinePhotoViewModel machinePhoto = await _context - .MachinePhotos.Include(m => m.Machine) - .Include(m => m.Machine.Company).Include(m => m.User) - .Select(p => new MachinePhotoViewModel - { - Id = p.Id, - Author = p.Author, - License = p.License.Name, - Machine = - $"{p.Machine.Company.Name} {p.Machine.Name}", - UploadDate = p.UploadDate, - UploadUser = p.User.UserName, - LicenseId = p.License.Id - }).OrderBy(p => p.Machine).ThenBy(p => p.UploadUser) - .ThenBy(p => p.UploadDate).FirstOrDefaultAsync(m => m.Id == id); + MachinePhotoViewModel machinePhoto = + await _context.MachinePhotos.Include(m => m.Machine).Include(m => m.Machine.Company). + Include(m => m.User).Select(p => new MachinePhotoViewModel + { + Id = p.Id, Author = p.Author, + License = p.License.Name, + Machine = $"{p.Machine.Company.Name} {p.Machine.Name}", UploadDate = p.UploadDate, + UploadUser = p.User.UserName, LicenseId = p.License.Id + }).OrderBy(p => p.Machine).ThenBy(p => p.UploadUser).ThenBy(p => p.UploadDate). + FirstOrDefaultAsync(m => m.Id == id); - if(machinePhoto == null) return NotFound(); + if(machinePhoto == null) + return NotFound(); return View(machinePhoto); } // POST: MachinePhotos/Delete/5 - [HttpPost] - [ActionName("Delete")] - [ValidateAntiForgeryToken] + [HttpPost, ActionName("Delete"), ValidateAntiForgeryToken] public async Task DeleteConfirmed(Guid id) { MachinePhoto machinePhoto = await _context.MachinePhotos.FindAsync(id); _context.MachinePhotos.Remove(machinePhoto); await _context.SaveChangesAsync(); - foreach(string format in new[] {"jpg", "webp"}) + foreach(string format in new[] { - foreach(int multiplier in new[] {1, 2, 3}) + "jpg", "webp" + }) + { + foreach(int multiplier in new[] + { + 1, 2, 3 + }) System.IO.File.Delete(Path.Combine(hostingEnvironment.WebRootPath, "assets/photos/machines/thumbs", format, $"{multiplier}x", id + $".{format}")); } @@ -264,9 +270,6 @@ namespace Marechai.Areas.Admin.Controllers return RedirectToAction(nameof(Index)); } - bool MachinePhotoExists(Guid id) - { - return _context.MachinePhotos.Any(e => e.Id == id); - } + bool MachinePhotoExists(Guid id) => _context.MachinePhotos.Any(e => e.Id == id); } } \ No newline at end of file diff --git a/Marechai/Areas/Admin/Controllers/MachinesController.cs b/Marechai/Areas/Admin/Controllers/MachinesController.cs index 00fe08ff..c72528b0 100644 --- a/Marechai/Areas/Admin/Controllers/MachinesController.cs +++ b/Marechai/Areas/Admin/Controllers/MachinesController.cs @@ -31,9 +31,9 @@ using System; using System.Linq; using System.Threading.Tasks; +using Marechai.Areas.Admin.Models; using Marechai.Database; using Marechai.Database.Models; -using Marechai.Areas.Admin.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; @@ -42,43 +42,39 @@ using Microsoft.EntityFrameworkCore.Query; namespace Marechai.Areas.Admin.Controllers { - [Area("Admin")] - [Authorize] + [Area("Admin"), Authorize] public class MachinesController : Controller { readonly MarechaiContext _context; - public MachinesController(MarechaiContext context) - { - _context = context; - } + public MachinesController(MarechaiContext context) => _context = context; // GET: Admin/Machines public async Task Index() { IIncludableQueryable marechaiContext = _context.Machines.Include(m => m.Company).Include(m => m.Family); - return View(await marechaiContext.OrderBy(m => m.Company.Name).ThenBy(m => m.Name).ThenBy(m => m.Family.Name) - .Select(m => new MachineViewModel - { - Id = m.Id, - Company = m.Company.Name, - Name = m.Name, - Model = m.Model, - Introduced = m.Introduced, - Type = m.Type, - Family = m.Family.Name - }).ToListAsync()); + + return View(await marechaiContext.OrderBy(m => m.Company.Name).ThenBy(m => m.Name). + ThenBy(m => m.Family.Name).Select(m => new MachineViewModel + { + Id = m.Id, Company = m.Company.Name, Name = m.Name, + Model = m.Model, + Introduced = m.Introduced, Type = m.Type, Family = m.Family.Name + }).ToListAsync()); } // GET: Admin/Machines/Details/5 public async Task Details(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); - Machine machine = await _context.Machines.Include(m => m.Company).Include(m => m.Family) - .FirstOrDefaultAsync(m => m.Id == id); - if(machine == null) return NotFound(); + Machine machine = await _context.Machines.Include(m => m.Company).Include(m => m.Family). + FirstOrDefaultAsync(m => m.Id == id); + + if(machine == null) + return NotFound(); return View(machine); } @@ -86,16 +82,16 @@ namespace Marechai.Areas.Admin.Controllers // GET: Admin/Machines/Create public IActionResult Create() { - ViewData["CompanyId"] = new SelectList(_context.Companies, "Id", "Name"); + ViewData["CompanyId"] = new SelectList(_context.Companies, "Id", "Name"); ViewData["FamilyId"] = new SelectList(_context.MachineFamilies, "Id", "Name"); + return View(); } // POST: Admin/Machines/Create // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Create([Bind("Id,CompanyId,Name,Type,Introduced,FamilyId,Model")] Machine machine) { @@ -104,50 +100,62 @@ namespace Marechai.Areas.Admin.Controllers _context.Add(machine); await _context.SaveChangesAsync(); - NewsType newsType = new NewsType(); + var newsType = new NewsType(); + switch(machine.Type) { case MachineType.Computer: newsType = NewsType.NewComputerInDb; + break; case MachineType.Console: newsType = NewsType.NewConsoleInDb; + break; } - _context.News.Add(new News {AddedId = machine.Id, Date = DateTime.UtcNow, Type = newsType}); + _context.News.Add(new News + { + AddedId = machine.Id, Date = DateTime.UtcNow, Type = newsType + }); + await _context.SaveChangesAsync(); return RedirectToAction(nameof(Index)); } - ViewData["CompanyId"] = new SelectList(_context.Companies, "Id", "Name", machine.CompanyId); + ViewData["CompanyId"] = new SelectList(_context.Companies, "Id", "Name", machine.CompanyId); ViewData["FamilyId"] = new SelectList(_context.MachineFamilies, "Id", "Name", machine.FamilyId); + return View(machine); } // GET: Admin/Machines/Edit/5 public async Task Edit(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); Machine machine = await _context.Machines.FindAsync(id); - if(machine == null) return NotFound(); - ViewData["CompanyId"] = new SelectList(_context.Companies, "Id", "Name", machine.CompanyId); + if(machine == null) + return NotFound(); + + ViewData["CompanyId"] = new SelectList(_context.Companies, "Id", "Name", machine.CompanyId); ViewData["FamilyId"] = new SelectList(_context.MachineFamilies, "Id", "Name", machine.FamilyId); + return View(machine); } // POST: Admin/Machines/Edit/5 // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Edit(int id, [Bind("Id,CompanyId,Name,Type,Introduced,FamilyId,Model")] Machine machine) { - if(id != machine.Id) return NotFound(); + if(id != machine.Id) + return NotFound(); if(ModelState.IsValid) { @@ -156,23 +164,31 @@ namespace Marechai.Areas.Admin.Controllers _context.Update(machine); await _context.SaveChangesAsync(); - NewsType newsType = new NewsType(); + var newsType = new NewsType(); + switch(machine.Type) { case MachineType.Computer: newsType = NewsType.UpdatedComputerInDb; + break; case MachineType.Console: newsType = NewsType.UpdatedConsoleInDb; + break; } - _context.News.Add(new News {AddedId = machine.Id, Date = DateTime.UtcNow, Type = newsType}); + _context.News.Add(new News + { + AddedId = machine.Id, Date = DateTime.UtcNow, Type = newsType + }); + await _context.SaveChangesAsync(); } catch(DbUpdateConcurrencyException) { - if(!MachineExists(machine.Id)) return NotFound(); + if(!MachineExists(machine.Id)) + return NotFound(); throw; } @@ -180,38 +196,38 @@ namespace Marechai.Areas.Admin.Controllers return RedirectToAction(nameof(Index)); } - ViewData["CompanyId"] = new SelectList(_context.Companies, "Id", "Name", machine.CompanyId); + ViewData["CompanyId"] = new SelectList(_context.Companies, "Id", "Name", machine.CompanyId); ViewData["FamilyId"] = new SelectList(_context.MachineFamilies, "Id", "Name", machine.FamilyId); + return View(machine); } // GET: Admin/Machines/Delete/5 public async Task Delete(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); - Machine machine = await _context.Machines.Include(m => m.Company).Include(m => m.Family) - .FirstOrDefaultAsync(m => m.Id == id); - if(machine == null) return NotFound(); + Machine machine = await _context.Machines.Include(m => m.Company).Include(m => m.Family). + FirstOrDefaultAsync(m => m.Id == id); + + if(machine == null) + return NotFound(); return View(machine); } // POST: Admin/Machines/Delete/5 - [HttpPost] - [ActionName("Delete")] - [ValidateAntiForgeryToken] + [HttpPost, ActionName("Delete"), ValidateAntiForgeryToken] public async Task DeleteConfirmed(int id) { Machine machine = await _context.Machines.FindAsync(id); _context.Machines.Remove(machine); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - bool MachineExists(int id) - { - return _context.Machines.Any(e => e.Id == id); - } + bool MachineExists(int id) => _context.Machines.Any(e => e.Id == id); } } \ No newline at end of file diff --git a/Marechai/Areas/Admin/Controllers/MemoryByMachinesController.cs b/Marechai/Areas/Admin/Controllers/MemoryByMachinesController.cs index 8b2cbad8..5f45f916 100644 --- a/Marechai/Areas/Admin/Controllers/MemoryByMachinesController.cs +++ b/Marechai/Areas/Admin/Controllers/MemoryByMachinesController.cs @@ -30,8 +30,8 @@ using System.Linq; using System.Threading.Tasks; -using Marechai.Database.Models; using Marechai.Areas.Admin.Models; +using Marechai.Database.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; @@ -40,43 +40,38 @@ using Microsoft.EntityFrameworkCore.Query; namespace Marechai.Areas.Admin.Controllers { - [Area("Admin")] - [Authorize] + [Area("Admin"), Authorize] public class MemoryByMachinesController : Controller { readonly MarechaiContext _context; - public MemoryByMachinesController(MarechaiContext context) - { - _context = context; - } + public MemoryByMachinesController(MarechaiContext context) => _context = context; // GET: Admin/MemoryByMachines public async Task Index() { IIncludableQueryable marechaiContext = _context.MemoryByMachine.Include(m => m.Machine); - return View(await marechaiContext.OrderBy(m => m.Machine.Name).ThenBy(m => m.Usage).ThenBy(m => m.Size) - .ThenBy(m => m.Type) - .Select(m => new MemoryByMachineViewModel - { - Id = m.Id, - Machine = m.Machine.Name, - Size = m.Size, - Speed = m.Speed, - Type = m.Type, - Usage = m.Usage - }).ToListAsync()); + + return View(await marechaiContext.OrderBy(m => m.Machine.Name).ThenBy(m => m.Usage).ThenBy(m => m.Size). + ThenBy(m => m.Type).Select(m => new MemoryByMachineViewModel + { + Id = m.Id, Machine = m.Machine.Name, Size = m.Size, Speed = m.Speed, + Type = m.Type, Usage = m.Usage + }).ToListAsync()); } // GET: Admin/MemoryByMachines/Details/5 public async Task Details(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); MemoryByMachine memoryByMachine = await _context.MemoryByMachine.Include(m => m.Machine).FirstOrDefaultAsync(m => m.Id == id); - if(memoryByMachine == null) return NotFound(); + + if(memoryByMachine == null) + return NotFound(); return View(memoryByMachine); } @@ -85,14 +80,14 @@ namespace Marechai.Areas.Admin.Controllers public IActionResult Create() { ViewData["MachineId"] = new SelectList(_context.Machines, "Id", "Name"); + return View(); } // POST: Admin/MemoryByMachines/Create // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Create([Bind("MachineId,Type,Usage,Size,Speed,Id")] MemoryByMachine memoryByMachine) { @@ -100,34 +95,40 @@ namespace Marechai.Areas.Admin.Controllers { _context.Add(memoryByMachine); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } ViewData["MachineId"] = new SelectList(_context.Machines, "Id", "Name", memoryByMachine.MachineId); + return View(memoryByMachine); } // GET: Admin/MemoryByMachines/Edit/5 public async Task Edit(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); MemoryByMachine memoryByMachine = await _context.MemoryByMachine.FindAsync(id); - if(memoryByMachine == null) return NotFound(); + + if(memoryByMachine == null) + return NotFound(); ViewData["MachineId"] = new SelectList(_context.Machines, "Id", "Name", memoryByMachine.MachineId); + return View(memoryByMachine); } // POST: Admin/MemoryByMachines/Edit/5 // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Edit(long id, [Bind("MachineId,Type,Usage,Size,Speed,Id")] MemoryByMachine memoryByMachine) { - if(id != memoryByMachine.Id) return NotFound(); + if(id != memoryByMachine.Id) + return NotFound(); if(ModelState.IsValid) { @@ -138,7 +139,8 @@ namespace Marechai.Areas.Admin.Controllers } catch(DbUpdateConcurrencyException) { - if(!MemoryByMachineExists(memoryByMachine.Id)) return NotFound(); + if(!MemoryByMachineExists(memoryByMachine.Id)) + return NotFound(); throw; } @@ -147,36 +149,36 @@ namespace Marechai.Areas.Admin.Controllers } ViewData["MachineId"] = new SelectList(_context.Machines, "Id", "Name", memoryByMachine.MachineId); + return View(memoryByMachine); } // GET: Admin/MemoryByMachines/Delete/5 public async Task Delete(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); MemoryByMachine memoryByMachine = await _context.MemoryByMachine.Include(m => m.Machine).FirstOrDefaultAsync(m => m.Id == id); - if(memoryByMachine == null) return NotFound(); + + if(memoryByMachine == null) + return NotFound(); return View(memoryByMachine); } // POST: Admin/MemoryByMachines/Delete/5 - [HttpPost] - [ActionName("Delete")] - [ValidateAntiForgeryToken] + [HttpPost, ActionName("Delete"), ValidateAntiForgeryToken] public async Task DeleteConfirmed(long id) { MemoryByMachine memoryByMachine = await _context.MemoryByMachine.FindAsync(id); _context.MemoryByMachine.Remove(memoryByMachine); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - bool MemoryByMachineExists(long id) - { - return _context.MemoryByMachine.Any(e => e.Id == id); - } + bool MemoryByMachineExists(long id) => _context.MemoryByMachine.Any(e => e.Id == id); } } \ No newline at end of file diff --git a/Marechai/Areas/Admin/Controllers/MemoryByOwnedMachinesController.cs b/Marechai/Areas/Admin/Controllers/MemoryByOwnedMachinesController.cs index c05032bd..cedab24a 100644 --- a/Marechai/Areas/Admin/Controllers/MemoryByOwnedMachinesController.cs +++ b/Marechai/Areas/Admin/Controllers/MemoryByOwnedMachinesController.cs @@ -30,8 +30,8 @@ using System.Linq; using System.Threading.Tasks; -using Marechai.Database.Models; using Marechai.Areas.Admin.Models; +using Marechai.Database.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; @@ -40,62 +40,55 @@ using Microsoft.EntityFrameworkCore.Query; namespace Marechai.Areas.Admin.Controllers { - [Area("Admin")] - [Authorize] + [Area("Admin"), Authorize] public class MemoryByOwnedMachinesController : Controller { readonly MarechaiContext _context; - public MemoryByOwnedMachinesController(MarechaiContext context) - { - _context = context; - } + public MemoryByOwnedMachinesController(MarechaiContext context) => _context = context; // GET: Admin/MemoryByOwnedMachines public async Task Index() { IIncludableQueryable marechaiContext = _context.MemoryByOwnedMachine.Include(m => m.OwnedMachine); - return View(await marechaiContext.OrderBy(m => m.OwnedMachine.Machine.Company.Name) - .ThenBy(m => m.OwnedMachine.Machine.Name) - .ThenBy(m => m.OwnedMachine.User.UserName).ThenBy(m => m.Usage) - .ThenBy(m => m.Size).ThenBy(m => m.Type) - .Select(m => new MemoryByMachineViewModel - { - Id = m.Id, - Machine = - $"{m.OwnedMachine.Machine.Company.Name} {m.OwnedMachine.Machine.Name} <{m.OwnedMachine.User.UserName}>", - Size = m.Size, - Speed = m.Speed, - Type = m.Type, - Usage = m.Usage - }).ToListAsync()); + + return View(await marechaiContext.OrderBy(m => m.OwnedMachine.Machine.Company.Name). + ThenBy(m => m.OwnedMachine.Machine.Name). + ThenBy(m => m.OwnedMachine.User.UserName).ThenBy(m => m.Usage). + ThenBy(m => m.Size).ThenBy(m => m.Type). + Select(m => new MemoryByMachineViewModel + { + Id = m.Id, + Machine = + $"{m.OwnedMachine.Machine.Company.Name} {m.OwnedMachine.Machine.Name} <{m.OwnedMachine.User.UserName}>", + Size = m.Size, Speed = m.Speed, Type = m.Type, Usage = m.Usage + }).ToListAsync()); } // GET: Admin/MemoryByOwnedMachines/Details/5 public async Task Details(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); IIncludableQueryable marechaiContext = _context.MemoryByOwnedMachine.Include(m => m.OwnedMachine); - MemoryByMachineViewModel memoryByOwnedMachine = await marechaiContext - .OrderBy(m => m.OwnedMachine.Machine.Company.Name) - .ThenBy(m => m.OwnedMachine.Machine.Name) - .ThenBy(m => m.OwnedMachine.User.UserName) - .ThenBy(m => m.Usage).ThenBy(m => m.Size) - .ThenBy(m => m.Type) - .Select(m => new MemoryByMachineViewModel - { - Id = m.Id, - Machine = - $"{m.OwnedMachine.Machine.Company.Name} {m.OwnedMachine.Machine.Name} <{m.OwnedMachine.User.UserName}>", - Size = m.Size, - Speed = m.Speed, - Type = m.Type, - Usage = m.Usage - }).FirstOrDefaultAsync(m => m.Id == id); - if(memoryByOwnedMachine == null) return NotFound(); + + MemoryByMachineViewModel memoryByOwnedMachine = + await marechaiContext.OrderBy(m => m.OwnedMachine.Machine.Company.Name). + ThenBy(m => m.OwnedMachine.Machine.Name). + ThenBy(m => m.OwnedMachine.User.UserName).ThenBy(m => m.Usage). + ThenBy(m => m.Size).ThenBy(m => m.Type).Select(m => new MemoryByMachineViewModel + { + Id = m.Id, + Machine = + $"{m.OwnedMachine.Machine.Company.Name} {m.OwnedMachine.Machine.Name} <{m.OwnedMachine.User.UserName}>", + Size = m.Size, Speed = m.Speed, Type = m.Type, Usage = m.Usage + }).FirstOrDefaultAsync(m => m.Id == id); + + if(memoryByOwnedMachine == null) + return NotFound(); return View(memoryByOwnedMachine); } @@ -103,18 +96,22 @@ namespace Marechai.Areas.Admin.Controllers // GET: Admin/MemoryByOwnedMachines/Create public IActionResult Create() { - ViewData["OwnedMachineId"] = - new - SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name).ThenBy(m => m.Machine.Name).ThenBy(m => m.User.UserName).Select(m => new {m.Id, Name = $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>"}), - "Id", "Name"); + ViewData["OwnedMachineId"] = new SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name). + ThenBy(m => m.Machine.Name). + ThenBy(m => m.User.UserName).Select(m => new + { + m.Id, + Name = + $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>" + }), "Id", "Name"); + return View(); } // POST: Admin/MemoryByOwnedMachines/Create - // To protect from overposting attacks, please enable the specific properties you want to bind to, for + // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Create([Bind("OwnedMachineId,Type,Usage,Size,Speed,Id")] MemoryByOwnedMachine memoryByOwnedMachine) { @@ -122,40 +119,54 @@ namespace Marechai.Areas.Admin.Controllers { _context.Add(memoryByOwnedMachine); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - ViewData["OwnedMachineId"] = - new - SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name).ThenBy(m => m.Machine.Name).ThenBy(m => m.User.UserName).Select(m => new {m.Id, Name = $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>"}), - "Id", "Name", memoryByOwnedMachine.OwnedMachineId); + ViewData["OwnedMachineId"] = new SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name). + ThenBy(m => m.Machine.Name). + ThenBy(m => m.User.UserName).Select(m => new + { + m.Id, + Name = + $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>" + }), "Id", "Name", memoryByOwnedMachine.OwnedMachineId); + return View(memoryByOwnedMachine); } // GET: Admin/MemoryByOwnedMachines/Edit/5 public async Task Edit(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); MemoryByOwnedMachine memoryByOwnedMachine = await _context.MemoryByOwnedMachine.FindAsync(id); - if(memoryByOwnedMachine == null) return NotFound(); - ViewData["OwnedMachineId"] = - new - SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name).ThenBy(m => m.Machine.Name).ThenBy(m => m.User.UserName).Select(m => new {m.Id, Name = $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>"}), - "Id", "Name", memoryByOwnedMachine.OwnedMachineId); + if(memoryByOwnedMachine == null) + return NotFound(); + + ViewData["OwnedMachineId"] = new SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name). + ThenBy(m => m.Machine.Name). + ThenBy(m => m.User.UserName).Select(m => new + { + m.Id, + Name = + $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>" + }), "Id", "Name", memoryByOwnedMachine.OwnedMachineId); + return View(memoryByOwnedMachine); } // POST: Admin/MemoryByOwnedMachines/Edit/5 - // To protect from overposting attacks, please enable the specific properties you want to bind to, for + // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Edit(long id, [Bind("OwnedMachineId,Type,Usage,Size,Speed,Id")] MemoryByOwnedMachine memoryByOwnedMachine) { - if(id != memoryByOwnedMachine.Id) return NotFound(); + if(id != memoryByOwnedMachine.Id) + return NotFound(); if(ModelState.IsValid) { @@ -166,7 +177,8 @@ namespace Marechai.Areas.Admin.Controllers } catch(DbUpdateConcurrencyException) { - if(!MemoryByOwnedMachineExists(memoryByOwnedMachine.Id)) return NotFound(); + if(!MemoryByOwnedMachineExists(memoryByOwnedMachine.Id)) + return NotFound(); throw; } @@ -174,40 +186,44 @@ namespace Marechai.Areas.Admin.Controllers return RedirectToAction(nameof(Index)); } - ViewData["OwnedMachineId"] = - new - SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name).ThenBy(m => m.Machine.Name).ThenBy(m => m.User.UserName).Select(m => new {m.Id, Name = $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>"}), - "Id", "Name", memoryByOwnedMachine.OwnedMachineId); + ViewData["OwnedMachineId"] = new SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name). + ThenBy(m => m.Machine.Name). + ThenBy(m => m.User.UserName).Select(m => new + { + m.Id, + Name = + $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>" + }), "Id", "Name", memoryByOwnedMachine.OwnedMachineId); + return View(memoryByOwnedMachine); } // GET: Admin/MemoryByOwnedMachines/Delete/5 public async Task Delete(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); MemoryByOwnedMachine memoryByOwnedMachine = await _context.MemoryByOwnedMachine.Include(m => m.OwnedMachine).FirstOrDefaultAsync(m => m.Id == id); - if(memoryByOwnedMachine == null) return NotFound(); + + if(memoryByOwnedMachine == null) + return NotFound(); return View(memoryByOwnedMachine); } // POST: Admin/MemoryByOwnedMachines/Delete/5 - [HttpPost] - [ActionName("Delete")] - [ValidateAntiForgeryToken] + [HttpPost, ActionName("Delete"), ValidateAntiForgeryToken] public async Task DeleteConfirmed(long id) { MemoryByOwnedMachine memoryByOwnedMachine = await _context.MemoryByOwnedMachine.FindAsync(id); _context.MemoryByOwnedMachine.Remove(memoryByOwnedMachine); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - bool MemoryByOwnedMachineExists(long id) - { - return _context.MemoryByOwnedMachine.Any(e => e.Id == id); - } + bool MemoryByOwnedMachineExists(long id) => _context.MemoryByOwnedMachine.Any(e => e.Id == id); } } \ No newline at end of file diff --git a/Marechai/Areas/Admin/Controllers/NewsController.cs b/Marechai/Areas/Admin/Controllers/NewsController.cs index 7fc2f302..5358fbaa 100644 --- a/Marechai/Areas/Admin/Controllers/NewsController.cs +++ b/Marechai/Areas/Admin/Controllers/NewsController.cs @@ -37,16 +37,12 @@ using Microsoft.EntityFrameworkCore; namespace Marechai.Areas.Admin.Controllers { - [Area("Admin")] - [Authorize] + [Area("Admin"), Authorize] public class NewsController : Controller { readonly MarechaiContext _context; - public NewsController(MarechaiContext context) - { - _context = context; - } + public NewsController(MarechaiContext context) => _context = context; // GET: Admin/News public async Task Index() => @@ -55,29 +51,28 @@ namespace Marechai.Areas.Admin.Controllers // GET: Admin/News/Delete/5 public async Task Delete(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); News news = await _context.News.FirstOrDefaultAsync(m => m.Id == id); - if(news == null) return NotFound(); + + if(news == null) + return NotFound(); return View(news); } // POST: Admin/News/Delete/5 - [HttpPost] - [ActionName("Delete")] - [ValidateAntiForgeryToken] + [HttpPost, ActionName("Delete"), ValidateAntiForgeryToken] public async Task DeleteConfirmed(int id) { News news = await _context.News.FindAsync(id); _context.News.Remove(news); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - bool NewsExists(int id) - { - return _context.News.Any(e => e.Id == id); - } + bool NewsExists(int id) => _context.News.Any(e => e.Id == id); } } \ No newline at end of file diff --git a/Marechai/Areas/Admin/Controllers/OwnedMachineController.cs b/Marechai/Areas/Admin/Controllers/OwnedMachineController.cs index 34fd9f75..a4b0bd1b 100644 --- a/Marechai/Areas/Admin/Controllers/OwnedMachineController.cs +++ b/Marechai/Areas/Admin/Controllers/OwnedMachineController.cs @@ -1,7 +1,7 @@ using System.Linq; using System.Threading.Tasks; -using Marechai.Database.Models; using Marechai.Areas.Admin.Models; +using Marechai.Database.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; @@ -9,34 +9,29 @@ using Microsoft.EntityFrameworkCore; namespace Marechai.Areas.Admin.Controllers { - [Area("Admin")] - [Authorize] + [Area("Admin"), Authorize] public class OwnedMachineController : Controller { readonly MarechaiContext _context; - public OwnedMachineController(MarechaiContext context) - { - _context = context; - } + public OwnedMachineController(MarechaiContext context) => _context = context; // GET: OwnedMachine public async Task Index() { - IQueryable marechaiContext = _context - .OwnedMachines.Include(o => o.Machine) - .OrderBy(o => o.Machine.Company.Name) - .ThenBy(o => o.Machine.Name).ThenBy(o => o.User.UserName) - .ThenBy(o => o.AcquisitionDate) - .Select(o => new OwnedMachineViewModel - { - AcquisitionDate = o.AcquisitionDate, - Id = o.Id, - Machine = - $"{o.Machine.Company.Name} {o.Machine.Name}", - Status = o.Status, - User = o.User.UserName - }); + IQueryable marechaiContext = _context. + OwnedMachines.Include(o => o.Machine). + OrderBy(o => o.Machine.Company.Name). + ThenBy(o => o.Machine.Name). + ThenBy(o => o.User.UserName). + ThenBy(o => o.AcquisitionDate). + Select(o => new OwnedMachineViewModel + { + AcquisitionDate = o.AcquisitionDate, Id = o.Id, + Machine = + $"{o.Machine.Company.Name} {o.Machine.Name}", + Status = o.Status, User = o.User.UserName + }); return View(await marechaiContext.ToListAsync()); } @@ -44,27 +39,23 @@ namespace Marechai.Areas.Admin.Controllers // GET: OwnedMachine/Details/5 public async Task Details(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); - OwnedMachineViewModel ownedMachine = await _context.OwnedMachines - .Include(o => o.Machine) - .Select(o => new OwnedMachineViewModel - { - AcquisitionDate = o.AcquisitionDate, - Boxed = o.Boxed, - LastStatusDate = o.LastStatusDate, - LostDate = o.LostDate, - Machine = - $"{o.Machine.Company.Name} {o.Machine.Name}", - Manuals = o.Manuals, - SerialNumber = o.SerialNumber, - SerialNumberVisible = - o.SerialNumberVisible, - Status = o.Status, - User = o.User.UserName, - Id = o.Id - }).FirstOrDefaultAsync(m => m.Id == id); - if(ownedMachine == null) return NotFound(); + OwnedMachineViewModel ownedMachine = + await _context.OwnedMachines.Include(o => o.Machine).Select(o => new OwnedMachineViewModel + { + AcquisitionDate = o.AcquisitionDate, Boxed = o.Boxed, + LastStatusDate = o.LastStatusDate, + LostDate = o.LostDate, + Machine = $"{o.Machine.Company.Name} {o.Machine.Name}", Manuals = o.Manuals, + SerialNumber = o.SerialNumber, SerialNumberVisible = o.SerialNumberVisible, + Status = o.Status, + User = o.User.UserName, Id = o.Id + }).FirstOrDefaultAsync(m => m.Id == id); + + if(ownedMachine == null) + return NotFound(); return View(ownedMachine); } @@ -72,73 +63,87 @@ namespace Marechai.Areas.Admin.Controllers // GET: OwnedMachine/Create public IActionResult Create() { - ViewData["MachineId"] = - new - SelectList(_context.Machines.OrderBy(m => m.Company.Name).ThenBy(m => m.Name).Select(m => new {m.Id, Name = $"{m.Company.Name} {m.Name}"}), - "Id", "Name"); - ViewData["UserId"] = - new SelectList(_context.Users.OrderBy(u => u.UserName).Select(u => new {u.Id, u.UserName}), "Id", - "UserName"); + ViewData["MachineId"] = new SelectList(_context.Machines.OrderBy(m => m.Company.Name).ThenBy(m => m.Name). + Select(m => new + { + m.Id, Name = $"{m.Company.Name} {m.Name}" + }), "Id", "Name"); + + ViewData["UserId"] = new SelectList(_context.Users.OrderBy(u => u.UserName).Select(u => new + { + u.Id, u.UserName + }), "Id", "UserName"); + return View(); } // POST: OwnedMachine/Create // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Create( - [Bind( - "AcquisitionDate,LostDate,Status,LastStatusDate,Trade,Boxed,Manuals,SerialNumber,SerialNumberVisible,MachineId,UserId,Id")] + [Bind("AcquisitionDate,LostDate,Status,LastStatusDate,Trade,Boxed,Manuals,SerialNumber,SerialNumberVisible,MachineId,UserId,Id")] OwnedMachine ownedMachine) { if(ModelState.IsValid) { _context.Add(ownedMachine); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - ViewData["MachineId"] = - new - SelectList(_context.Machines.OrderBy(m => m.Company.Name).ThenBy(m => m.Name).Select(m => new {m.Id, Name = $"{m.Company.Name} {m.Name}"}), - "Id", "Name"); - ViewData["UserId"] = - new SelectList(_context.Users.OrderBy(u => u.UserName).Select(u => new {u.Id, u.UserName}), "Id", - "UserName"); + ViewData["MachineId"] = new SelectList(_context.Machines.OrderBy(m => m.Company.Name).ThenBy(m => m.Name). + Select(m => new + { + m.Id, Name = $"{m.Company.Name} {m.Name}" + }), "Id", "Name"); + + ViewData["UserId"] = new SelectList(_context.Users.OrderBy(u => u.UserName).Select(u => new + { + u.Id, u.UserName + }), "Id", "UserName"); + return View(ownedMachine); } // GET: OwnedMachine/Edit/5 public async Task Edit(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); OwnedMachine ownedMachine = await _context.OwnedMachines.FindAsync(id); - if(ownedMachine == null) return NotFound(); - ViewData["MachineId"] = - new - SelectList(_context.Machines.OrderBy(m => m.Company.Name).ThenBy(m => m.Name).Select(m => new {m.Id, Name = $"{m.Company.Name} {m.Name}"}), - "Id", "Name"); - ViewData["UserId"] = - new - SelectList(_context.Users.OrderBy(u => u.UserName).Where(u => u.Id == ownedMachine.UserId).Select(u => new {u.Id, u.UserName}), - "Id", "UserName"); + if(ownedMachine == null) + return NotFound(); + + ViewData["MachineId"] = new SelectList(_context.Machines.OrderBy(m => m.Company.Name).ThenBy(m => m.Name). + Select(m => new + { + m.Id, Name = $"{m.Company.Name} {m.Name}" + }), "Id", "Name"); + + ViewData["UserId"] = new SelectList(_context.Users.OrderBy(u => u.UserName). + Where(u => u.Id == ownedMachine.UserId).Select(u => new + { + u.Id, u.UserName + }), "Id", "UserName"); + return View(ownedMachine); } // POST: OwnedMachine/Edit/5 // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Edit( - long id, [Bind( - "AcquisitionDate,LostDate,Status,LastStatusDate,Trade,Boxed,Manuals,SerialNumber,SerialNumberVisible,MachineId,Id")] + long id, + [Bind("AcquisitionDate,LostDate,Status,LastStatusDate,Trade,Boxed,Manuals,SerialNumber,SerialNumberVisible,MachineId,Id")] OwnedMachine ownedMachine) { - if(id != ownedMachine.Id) return NotFound(); + if(id != ownedMachine.Id) + return NotFound(); if(ModelState.IsValid) { @@ -149,7 +154,8 @@ namespace Marechai.Areas.Admin.Controllers } catch(DbUpdateConcurrencyException) { - if(!OwnedMachineExists(ownedMachine.Id)) return NotFound(); + if(!OwnedMachineExists(ownedMachine.Id)) + return NotFound(); throw; } @@ -157,60 +163,56 @@ namespace Marechai.Areas.Admin.Controllers return RedirectToAction(nameof(Index)); } - ViewData["MachineId"] = - new - SelectList(_context.Machines.OrderBy(m => m.Company.Name).ThenBy(m => m.Name).Select(m => new {m.Id, Name = $"{m.Company.Name} {m.Name}"}), - "Id", "Name"); - ViewData["UserId"] = - new - SelectList(_context.Users.OrderBy(u => u.UserName).Where(u => u.Id == ownedMachine.UserId).Select(u => new {u.Id, u.UserName}), - "Id", "UserName"); + ViewData["MachineId"] = new SelectList(_context.Machines.OrderBy(m => m.Company.Name).ThenBy(m => m.Name). + Select(m => new + { + m.Id, Name = $"{m.Company.Name} {m.Name}" + }), "Id", "Name"); + + ViewData["UserId"] = new SelectList(_context.Users.OrderBy(u => u.UserName). + Where(u => u.Id == ownedMachine.UserId).Select(u => new + { + u.Id, u.UserName + }), "Id", "UserName"); + return View(ownedMachine); } // GET: OwnedMachine/Delete/5 public async Task Delete(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); - OwnedMachineViewModel ownedMachine = await _context.OwnedMachines - .Include(o => o.Machine) - .Select(o => new OwnedMachineViewModel - { - AcquisitionDate = o.AcquisitionDate, - Boxed = o.Boxed, - LastStatusDate = o.LastStatusDate, - LostDate = o.LostDate, - Machine = - $"{o.Machine.Company.Name} {o.Machine.Name}", - Manuals = o.Manuals, - SerialNumber = o.SerialNumber, - SerialNumberVisible = - o.SerialNumberVisible, - Status = o.Status, - User = o.User.UserName, - Id = o.Id - }).FirstOrDefaultAsync(m => m.Id == id); - if(ownedMachine == null) return NotFound(); + OwnedMachineViewModel ownedMachine = + await _context.OwnedMachines.Include(o => o.Machine).Select(o => new OwnedMachineViewModel + { + AcquisitionDate = o.AcquisitionDate, Boxed = o.Boxed, + LastStatusDate = o.LastStatusDate, + LostDate = o.LostDate, + Machine = $"{o.Machine.Company.Name} {o.Machine.Name}", Manuals = o.Manuals, + SerialNumber = o.SerialNumber, SerialNumberVisible = o.SerialNumberVisible, + Status = o.Status, + User = o.User.UserName, Id = o.Id + }).FirstOrDefaultAsync(m => m.Id == id); + + if(ownedMachine == null) + return NotFound(); return View(ownedMachine); } // POST: OwnedMachine/Delete/5 - [HttpPost] - [ActionName("Delete")] - [ValidateAntiForgeryToken] + [HttpPost, ActionName("Delete"), ValidateAntiForgeryToken] public async Task DeleteConfirmed(long id) { OwnedMachine ownedMachine = await _context.OwnedMachines.FindAsync(id); _context.OwnedMachines.Remove(ownedMachine); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - bool OwnedMachineExists(long id) - { - return _context.OwnedMachines.Any(e => e.Id == id); - } + bool OwnedMachineExists(long id) => _context.OwnedMachines.Any(e => e.Id == id); } } \ No newline at end of file diff --git a/Marechai/Areas/Admin/Controllers/PeopleController.cs b/Marechai/Areas/Admin/Controllers/PeopleController.cs index c20caf60..edfcc012 100644 --- a/Marechai/Areas/Admin/Controllers/PeopleController.cs +++ b/Marechai/Areas/Admin/Controllers/PeopleController.cs @@ -9,31 +9,32 @@ using Microsoft.EntityFrameworkCore.Query; namespace Marechai.Areas.Admin.Controllers { - [Area("Admin")] - [Authorize] + [Area("Admin"), Authorize] public class PeopleController : Controller { readonly MarechaiContext _context; - public PeopleController(MarechaiContext context) - { - _context = context; - } + public PeopleController(MarechaiContext context) => _context = context; // GET: People public async Task Index() { - IIncludableQueryable marechaiContext = _context.People.Include(p => p.CountryOfBirth); + IIncludableQueryable marechaiContext = + _context.People.Include(p => p.CountryOfBirth); + return View(await marechaiContext.OrderBy(p => p.FullName).ToListAsync()); } // GET: People/Details/5 public async Task Details(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); Person person = await _context.People.Include(p => p.CountryOfBirth).FirstOrDefaultAsync(m => m.Id == id); - if(person == null) return NotFound(); + + if(person == null) + return NotFound(); return View(person); } @@ -42,55 +43,60 @@ namespace Marechai.Areas.Admin.Controllers public IActionResult Create() { ViewData["CountryOfBirthId"] = new SelectList(_context.Iso31661Numeric, "Id", "Name"); + return View(); } // POST: People/Create // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Create( - [Bind( - "Name,Surname,BirthDate,DeathDate,Webpage,Twitter,Facebook,Photo,CountryOfBirthId,Id,Alias,DisplayName")] + [Bind("Name,Surname,BirthDate,DeathDate,Webpage,Twitter,Facebook,Photo,CountryOfBirthId,Id,Alias,DisplayName")] Person person) { if(ModelState.IsValid) { _context.Add(person); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } ViewData["CountryOfBirthId"] = new SelectList(_context.Iso31661Numeric, "Id", "Name", person.CountryOfBirthId); + return View(person); } // GET: People/Edit/5 public async Task Edit(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); Person person = await _context.People.FindAsync(id); - if(person == null) return NotFound(); + + if(person == null) + return NotFound(); ViewData["CountryOfBirthId"] = new SelectList(_context.Iso31661Numeric, "Id", "Name", person.CountryOfBirthId); + return View(person); } // POST: People/Edit/5 // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Edit( - int id, [Bind( - "Name,Surname,BirthDate,DeathDate,Webpage,Twitter,Facebook,Photo,CountryOfBirthId,Id,Alias,DisplayName")] + int id, + [Bind("Name,Surname,BirthDate,DeathDate,Webpage,Twitter,Facebook,Photo,CountryOfBirthId,Id,Alias,DisplayName")] Person person) { - if(id != person.Id) return NotFound(); + if(id != person.Id) + return NotFound(); if(ModelState.IsValid) { @@ -101,7 +107,8 @@ namespace Marechai.Areas.Admin.Controllers } catch(DbUpdateConcurrencyException) { - if(!PersonExists(person.Id)) return NotFound(); + if(!PersonExists(person.Id)) + return NotFound(); throw; } @@ -111,36 +118,36 @@ namespace Marechai.Areas.Admin.Controllers ViewData["CountryOfBirthId"] = new SelectList(_context.Iso31661Numeric, "Id", "Name", person.CountryOfBirthId); + return View(person); } // GET: People/Delete/5 public async Task Delete(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); Person person = await _context.People.Include(p => p.CountryOfBirth).FirstOrDefaultAsync(m => m.Id == id); - if(person == null) return NotFound(); + + if(person == null) + return NotFound(); return View(person); } // POST: People/Delete/5 - [HttpPost] - [ActionName("Delete")] - [ValidateAntiForgeryToken] + [HttpPost, ActionName("Delete"), ValidateAntiForgeryToken] public async Task DeleteConfirmed(int id) { Person person = await _context.People.FindAsync(id); _context.People.Remove(person); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - bool PersonExists(int id) - { - return _context.People.Any(e => e.Id == id); - } + bool PersonExists(int id) => _context.People.Any(e => e.Id == id); [AcceptVerbs("Get", "Post")] public IActionResult VerifyTwitter(string twitter) => diff --git a/Marechai/Areas/Admin/Controllers/ProcessorsByMachinesController.cs b/Marechai/Areas/Admin/Controllers/ProcessorsByMachinesController.cs index 4619c354..53fbb19a 100644 --- a/Marechai/Areas/Admin/Controllers/ProcessorsByMachinesController.cs +++ b/Marechai/Areas/Admin/Controllers/ProcessorsByMachinesController.cs @@ -30,8 +30,8 @@ using System.Linq; using System.Threading.Tasks; -using Marechai.Database.Models; using Marechai.Areas.Admin.Models; +using Marechai.Database.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; @@ -40,41 +40,39 @@ using Microsoft.EntityFrameworkCore.Query; namespace Marechai.Areas.Admin.Controllers { - [Area("Admin")] - [Authorize] + [Area("Admin"), Authorize] public class ProcessorsByMachinesController : Controller { readonly MarechaiContext _context; - public ProcessorsByMachinesController(MarechaiContext context) - { - _context = context; - } + public ProcessorsByMachinesController(MarechaiContext context) => _context = context; // GET: Admin/ProcessorsByMachines public async Task Index() { IIncludableQueryable marechaiContext = _context.ProcessorsByMachine.Include(p => p.Machine).Include(p => p.Processor); - return View(await marechaiContext.OrderBy(p => p.Machine.Name).ThenBy(p => p.Processor.Name) - .Select(p => new ProcessorsByMachineViewModel - { - Id = p.Id, - Machine = p.Machine.Name, - Processor = p.Processor.Name, - Speed = p.Speed - }).ToListAsync()); + + return View(await marechaiContext.OrderBy(p => p.Machine.Name).ThenBy(p => p.Processor.Name). + Select(p => new ProcessorsByMachineViewModel + { + Id = p.Id, Machine = p.Machine.Name, Processor = p.Processor.Name, + Speed = p.Speed + }).ToListAsync()); } // GET: Admin/ProcessorsByMachines/Details/5 public async Task Details(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); ProcessorsByMachine processorsByMachine = - await _context.ProcessorsByMachine.Include(p => p.Machine).Include(p => p.Processor) - .FirstOrDefaultAsync(m => m.Id == id); - if(processorsByMachine == null) return NotFound(); + await _context.ProcessorsByMachine.Include(p => p.Machine).Include(p => p.Processor). + FirstOrDefaultAsync(m => m.Id == id); + + if(processorsByMachine == null) + return NotFound(); return View(processorsByMachine); } @@ -82,16 +80,16 @@ namespace Marechai.Areas.Admin.Controllers // GET: Admin/ProcessorsByMachines/Create public IActionResult Create() { - ViewData["MachineId"] = new SelectList(_context.Machines, "Id", "Name"); + ViewData["MachineId"] = new SelectList(_context.Machines, "Id", "Name"); ViewData["ProcessorId"] = new SelectList(_context.Processors, "Id", "Name"); + return View(); } // POST: Admin/ProcessorsByMachines/Create // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Create([Bind("ProcessorId,MachineId,Speed,Id")] ProcessorsByMachine processorsByMachine) { @@ -99,38 +97,46 @@ namespace Marechai.Areas.Admin.Controllers { _context.Add(processorsByMachine); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } ViewData["MachineId"] = new SelectList(_context.Machines, "Id", "Name", processorsByMachine.MachineId); + ViewData["ProcessorId"] = new SelectList(_context.Processors, "Id", "Name", processorsByMachine.ProcessorId); + return View(processorsByMachine); } // GET: Admin/ProcessorsByMachines/Edit/5 public async Task Edit(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); ProcessorsByMachine processorsByMachine = await _context.ProcessorsByMachine.FindAsync(id); - if(processorsByMachine == null) return NotFound(); + + if(processorsByMachine == null) + return NotFound(); ViewData["MachineId"] = new SelectList(_context.Machines, "Id", "Name", processorsByMachine.MachineId); + ViewData["ProcessorId"] = new SelectList(_context.Processors, "Id", "Name", processorsByMachine.ProcessorId); + return View(processorsByMachine); } // POST: Admin/ProcessorsByMachines/Edit/5 // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Edit(long id, [Bind("ProcessorId,MachineId,Speed,Id")] ProcessorsByMachine processorsByMachine) { - if(id != processorsByMachine.Id) return NotFound(); + if(id != processorsByMachine.Id) + return NotFound(); if(ModelState.IsValid) { @@ -141,7 +147,8 @@ namespace Marechai.Areas.Admin.Controllers } catch(DbUpdateConcurrencyException) { - if(!ProcessorsByMachineExists(processorsByMachine.Id)) return NotFound(); + if(!ProcessorsByMachineExists(processorsByMachine.Id)) + return NotFound(); throw; } @@ -150,39 +157,40 @@ namespace Marechai.Areas.Admin.Controllers } ViewData["MachineId"] = new SelectList(_context.Machines, "Id", "Name", processorsByMachine.MachineId); + ViewData["ProcessorId"] = new SelectList(_context.Processors, "Id", "Name", processorsByMachine.ProcessorId); + return View(processorsByMachine); } // GET: Admin/ProcessorsByMachines/Delete/5 public async Task Delete(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); ProcessorsByMachine processorsByMachine = - await _context.ProcessorsByMachine.Include(p => p.Machine).Include(p => p.Processor) - .FirstOrDefaultAsync(m => m.Id == id); - if(processorsByMachine == null) return NotFound(); + await _context.ProcessorsByMachine.Include(p => p.Machine).Include(p => p.Processor). + FirstOrDefaultAsync(m => m.Id == id); + + if(processorsByMachine == null) + return NotFound(); return View(processorsByMachine); } // POST: Admin/ProcessorsByMachines/Delete/5 - [HttpPost] - [ActionName("Delete")] - [ValidateAntiForgeryToken] + [HttpPost, ActionName("Delete"), ValidateAntiForgeryToken] public async Task DeleteConfirmed(long id) { ProcessorsByMachine processorsByMachine = await _context.ProcessorsByMachine.FindAsync(id); _context.ProcessorsByMachine.Remove(processorsByMachine); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - bool ProcessorsByMachineExists(long id) - { - return _context.ProcessorsByMachine.Any(e => e.Id == id); - } + bool ProcessorsByMachineExists(long id) => _context.ProcessorsByMachine.Any(e => e.Id == id); } } \ No newline at end of file diff --git a/Marechai/Areas/Admin/Controllers/ProcessorsByOwnedMachinesController.cs b/Marechai/Areas/Admin/Controllers/ProcessorsByOwnedMachinesController.cs index 204b6155..0ad3090c 100644 --- a/Marechai/Areas/Admin/Controllers/ProcessorsByOwnedMachinesController.cs +++ b/Marechai/Areas/Admin/Controllers/ProcessorsByOwnedMachinesController.cs @@ -30,8 +30,8 @@ using System.Linq; using System.Threading.Tasks; -using Marechai.Database.Models; using Marechai.Areas.Admin.Models; +using Marechai.Database.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; @@ -40,49 +40,47 @@ using Microsoft.EntityFrameworkCore.Query; namespace Marechai.Areas.Admin.Controllers { - [Area("Admin")] - [Authorize] + [Area("Admin"), Authorize] public class ProcessorsByOwnedMachinesController : Controller { readonly MarechaiContext _context; - public ProcessorsByOwnedMachinesController(MarechaiContext context) - { - _context = context; - } + public ProcessorsByOwnedMachinesController(MarechaiContext context) => _context = context; // GET: Admin/ProcessorsByOwnedMachines public async Task Index() { IIncludableQueryable marechaiContext = _context.ProcessorsByOwnedMachine.Include(p => p.OwnedMachine).Include(p => p.Processor); - return View(await marechaiContext.OrderBy(p => p.OwnedMachine.Machine.Name).ThenBy(p => p.Processor.Name) - .Select(p => new ProcessorsByMachineViewModel - { - Id = p.Id, - Machine = - $"{p.OwnedMachine.Machine.Company.Name} {p.OwnedMachine.Machine.Name} <{p.OwnedMachine.User.UserName}>", - Processor = p.Processor.Name, - Speed = p.Speed - }).ToListAsync()); + + return View(await marechaiContext.OrderBy(p => p.OwnedMachine.Machine.Name).ThenBy(p => p.Processor.Name). + Select(p => new ProcessorsByMachineViewModel + { + Id = p.Id, + Machine = + $"{p.OwnedMachine.Machine.Company.Name} {p.OwnedMachine.Machine.Name} <{p.OwnedMachine.User.UserName}>", + Processor = p.Processor.Name, Speed = p.Speed + }).ToListAsync()); } // GET: Admin/ProcessorsByOwnedMachines/Details/5 public async Task Details(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); ProcessorsByMachineViewModel processorsByOwnedMachine = - await _context.ProcessorsByOwnedMachine.OrderBy(p => p.OwnedMachine.Machine.Name) - .ThenBy(p => p.Processor.Name).Select(p => new ProcessorsByMachineViewModel + await _context.ProcessorsByOwnedMachine.OrderBy(p => p.OwnedMachine.Machine.Name). + ThenBy(p => p.Processor.Name).Select(p => new ProcessorsByMachineViewModel { Id = p.Id, Machine = $"{p.OwnedMachine.Machine.Company.Name} {p.OwnedMachine.Machine.Name} <{p.OwnedMachine.User.UserName}>", - Processor = p.Processor.Name, - Speed = p.Speed + Processor = p.Processor.Name, Speed = p.Speed }).FirstOrDefaultAsync(m => m.Id == id); - if(processorsByOwnedMachine == null) return NotFound(); + + if(processorsByOwnedMachine == null) + return NotFound(); return View(processorsByOwnedMachine); } @@ -90,19 +88,24 @@ namespace Marechai.Areas.Admin.Controllers // GET: Admin/ProcessorsByOwnedMachines/Create public IActionResult Create() { - ViewData["OwnedMachineId"] = - new - SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name).ThenBy(m => m.Machine.Name).ThenBy(m => m.User.UserName).Select(m => new {m.Id, Name = $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>"}), - "Id", "Name"); + ViewData["OwnedMachineId"] = new SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name). + ThenBy(m => m.Machine.Name). + ThenBy(m => m.User.UserName).Select(m => new + { + m.Id, + Name = + $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>" + }), "Id", "Name"); + ViewData["ProcessorId"] = new SelectList(_context.Processors, "Id", "Name"); + return View(); } // POST: Admin/ProcessorsByOwnedMachines/Create // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Create([Bind("ProcessorId,OwnedMachineId,Speed,Id")] ProcessorsByOwnedMachine processorsByOwnedMachine) { @@ -110,44 +113,62 @@ namespace Marechai.Areas.Admin.Controllers { _context.Add(processorsByOwnedMachine); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - ViewData["OwnedMachineId"] = - new - SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name).ThenBy(m => m.Machine.Name).ThenBy(m => m.User.UserName).Select(m => new {m.Id, Name = $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>"}), - "Id", "Name", processorsByOwnedMachine.OwnedMachineId); + ViewData["OwnedMachineId"] = new SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name). + ThenBy(m => m.Machine.Name). + ThenBy(m => m.User.UserName).Select(m => new + { + m.Id, + Name = + $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>" + }), "Id", "Name", + processorsByOwnedMachine.OwnedMachineId); + ViewData["ProcessorId"] = new SelectList(_context.Processors, "Id", "Name", processorsByOwnedMachine.ProcessorId); + return View(processorsByOwnedMachine); } // GET: Admin/ProcessorsByOwnedMachines/Edit/5 public async Task Edit(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); ProcessorsByOwnedMachine processorsByOwnedMachine = await _context.ProcessorsByOwnedMachine.FindAsync(id); - if(processorsByOwnedMachine == null) return NotFound(); - ViewData["OwnedMachineId"] = - new - SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name).ThenBy(m => m.Machine.Name).ThenBy(m => m.User.UserName).Select(m => new {m.Id, Name = $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>"}), - "Id", "Name", processorsByOwnedMachine.OwnedMachineId); + if(processorsByOwnedMachine == null) + return NotFound(); + + ViewData["OwnedMachineId"] = new SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name). + ThenBy(m => m.Machine.Name). + ThenBy(m => m.User.UserName).Select(m => new + { + m.Id, + Name = + $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>" + }), "Id", "Name", + processorsByOwnedMachine.OwnedMachineId); + ViewData["ProcessorId"] = new SelectList(_context.Processors, "Id", "Name", processorsByOwnedMachine.ProcessorId); + return View(processorsByOwnedMachine); } // POST: Admin/ProcessorsByOwnedMachines/Edit/5 // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Edit(long id, [Bind("ProcessorId,OwnedMachineId,Speed,Id")] ProcessorsByOwnedMachine processorsByOwnedMachine) { - if(id != processorsByOwnedMachine.Id) return NotFound(); + if(id != processorsByOwnedMachine.Id) + return NotFound(); if(ModelState.IsValid) { @@ -158,7 +179,8 @@ namespace Marechai.Areas.Admin.Controllers } catch(DbUpdateConcurrencyException) { - if(!ProcessorsByOwnedMachineExists(processorsByOwnedMachine.Id)) return NotFound(); + if(!ProcessorsByOwnedMachineExists(processorsByOwnedMachine.Id)) + return NotFound(); throw; } @@ -166,50 +188,55 @@ namespace Marechai.Areas.Admin.Controllers return RedirectToAction(nameof(Index)); } - ViewData["OwnedMachineId"] = - new - SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name).ThenBy(m => m.Machine.Name).ThenBy(m => m.User.UserName).Select(m => new {m.Id, Name = $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>"}), - "Id", "Name", processorsByOwnedMachine.OwnedMachineId); + ViewData["OwnedMachineId"] = new SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name). + ThenBy(m => m.Machine.Name). + ThenBy(m => m.User.UserName).Select(m => new + { + m.Id, + Name = + $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>" + }), "Id", "Name", + processorsByOwnedMachine.OwnedMachineId); + ViewData["ProcessorId"] = new SelectList(_context.Processors, "Id", "Name", processorsByOwnedMachine.ProcessorId); + return View(processorsByOwnedMachine); } // GET: Admin/ProcessorsByOwnedMachines/Delete/5 public async Task Delete(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); ProcessorsByMachineViewModel processorsByOwnedMachine = - await _context.ProcessorsByOwnedMachine.OrderBy(p => p.OwnedMachine.Machine.Name) - .ThenBy(p => p.Processor.Name).Select(p => new ProcessorsByMachineViewModel + await _context.ProcessorsByOwnedMachine.OrderBy(p => p.OwnedMachine.Machine.Name). + ThenBy(p => p.Processor.Name).Select(p => new ProcessorsByMachineViewModel { Id = p.Id, Machine = $"{p.OwnedMachine.Machine.Company.Name} {p.OwnedMachine.Machine.Name} <{p.OwnedMachine.User.UserName}>", - Processor = p.Processor.Name, - Speed = p.Speed + Processor = p.Processor.Name, Speed = p.Speed }).FirstOrDefaultAsync(m => m.Id == id); - if(processorsByOwnedMachine == null) return NotFound(); + + if(processorsByOwnedMachine == null) + return NotFound(); return View(processorsByOwnedMachine); } // POST: Admin/ProcessorsByOwnedMachines/Delete/5 - [HttpPost] - [ActionName("Delete")] - [ValidateAntiForgeryToken] + [HttpPost, ActionName("Delete"), ValidateAntiForgeryToken] public async Task DeleteConfirmed(long id) { ProcessorsByOwnedMachine processorsByOwnedMachine = await _context.ProcessorsByOwnedMachine.FindAsync(id); _context.ProcessorsByOwnedMachine.Remove(processorsByOwnedMachine); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - bool ProcessorsByOwnedMachineExists(long id) - { - return _context.ProcessorsByOwnedMachine.Any(e => e.Id == id); - } + bool ProcessorsByOwnedMachineExists(long id) => _context.ProcessorsByOwnedMachine.Any(e => e.Id == id); } } \ No newline at end of file diff --git a/Marechai/Areas/Admin/Controllers/ProcessorsController.cs b/Marechai/Areas/Admin/Controllers/ProcessorsController.cs index 6d059163..3dd5cc10 100644 --- a/Marechai/Areas/Admin/Controllers/ProcessorsController.cs +++ b/Marechai/Areas/Admin/Controllers/ProcessorsController.cs @@ -30,8 +30,8 @@ using System.Linq; using System.Threading.Tasks; -using Marechai.Database.Models; using Marechai.Areas.Admin.Models; +using Marechai.Database.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; @@ -40,42 +40,39 @@ using Microsoft.EntityFrameworkCore.Query; namespace Marechai.Areas.Admin.Controllers { - [Area("Admin")] - [Authorize] + [Area("Admin"), Authorize] public class ProcessorsController : Controller { readonly MarechaiContext _context; - public ProcessorsController(MarechaiContext context) - { - _context = context; - } + public ProcessorsController(MarechaiContext context) => _context = context; // GET: Admin/Processors public async Task Index() { IIncludableQueryable marechaiContext = _context.Processors.Include(p => p.Company).Include(p => p.InstructionSet); - return View(await marechaiContext.OrderBy(p => p.Company.Name).ThenBy(p => p.Name) - .Select(p => new ProcessorViewModel - { - Company = p.Company.Name, - Id = p.Id, - InstructionSet = p.InstructionSet.Name, - Introduced = p.Introduced, - ModelCode = p.ModelCode, - Name = p.Name - }).ToListAsync()); + + return View(await marechaiContext.OrderBy(p => p.Company.Name).ThenBy(p => p.Name). + Select(p => new ProcessorViewModel + { + Company = p.Company.Name, Id = p.Id, + InstructionSet = p.InstructionSet.Name, Introduced = p.Introduced, + ModelCode = p.ModelCode, Name = p.Name + }).ToListAsync()); } // GET: Admin/Processors/Details/5 public async Task Details(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); - Processor processor = await _context.Processors.Include(p => p.Company).Include(p => p.InstructionSet) - .FirstOrDefaultAsync(m => m.Id == id); - if(processor == null) return NotFound(); + Processor processor = await _context.Processors.Include(p => p.Company).Include(p => p.InstructionSet). + FirstOrDefaultAsync(m => m.Id == id); + + if(processor == null) + return NotFound(); return View(processor); } @@ -83,59 +80,66 @@ namespace Marechai.Areas.Admin.Controllers // GET: Admin/Processors/Create public IActionResult Create() { - ViewData["CompanyId"] = new SelectList(_context.Companies, "Id", "Name"); + ViewData["CompanyId"] = new SelectList(_context.Companies, "Id", "Name"); ViewData["InstructionSetId"] = new SelectList(_context.InstructionSets, "Id", "Name"); + return View(); } // POST: Admin/Processors/Create // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Create( - [Bind( - "Id,Name,CompanyId,ModelCode,Introduced,InstructionSetId,Speed,Package,Gprs,GprSize,Fprs,FprSize,Cores,ThreadsPerCore,Process,ProcessNm,DieSize,Transistors,DataBus,AddrBus,SimdRegisters,SimdSize,L1Instruction,L1Data,L2,L3")] + [Bind("Id,Name,CompanyId,ModelCode,Introduced,InstructionSetId,Speed,Package,Gprs,GprSize,Fprs,FprSize,Cores,ThreadsPerCore,Process,ProcessNm,DieSize,Transistors,DataBus,AddrBus,SimdRegisters,SimdSize,L1Instruction,L1Data,L2,L3")] Processor processor) { if(ModelState.IsValid) { _context.Add(processor); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } ViewData["CompanyId"] = new SelectList(_context.Companies, "Id", "Name", processor.CompanyId); + ViewData["InstructionSetId"] = new SelectList(_context.InstructionSets, "Id", "Name", processor.InstructionSetId); + return View(processor); } // GET: Admin/Processors/Edit/5 public async Task Edit(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); Processor processor = await _context.Processors.FindAsync(id); - if(processor == null) return NotFound(); + + if(processor == null) + return NotFound(); ViewData["CompanyId"] = new SelectList(_context.Companies, "Id", "Name", processor.CompanyId); + ViewData["InstructionSetId"] = new SelectList(_context.InstructionSets, "Id", "Name", processor.InstructionSetId); + return View(processor); } // POST: Admin/Processors/Edit/5 // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Edit( - int id, [Bind( - "Id,Name,CompanyId,ModelCode,Introduced,InstructionSetId,Speed,Package,Gprs,GprSize,Fprs,FprSize,Cores,ThreadsPerCore,Process,ProcessNm,DieSize,Transistors,DataBus,AddrBus,SimdRegisters,SimdSize,L1Instruction,L1Data,L2,L3")] + int id, + [Bind("Id,Name,CompanyId,ModelCode,Introduced,InstructionSetId,Speed,Package,Gprs,GprSize,Fprs,FprSize,Cores,ThreadsPerCore,Process,ProcessNm,DieSize,Transistors,DataBus,AddrBus,SimdRegisters,SimdSize,L1Instruction,L1Data,L2,L3")] Processor processor) { - if(id != processor.Id) return NotFound(); + if(id != processor.Id) + return NotFound(); if(ModelState.IsValid) { @@ -146,7 +150,8 @@ namespace Marechai.Areas.Admin.Controllers } catch(DbUpdateConcurrencyException) { - if(!ProcessorExists(processor.Id)) return NotFound(); + if(!ProcessorExists(processor.Id)) + return NotFound(); throw; } @@ -155,38 +160,39 @@ namespace Marechai.Areas.Admin.Controllers } ViewData["CompanyId"] = new SelectList(_context.Companies, "Id", "Name", processor.CompanyId); + ViewData["InstructionSetId"] = new SelectList(_context.InstructionSets, "Id", "Name", processor.InstructionSetId); + return View(processor); } // GET: Admin/Processors/Delete/5 public async Task Delete(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); - Processor processor = await _context.Processors.Include(p => p.Company).Include(p => p.InstructionSet) - .FirstOrDefaultAsync(m => m.Id == id); - if(processor == null) return NotFound(); + Processor processor = await _context.Processors.Include(p => p.Company).Include(p => p.InstructionSet). + FirstOrDefaultAsync(m => m.Id == id); + + if(processor == null) + return NotFound(); return View(processor); } // POST: Admin/Processors/Delete/5 - [HttpPost] - [ActionName("Delete")] - [ValidateAntiForgeryToken] + [HttpPost, ActionName("Delete"), ValidateAntiForgeryToken] public async Task DeleteConfirmed(int id) { Processor processor = await _context.Processors.FindAsync(id); _context.Processors.Remove(processor); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - bool ProcessorExists(int id) - { - return _context.Processors.Any(e => e.Id == id); - } + bool ProcessorExists(int id) => _context.Processors.Any(e => e.Id == id); } } \ No newline at end of file diff --git a/Marechai/Areas/Admin/Controllers/ResolutionsByGpuController.cs b/Marechai/Areas/Admin/Controllers/ResolutionsByGpuController.cs index d9bf5cbe..67185f79 100644 --- a/Marechai/Areas/Admin/Controllers/ResolutionsByGpuController.cs +++ b/Marechai/Areas/Admin/Controllers/ResolutionsByGpuController.cs @@ -1,7 +1,7 @@ using System.Linq; using System.Threading.Tasks; -using Marechai.Database.Models; using Marechai.Areas.Admin.Models; +using Marechai.Database.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; @@ -10,43 +10,41 @@ using Microsoft.EntityFrameworkCore.Query; namespace Marechai.Areas.Admin.Controllers { - [Area("Admin")] - [Authorize] + [Area("Admin"), Authorize] public class ResolutionsByGpuController : Controller { readonly MarechaiContext _context; - public ResolutionsByGpuController(MarechaiContext context) - { - _context = context; - } + public ResolutionsByGpuController(MarechaiContext context) => _context = context; // GET: ResolutionsByGpu public async Task Index() { IIncludableQueryable marechaiContext = _context.ResolutionsByGpu.Include(r => r.Gpu).Include(r => r.Resolution); - return View(await marechaiContext.OrderBy(r => r.Gpu.Company.Name).ThenBy(r => r.Gpu.Name) - .ThenBy(r => r.Resolution.Chars).ThenBy(r => r.Resolution.Width) - .ThenBy(r => r.Resolution.Height).ThenBy(r => r.Resolution.Colors) - .Select(r => new ResolutionsByGpuViewModel - { - Gpu = r.Gpu.Name, - GpuCompany = r.Gpu.Company.Name, - Id = r.Id, - Resolution = r.Resolution - }).ToListAsync()); + + return View(await marechaiContext.OrderBy(r => r.Gpu.Company.Name).ThenBy(r => r.Gpu.Name). + ThenBy(r => r.Resolution.Chars).ThenBy(r => r.Resolution.Width). + ThenBy(r => r.Resolution.Height).ThenBy(r => r.Resolution.Colors). + Select(r => new ResolutionsByGpuViewModel + { + Gpu = r.Gpu.Name, GpuCompany = r.Gpu.Company.Name, Id = r.Id, + Resolution = r.Resolution + }).ToListAsync()); } // GET: ResolutionsByGpu/Details/5 public async Task Details(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); - ResolutionsByGpu resolutionsByGpu = await _context.ResolutionsByGpu - .Include(r => r.Gpu).Include(r => r.Resolution) - .FirstOrDefaultAsync(m => m.Id == id); - if(resolutionsByGpu == null) return NotFound(); + ResolutionsByGpu resolutionsByGpu = await _context. + ResolutionsByGpu.Include(r => r.Gpu).Include(r => r.Resolution). + FirstOrDefaultAsync(m => m.Id == id); + + if(resolutionsByGpu == null) + return NotFound(); return View(resolutionsByGpu); } @@ -54,70 +52,88 @@ namespace Marechai.Areas.Admin.Controllers // GET: ResolutionsByGpu/Create public IActionResult Create() { - ViewData["GpuId"] = - new - SelectList(_context.Gpus.OrderBy(r => r.Company.Name).ThenBy(r => r.Name).Select(g => new {g.Id, Name = $"{g.Company.Name} {g.Name}"}), - "Id", "Name"); - ViewData["ResolutionId"] = - new - SelectList(_context.Resolutions.OrderBy(r => r.Chars).ThenBy(r => r.Width).ThenBy(r => r.Height).ThenBy(r => r.Colors).Select(r => new {r.Id, Name = r.ToString()}), - "Id", "Name"); + ViewData["GpuId"] = new SelectList(_context.Gpus.OrderBy(r => r.Company.Name).ThenBy(r => r.Name). + Select(g => new + { + g.Id, Name = $"{g.Company.Name} {g.Name}" + }), "Id", "Name"); + + ViewData["ResolutionId"] = new SelectList(_context.Resolutions.OrderBy(r => r.Chars).ThenBy(r => r.Width). + ThenBy(r => r.Height).ThenBy(r => r.Colors). + Select(r => new + { + r.Id, Name = r.ToString() + }), "Id", "Name"); + return View(); } // POST: ResolutionsByGpu/Create - // To protect from overposting attacks, please enable the specific properties you want to bind to, for + // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Create([Bind("GpuId,ResolutionId,Id")] ResolutionsByGpu resolutionsByGpu) { if(ModelState.IsValid) { _context.Add(resolutionsByGpu); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - ViewData["GpuId"] = - new - SelectList(_context.Gpus.OrderBy(r => r.Company.Name).ThenBy(r => r.Name).Select(g => new {g.Id, Name = $"{g.Company.Name} {g.Name}"}), - "Id", "Name", resolutionsByGpu.GpuId); - ViewData["ResolutionId"] = - new - SelectList(_context.Resolutions.OrderBy(r => r.Chars).ThenBy(r => r.Width).ThenBy(r => r.Height).ThenBy(r => r.Colors).Select(r => new {r.Id, Name = r.ToString()}), - "Id", "Name", resolutionsByGpu.ResolutionId); + ViewData["GpuId"] = new SelectList(_context.Gpus.OrderBy(r => r.Company.Name).ThenBy(r => r.Name). + Select(g => new + { + g.Id, Name = $"{g.Company.Name} {g.Name}" + }), "Id", "Name", resolutionsByGpu.GpuId); + + ViewData["ResolutionId"] = new SelectList(_context.Resolutions.OrderBy(r => r.Chars).ThenBy(r => r.Width). + ThenBy(r => r.Height).ThenBy(r => r.Colors). + Select(r => new + { + r.Id, Name = r.ToString() + }), "Id", "Name", resolutionsByGpu.ResolutionId); + return View(resolutionsByGpu); } // GET: ResolutionsByGpu/Edit/5 public async Task Edit(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); ResolutionsByGpu resolutionsByGpu = await _context.ResolutionsByGpu.FindAsync(id); - if(resolutionsByGpu == null) return NotFound(); - ViewData["GpuId"] = - new - SelectList(_context.Gpus.OrderBy(r => r.Company.Name).ThenBy(r => r.Name).Select(g => new {g.Id, Name = $"{g.Company.Name} {g.Name}"}), - "Id", "Name", resolutionsByGpu.GpuId); - ViewData["ResolutionId"] = - new - SelectList(_context.Resolutions.OrderBy(r => r.Chars).ThenBy(r => r.Width).ThenBy(r => r.Height).ThenBy(r => r.Colors).Select(r => new {r.Id, Name = r.ToString()}), - "Id", "Name", resolutionsByGpu.ResolutionId); + if(resolutionsByGpu == null) + return NotFound(); + + ViewData["GpuId"] = new SelectList(_context.Gpus.OrderBy(r => r.Company.Name).ThenBy(r => r.Name). + Select(g => new + { + g.Id, Name = $"{g.Company.Name} {g.Name}" + }), "Id", "Name", resolutionsByGpu.GpuId); + + ViewData["ResolutionId"] = new SelectList(_context.Resolutions.OrderBy(r => r.Chars).ThenBy(r => r.Width). + ThenBy(r => r.Height).ThenBy(r => r.Colors). + Select(r => new + { + r.Id, Name = r.ToString() + }), "Id", "Name", resolutionsByGpu.ResolutionId); + return View(resolutionsByGpu); } // POST: ResolutionsByGpu/Edit/5 - // To protect from overposting attacks, please enable the specific properties you want to bind to, for + // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Edit( long id, [Bind("GpuId,ResolutionId,Id")] ResolutionsByGpu resolutionsByGpu) { - if(id != resolutionsByGpu.Id) return NotFound(); + if(id != resolutionsByGpu.Id) + return NotFound(); if(ModelState.IsValid) { @@ -128,7 +144,8 @@ namespace Marechai.Areas.Admin.Controllers } catch(DbUpdateConcurrencyException) { - if(!ResolutionsByGpuExists(resolutionsByGpu.Id)) return NotFound(); + if(!ResolutionsByGpuExists(resolutionsByGpu.Id)) + return NotFound(); throw; } @@ -136,54 +153,54 @@ namespace Marechai.Areas.Admin.Controllers return RedirectToAction(nameof(Index)); } - ViewData["GpuId"] = - new - SelectList(_context.Gpus.OrderBy(r => r.Company.Name).ThenBy(r => r.Name).Select(g => new {g.Id, Name = $"{g.Company.Name} {g.Name}"}), - "Id", "Name", resolutionsByGpu.GpuId); - ViewData["ResolutionId"] = - new - SelectList(_context.Resolutions.OrderBy(r => r.Chars).ThenBy(r => r.Width).ThenBy(r => r.Height).ThenBy(r => r.Colors).Select(r => new {r.Id, Name = r.ToString()}), - "Id", "Name", resolutionsByGpu.ResolutionId); + ViewData["GpuId"] = new SelectList(_context.Gpus.OrderBy(r => r.Company.Name).ThenBy(r => r.Name). + Select(g => new + { + g.Id, Name = $"{g.Company.Name} {g.Name}" + }), "Id", "Name", resolutionsByGpu.GpuId); + + ViewData["ResolutionId"] = new SelectList(_context.Resolutions.OrderBy(r => r.Chars).ThenBy(r => r.Width). + ThenBy(r => r.Height).ThenBy(r => r.Colors). + Select(r => new + { + r.Id, Name = r.ToString() + }), "Id", "Name", resolutionsByGpu.ResolutionId); + return View(resolutionsByGpu); } // GET: ResolutionsByGpu/Delete/5 public async Task Delete(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); - ResolutionsByGpu resolutionsByGpu = await _context.ResolutionsByGpu - .Include(r => r.Gpu).Include(r => r.Resolution) - .FirstOrDefaultAsync(m => m.Id == id); - if(resolutionsByGpu == null) return NotFound(); + ResolutionsByGpu resolutionsByGpu = await _context. + ResolutionsByGpu.Include(r => r.Gpu).Include(r => r.Resolution). + FirstOrDefaultAsync(m => m.Id == id); + + if(resolutionsByGpu == null) + return NotFound(); return View(resolutionsByGpu); } // POST: ResolutionsByGpu/Delete/5 - [HttpPost] - [ActionName("Delete")] - [ValidateAntiForgeryToken] + [HttpPost, ActionName("Delete"), ValidateAntiForgeryToken] public async Task DeleteConfirmed(long id) { ResolutionsByGpu resolutionsByGpu = await _context.ResolutionsByGpu.FindAsync(id); _context.ResolutionsByGpu.Remove(resolutionsByGpu); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - bool ResolutionsByGpuExists(long id) - { - return _context.ResolutionsByGpu.Any(e => e.Id == id); - } + bool ResolutionsByGpuExists(long id) => _context.ResolutionsByGpu.Any(e => e.Id == id); [AcceptVerbs("Get", "Post")] - public async Task VerifyUnique(int gpuId, int resolutionId) - { - return await _context.ResolutionsByGpu.FirstOrDefaultAsync(i => i.GpuId == gpuId && - i.ResolutionId == resolutionId) is null - ? Json(true) - : Json("The selected GPU already has the selected resolution."); - } + public async Task VerifyUnique(int gpuId, int resolutionId) => + await _context.ResolutionsByGpu.FirstOrDefaultAsync(i => i.GpuId == gpuId && i.ResolutionId == resolutionId) + is null ? Json(true) : Json("The selected GPU already has the selected resolution."); } } \ No newline at end of file diff --git a/Marechai/Areas/Admin/Controllers/ResolutionsByScreenController.cs b/Marechai/Areas/Admin/Controllers/ResolutionsByScreenController.cs index d091e10c..7c2a2bcf 100644 --- a/Marechai/Areas/Admin/Controllers/ResolutionsByScreenController.cs +++ b/Marechai/Areas/Admin/Controllers/ResolutionsByScreenController.cs @@ -9,35 +9,35 @@ using Microsoft.EntityFrameworkCore.Query; namespace Marechai.Areas.Admin.Controllers { - [Area("Admin")] - [Authorize] + [Area("Admin"), Authorize] public class ResolutionsByScreenController : Controller { readonly MarechaiContext _context; - public ResolutionsByScreenController(MarechaiContext context) - { - _context = context; - } + public ResolutionsByScreenController(MarechaiContext context) => _context = context; // GET: ResolutionsByScreen public async Task Index() { IIncludableQueryable marechaiContext = _context.ResolutionsByScreen.Include(r => r.Resolution).Include(r => r.Screen); - return View(await marechaiContext.OrderBy(r => r.Screen.ToString()).ThenBy(r => r.Resolution.ToString()) - .ToListAsync()); + + return View(await marechaiContext.OrderBy(r => r.Screen.ToString()).ThenBy(r => r.Resolution.ToString()). + ToListAsync()); } // GET: ResolutionsByScreen/Details/5 public async Task Details(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); - ResolutionsByScreen resolutionsByScreen = await _context.ResolutionsByScreen - .Include(r => r.Resolution).Include(r => r.Screen) - .FirstOrDefaultAsync(m => m.Id == id); - if(resolutionsByScreen == null) return NotFound(); + ResolutionsByScreen resolutionsByScreen = + await _context.ResolutionsByScreen.Include(r => r.Resolution).Include(r => r.Screen). + FirstOrDefaultAsync(m => m.Id == id); + + if(resolutionsByScreen == null) + return NotFound(); return View(resolutionsByScreen); } @@ -45,21 +45,25 @@ namespace Marechai.Areas.Admin.Controllers // GET: ResolutionsByScreen/Create public IActionResult Create() { - ViewData["ResolutionId"] = - new SelectList(_context.Resolutions.Select(r => new {r.Id, Name = r.ToString()}).OrderBy(r => r.Name), - "Id", "Name"); - ViewData["ScreenId"] = - new - SelectList(_context.Screens.Select(s => new {s.Id, Name = s.NativeResolution != null ? $"{s.Diagonal}\" {s.Type} with {s.NativeResolution}" : $"{s.Diagonal}\" {s.Type}"}).OrderBy(s => s.Name), - "Id", "Name"); + ViewData["ResolutionId"] = new SelectList(_context.Resolutions.Select(r => new + { + r.Id, Name = r.ToString() + }).OrderBy(r => r.Name), "Id", "Name"); + + ViewData["ScreenId"] = new SelectList(_context.Screens.Select(s => new + { + s.Id, + Name = s.NativeResolution != null ? $"{s.Diagonal}\" {s.Type} with {s.NativeResolution}" + : $"{s.Diagonal}\" {s.Type}" + }).OrderBy(s => s.Name), "Id", "Name"); + return View(); } // POST: ResolutionsByScreen/Create // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Create( [Bind("ScreenId,ResolutionId,Id")] ResolutionsByScreen resolutionsByScreen) { @@ -67,46 +71,60 @@ namespace Marechai.Areas.Admin.Controllers { _context.Add(resolutionsByScreen); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - ViewData["ResolutionId"] = - new SelectList(_context.Resolutions.Select(r => new {r.Id, Name = r.ToString()}).OrderBy(r => r.Name), - "Id", "Name", resolutionsByScreen.ResolutionId); - ViewData["ScreenId"] = - new - SelectList(_context.Screens.Select(s => new {s.Id, Name = s.NativeResolution != null ? $"{s.Diagonal}\" {s.Type} with {s.NativeResolution}" : $"{s.Diagonal}\" {s.Type}"}).OrderBy(s => s.Name), - "Id", "Name", resolutionsByScreen.ScreenId); + ViewData["ResolutionId"] = new SelectList(_context.Resolutions.Select(r => new + { + r.Id, Name = r.ToString() + }).OrderBy(r => r.Name), "Id", "Name", resolutionsByScreen.ResolutionId); + + ViewData["ScreenId"] = new SelectList(_context.Screens.Select(s => new + { + s.Id, + Name = s.NativeResolution != null ? $"{s.Diagonal}\" {s.Type} with {s.NativeResolution}" + : $"{s.Diagonal}\" {s.Type}" + }).OrderBy(s => s.Name), "Id", "Name", resolutionsByScreen.ScreenId); + return View(resolutionsByScreen); } // GET: ResolutionsByScreen/Edit/5 public async Task Edit(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); ResolutionsByScreen resolutionsByScreen = await _context.ResolutionsByScreen.FindAsync(id); - if(resolutionsByScreen == null) return NotFound(); - ViewData["ResolutionId"] = - new SelectList(_context.Resolutions.Select(r => new {r.Id, Name = r.ToString()}).OrderBy(r => r.Name), - "Id", "Name", resolutionsByScreen.ResolutionId); - ViewData["ScreenId"] = - new - SelectList(_context.Screens.Select(s => new {s.Id, Name = s.NativeResolution != null ? $"{s.Diagonal}\" {s.Type} with {s.NativeResolution}" : $"{s.Diagonal}\" {s.Type}"}).OrderBy(s => s.Name), - "Id", "Name", resolutionsByScreen.ScreenId); + if(resolutionsByScreen == null) + return NotFound(); + + ViewData["ResolutionId"] = new SelectList(_context.Resolutions.Select(r => new + { + r.Id, Name = r.ToString() + }).OrderBy(r => r.Name), "Id", "Name", resolutionsByScreen.ResolutionId); + + ViewData["ScreenId"] = new SelectList(_context.Screens.Select(s => new + { + s.Id, + Name = s.NativeResolution != null ? $"{s.Diagonal}\" {s.Type} with {s.NativeResolution}" + : $"{s.Diagonal}\" {s.Type}" + }).OrderBy(s => s.Name), "Id", "Name", resolutionsByScreen.ScreenId); + return View(resolutionsByScreen); } // POST: ResolutionsByScreen/Edit/5 // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Edit( long id, [Bind("ScreenId,ResolutionId,Id")] ResolutionsByScreen resolutionsByScreen) { - if(id != resolutionsByScreen.Id) return NotFound(); + if(id != resolutionsByScreen.Id) + return NotFound(); if(ModelState.IsValid) { @@ -117,7 +135,8 @@ namespace Marechai.Areas.Admin.Controllers } catch(DbUpdateConcurrencyException) { - if(!ResolutionsByScreenExists(resolutionsByScreen.Id)) return NotFound(); + if(!ResolutionsByScreenExists(resolutionsByScreen.Id)) + return NotFound(); throw; } @@ -125,53 +144,54 @@ namespace Marechai.Areas.Admin.Controllers return RedirectToAction(nameof(Index)); } - ViewData["ResolutionId"] = - new SelectList(_context.Resolutions.Select(r => new {r.Id, Name = r.ToString()}).OrderBy(r => r.Name), - "Id", "Name", resolutionsByScreen.ResolutionId); - ViewData["ScreenId"] = - new - SelectList(_context.Screens.Select(s => new {s.Id, Name = s.NativeResolution != null ? $"{s.Diagonal}\" {s.Type} with {s.NativeResolution}" : $"{s.Diagonal}\" {s.Type}"}).OrderBy(s => s.Name), - "Id", "Name", resolutionsByScreen.ScreenId); + ViewData["ResolutionId"] = new SelectList(_context.Resolutions.Select(r => new + { + r.Id, Name = r.ToString() + }).OrderBy(r => r.Name), "Id", "Name", resolutionsByScreen.ResolutionId); + + ViewData["ScreenId"] = new SelectList(_context.Screens.Select(s => new + { + s.Id, + Name = s.NativeResolution != null ? $"{s.Diagonal}\" {s.Type} with {s.NativeResolution}" + : $"{s.Diagonal}\" {s.Type}" + }).OrderBy(s => s.Name), "Id", "Name", resolutionsByScreen.ScreenId); + return View(resolutionsByScreen); } // GET: ResolutionsByScreen/Delete/5 public async Task Delete(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); - ResolutionsByScreen resolutionsByScreen = await _context.ResolutionsByScreen - .Include(r => r.Resolution).Include(r => r.Screen) - .FirstOrDefaultAsync(m => m.Id == id); - if(resolutionsByScreen == null) return NotFound(); + ResolutionsByScreen resolutionsByScreen = + await _context.ResolutionsByScreen.Include(r => r.Resolution).Include(r => r.Screen). + FirstOrDefaultAsync(m => m.Id == id); + + if(resolutionsByScreen == null) + return NotFound(); return View(resolutionsByScreen); } // POST: ResolutionsByScreen/Delete/5 - [HttpPost] - [ActionName("Delete")] - [ValidateAntiForgeryToken] + [HttpPost, ActionName("Delete"), ValidateAntiForgeryToken] public async Task DeleteConfirmed(long id) { ResolutionsByScreen resolutionsByScreen = await _context.ResolutionsByScreen.FindAsync(id); _context.ResolutionsByScreen.Remove(resolutionsByScreen); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - bool ResolutionsByScreenExists(long id) - { - return _context.ResolutionsByScreen.Any(e => e.Id == id); - } + bool ResolutionsByScreenExists(long id) => _context.ResolutionsByScreen.Any(e => e.Id == id); [AcceptVerbs("Get", "Post")] - public async Task VerifyUnique(int screenId, int resolutionId) - { - return await _context.ResolutionsByScreen.FirstOrDefaultAsync(i => i.ScreenId == screenId && - i.ResolutionId == resolutionId) is null - ? Json(true) - : Json("The selected screen already has the selected resolution."); - } + public async Task VerifyUnique(int screenId, int resolutionId) => + await _context.ResolutionsByScreen.FirstOrDefaultAsync(i => i.ScreenId == screenId && + i.ResolutionId == resolutionId) is null + ? Json(true) : Json("The selected screen already has the selected resolution."); } } \ No newline at end of file diff --git a/Marechai/Areas/Admin/Controllers/ResolutionsController.cs b/Marechai/Areas/Admin/Controllers/ResolutionsController.cs index 3e5dff39..ba3ac9aa 100644 --- a/Marechai/Areas/Admin/Controllers/ResolutionsController.cs +++ b/Marechai/Areas/Admin/Controllers/ResolutionsController.cs @@ -37,29 +37,28 @@ using Microsoft.EntityFrameworkCore; namespace Marechai.Areas.Admin.Controllers { - [Area("Admin")] - [Authorize] + [Area("Admin"), Authorize] public class ResolutionsController : Controller { readonly MarechaiContext _context; - public ResolutionsController(MarechaiContext context) - { - _context = context; - } + public ResolutionsController(MarechaiContext context) => _context = context; // GET: Admin/Resolutions public async Task Index() => - View(await _context.Resolutions.OrderBy(r => r.Chars).ThenBy(r => r.Width).ThenBy(r => r.Height) - .ThenBy(r => r.Colors).ThenBy(r => r.Grayscale).ToListAsync()); + View(await _context.Resolutions.OrderBy(r => r.Chars).ThenBy(r => r.Width).ThenBy(r => r.Height). + ThenBy(r => r.Colors).ThenBy(r => r.Grayscale).ToListAsync()); // GET: Admin/Resolutions/Details/5 public async Task Details(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); Resolution resolution = await _context.Resolutions.FirstOrDefaultAsync(m => m.Id == id); - if(resolution == null) return NotFound(); + + if(resolution == null) + return NotFound(); return View(resolution); } @@ -70,8 +69,7 @@ namespace Marechai.Areas.Admin.Controllers // POST: Admin/Resolutions/Create // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Create([Bind("Id,Width,Height,Colors,Palette,Chars,Grayscale")] Resolution resolution) { @@ -79,6 +77,7 @@ namespace Marechai.Areas.Admin.Controllers { _context.Add(resolution); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } @@ -88,10 +87,13 @@ namespace Marechai.Areas.Admin.Controllers // GET: Admin/Resolutions/Edit/5 public async Task Edit(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); Resolution resolution = await _context.Resolutions.FindAsync(id); - if(resolution == null) return NotFound(); + + if(resolution == null) + return NotFound(); return View(resolution); } @@ -99,12 +101,12 @@ namespace Marechai.Areas.Admin.Controllers // POST: Admin/Resolutions/Edit/5 // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Edit(int id, [Bind("Id,Width,Height,Colors,Palette,Chars,Grayscale")] Resolution resolution) { - if(id != resolution.Id) return NotFound(); + if(id != resolution.Id) + return NotFound(); if(ModelState.IsValid) { @@ -115,7 +117,8 @@ namespace Marechai.Areas.Admin.Controllers } catch(DbUpdateConcurrencyException) { - if(!ResolutionExists(resolution.Id)) return NotFound(); + if(!ResolutionExists(resolution.Id)) + return NotFound(); throw; } @@ -129,29 +132,28 @@ namespace Marechai.Areas.Admin.Controllers // GET: Admin/Resolutions/Delete/5 public async Task Delete(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); Resolution resolution = await _context.Resolutions.FirstOrDefaultAsync(m => m.Id == id); - if(resolution == null) return NotFound(); + + if(resolution == null) + return NotFound(); return View(resolution); } // POST: Admin/Resolutions/Delete/5 - [HttpPost] - [ActionName("Delete")] - [ValidateAntiForgeryToken] + [HttpPost, ActionName("Delete"), ValidateAntiForgeryToken] public async Task DeleteConfirmed(int id) { Resolution resolution = await _context.Resolutions.FindAsync(id); _context.Resolutions.Remove(resolution); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - bool ResolutionExists(int id) - { - return _context.Resolutions.Any(e => e.Id == id); - } + bool ResolutionExists(int id) => _context.Resolutions.Any(e => e.Id == id); } } \ No newline at end of file diff --git a/Marechai/Areas/Admin/Controllers/ScreensByMachineController.cs b/Marechai/Areas/Admin/Controllers/ScreensByMachineController.cs index e0115eb9..d265d615 100644 --- a/Marechai/Areas/Admin/Controllers/ScreensByMachineController.cs +++ b/Marechai/Areas/Admin/Controllers/ScreensByMachineController.cs @@ -1,7 +1,7 @@ using System.Linq; using System.Threading.Tasks; -using Marechai.Database.Models; using Marechai.Areas.Admin.Models; +using Marechai.Database.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; @@ -10,22 +10,19 @@ using Microsoft.EntityFrameworkCore.Query; namespace Marechai.Areas.Admin.Controllers { - [Area("Admin")] - [Authorize] + [Area("Admin"), Authorize] public class ScreensByMachineController : Controller { readonly MarechaiContext _context; - public ScreensByMachineController(MarechaiContext context) - { - _context = context; - } + public ScreensByMachineController(MarechaiContext context) => _context = context; // GET: ScreensByMachine public async Task Index() { IIncludableQueryable marechaiContext = _context.ScreensByMachine.Include(s => s.Machine).Include(s => s.Screen); + return View(await marechaiContext.Select(s => new ScreensByMachineViewModel { Id = s.Id, @@ -39,23 +36,22 @@ namespace Marechai.Areas.Admin.Controllers // GET: ScreensByMachine/Details/5 public async Task Details(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); - ScreensByMachineViewModel screensByMachine = await _context.ScreensByMachine - .Include(s => s.Machine).Include(s => s.Screen) - .Select(s => new ScreensByMachineViewModel - { - Id = s.Id, - Screen = - s.Screen.NativeResolution != - null - ? $"{s.Screen.Diagonal}\" {s.Screen.Type} with {s.Screen.NativeResolution}" - : $"{s.Screen.Diagonal}\" {s.Screen}", - Machine = - $"{s.Machine.Company.Name} {s.Machine.Name}" - }).FirstOrDefaultAsync(m => m.Id == - id); - if(screensByMachine == null) return NotFound(); + ScreensByMachineViewModel screensByMachine = + await _context.ScreensByMachine.Include(s => s.Machine).Include(s => s.Screen). + Select(s => new ScreensByMachineViewModel + { + Id = s.Id, + Screen = s.Screen.NativeResolution != null + ? $"{s.Screen.Diagonal}\" {s.Screen.Type} with {s.Screen.NativeResolution}" + : $"{s.Screen.Diagonal}\" {s.Screen}", + Machine = $"{s.Machine.Company.Name} {s.Machine.Name}" + }).FirstOrDefaultAsync(m => m.Id == id); + + if(screensByMachine == null) + return NotFound(); return View(screensByMachine); } @@ -63,70 +59,88 @@ namespace Marechai.Areas.Admin.Controllers // GET: ScreensByMachine/Create public IActionResult Create() { - ViewData["MachineId"] = - new - SelectList(_context.Machines.OrderBy(m => m.Company.Name).ThenBy(m => m.Name).Select(m => new {m.Id, Name = $"{m.Company.Name} {m.Name}"}), - "Id", "Name"); - ViewData["ScreenId"] = - new - SelectList(_context.Screens.Select(s => new {s.Id, Name = s.NativeResolution != null ? $"{s.Diagonal}\" {s.Type} with {s.NativeResolution}" : $"{s.Diagonal}\" {s.Type}"}).OrderBy(s => s.Name), - "Id", "Name"); + ViewData["MachineId"] = new SelectList(_context.Machines.OrderBy(m => m.Company.Name).ThenBy(m => m.Name). + Select(m => new + { + m.Id, Name = $"{m.Company.Name} {m.Name}" + }), "Id", "Name"); + + ViewData["ScreenId"] = new SelectList(_context.Screens.Select(s => new + { + s.Id, + Name = s.NativeResolution != null ? $"{s.Diagonal}\" {s.Type} with {s.NativeResolution}" + : $"{s.Diagonal}\" {s.Type}" + }).OrderBy(s => s.Name), "Id", "Name"); + return View(); } // POST: ScreensByMachine/Create // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Create([Bind("ScreenId,MachineId,Id")] ScreensByMachine screensByMachine) { if(ModelState.IsValid) { _context.Add(screensByMachine); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - ViewData["MachineId"] = - new - SelectList(_context.Machines.OrderBy(m => m.Company.Name).ThenBy(m => m.Name).Select(m => new {m.Id, Name = $"{m.Company.Name} {m.Name}"}), - "Id", "Name", screensByMachine.MachineId); - ViewData["ScreenId"] = - new - SelectList(_context.Screens.Select(s => new {s.Id, Name = s.NativeResolution != null ? $"{s.Diagonal}\" {s.Type} with {s.NativeResolution}" : $"{s.Diagonal}\" {s.Type}"}).OrderBy(s => s.Name), - "Id", "Name", screensByMachine.ScreenId); + ViewData["MachineId"] = new SelectList(_context.Machines.OrderBy(m => m.Company.Name).ThenBy(m => m.Name). + Select(m => new + { + m.Id, Name = $"{m.Company.Name} {m.Name}" + }), "Id", "Name", screensByMachine.MachineId); + + ViewData["ScreenId"] = new SelectList(_context.Screens.Select(s => new + { + s.Id, + Name = s.NativeResolution != null ? $"{s.Diagonal}\" {s.Type} with {s.NativeResolution}" + : $"{s.Diagonal}\" {s.Type}" + }).OrderBy(s => s.Name), "Id", "Name", screensByMachine.ScreenId); + return View(screensByMachine); } // GET: ScreensByMachine/Edit/5 public async Task Edit(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); ScreensByMachine screensByMachine = await _context.ScreensByMachine.FindAsync(id); - if(screensByMachine == null) return NotFound(); - ViewData["MachineId"] = - new - SelectList(_context.Machines.OrderBy(m => m.Company.Name).ThenBy(m => m.Name).Select(m => new {m.Id, Name = $"{m.Company.Name} {m.Name}"}), - "Id", "Name", screensByMachine.MachineId); - ViewData["ScreenId"] = - new - SelectList(_context.Screens.Select(s => new {s.Id, Name = s.NativeResolution != null ? $"{s.Diagonal}\" {s.Type} with {s.NativeResolution}" : $"{s.Diagonal}\" {s.Type}"}).OrderBy(s => s.Name), - "Id", "Name", screensByMachine.ScreenId); + if(screensByMachine == null) + return NotFound(); + + ViewData["MachineId"] = new SelectList(_context.Machines.OrderBy(m => m.Company.Name).ThenBy(m => m.Name). + Select(m => new + { + m.Id, Name = $"{m.Company.Name} {m.Name}" + }), "Id", "Name", screensByMachine.MachineId); + + ViewData["ScreenId"] = new SelectList(_context.Screens.Select(s => new + { + s.Id, + Name = s.NativeResolution != null ? $"{s.Diagonal}\" {s.Type} with {s.NativeResolution}" + : $"{s.Diagonal}\" {s.Type}" + }).OrderBy(s => s.Name), "Id", "Name", screensByMachine.ScreenId); + return View(screensByMachine); } // POST: ScreensByMachine/Edit/5 // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Edit( long id, [Bind("ScreenId,MachineId,Id")] ScreensByMachine screensByMachine) { - if(id != screensByMachine.Id) return NotFound(); + if(id != screensByMachine.Id) + return NotFound(); if(ModelState.IsValid) { @@ -137,7 +151,8 @@ namespace Marechai.Areas.Admin.Controllers } catch(DbUpdateConcurrencyException) { - if(!ScreensByMachineExists(screensByMachine.Id)) return NotFound(); + if(!ScreensByMachineExists(screensByMachine.Id)) + return NotFound(); throw; } @@ -145,65 +160,61 @@ namespace Marechai.Areas.Admin.Controllers return RedirectToAction(nameof(Index)); } - ViewData["MachineId"] = - new - SelectList(_context.Machines.OrderBy(m => m.Company.Name).ThenBy(m => m.Name).Select(m => new {m.Id, Name = $"{m.Company.Name} {m.Name}"}), - "Id", "Name", screensByMachine.MachineId); - ViewData["ScreenId"] = - new - SelectList(_context.Screens.Select(s => new {s.Id, Name = s.NativeResolution != null ? $"{s.Diagonal}\" {s.Type} with {s.NativeResolution}" : $"{s.Diagonal}\" {s.Type}"}).OrderBy(s => s.Name), - "Id", "Name", screensByMachine.ScreenId); + ViewData["MachineId"] = new SelectList(_context.Machines.OrderBy(m => m.Company.Name).ThenBy(m => m.Name). + Select(m => new + { + m.Id, Name = $"{m.Company.Name} {m.Name}" + }), "Id", "Name", screensByMachine.MachineId); + + ViewData["ScreenId"] = new SelectList(_context.Screens.Select(s => new + { + s.Id, + Name = s.NativeResolution != null ? $"{s.Diagonal}\" {s.Type} with {s.NativeResolution}" + : $"{s.Diagonal}\" {s.Type}" + }).OrderBy(s => s.Name), "Id", "Name", screensByMachine.ScreenId); + return View(screensByMachine); } // GET: ScreensByMachine/Delete/5 public async Task Delete(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); - ScreensByMachineViewModel screensByMachine = await _context.ScreensByMachine - .Include(s => s.Machine).Include(s => s.Screen) - .Select(s => new ScreensByMachineViewModel - { - Id = s.Id, - Screen = - s.Screen.NativeResolution != - null - ? $"{s.Screen.Diagonal}\" {s.Screen.Type} with {s.Screen.NativeResolution}" - : $"{s.Screen.Diagonal}\" {s.Screen}", - Machine = - $"{s.Machine.Company.Name} {s.Machine.Name}" - }).FirstOrDefaultAsync(m => m.Id == - id); - if(screensByMachine == null) return NotFound(); + ScreensByMachineViewModel screensByMachine = + await _context.ScreensByMachine.Include(s => s.Machine).Include(s => s.Screen). + Select(s => new ScreensByMachineViewModel + { + Id = s.Id, + Screen = s.Screen.NativeResolution != null + ? $"{s.Screen.Diagonal}\" {s.Screen.Type} with {s.Screen.NativeResolution}" + : $"{s.Screen.Diagonal}\" {s.Screen}", + Machine = $"{s.Machine.Company.Name} {s.Machine.Name}" + }).FirstOrDefaultAsync(m => m.Id == id); + + if(screensByMachine == null) + return NotFound(); return View(screensByMachine); } // POST: ScreensByMachine/Delete/5 - [HttpPost] - [ActionName("Delete")] - [ValidateAntiForgeryToken] + [HttpPost, ActionName("Delete"), ValidateAntiForgeryToken] public async Task DeleteConfirmed(long id) { ScreensByMachine screensByMachine = await _context.ScreensByMachine.FindAsync(id); _context.ScreensByMachine.Remove(screensByMachine); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - bool ScreensByMachineExists(long id) - { - return _context.ScreensByMachine.Any(e => e.Id == id); - } + bool ScreensByMachineExists(long id) => _context.ScreensByMachine.Any(e => e.Id == id); [AcceptVerbs("Get", "Post")] - public async Task VerifyUnique(int screenId, int machineId) - { - return await _context.ScreensByMachine.FirstOrDefaultAsync(i => i.ScreenId == screenId && - i.MachineId == machineId) is null - ? Json(true) - : Json("The selected machine already has the selected screen."); - } + public async Task VerifyUnique(int screenId, int machineId) => + await _context.ScreensByMachine.FirstOrDefaultAsync(i => i.ScreenId == screenId && i.MachineId == machineId) + is null ? Json(true) : Json("The selected machine already has the selected screen."); } } \ No newline at end of file diff --git a/Marechai/Areas/Admin/Controllers/ScreensController.cs b/Marechai/Areas/Admin/Controllers/ScreensController.cs index 0d5f63a6..573858c2 100644 --- a/Marechai/Areas/Admin/Controllers/ScreensController.cs +++ b/Marechai/Areas/Admin/Controllers/ScreensController.cs @@ -8,30 +8,29 @@ using Microsoft.EntityFrameworkCore; namespace Marechai.Areas.Admin.Controllers { - [Area("Admin")] - [Authorize] + [Area("Admin"), Authorize] public class ScreensController : Controller { readonly MarechaiContext _context; - public ScreensController(MarechaiContext context) - { - _context = context; - } + public ScreensController(MarechaiContext context) => _context = context; // GET: Screens public async Task Index() => - View(await _context.Screens.OrderBy(s => s.Diagonal).ThenBy(s => s.EffectiveColors) - .ThenBy(s => s.NativeResolution.ToString()).ThenBy(s => s.Type).ThenBy(s => s.Size) - .ToListAsync()); + View(await _context.Screens.OrderBy(s => s.Diagonal).ThenBy(s => s.EffectiveColors). + ThenBy(s => s.NativeResolution.ToString()).ThenBy(s => s.Type).ThenBy(s => s.Size). + ToListAsync()); // GET: Screens/Details/5 public async Task Details(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); Screen screen = await _context.Screens.FirstOrDefaultAsync(m => m.Id == id); - if(screen == null) return NotFound(); + + if(screen == null) + return NotFound(); return View(screen); } @@ -39,10 +38,12 @@ namespace Marechai.Areas.Admin.Controllers // GET: Screens/Create public IActionResult Create() { - ViewData["NativeResolutionId"] = - new - SelectList(_context.Resolutions.OrderBy(r => r.Chars).ThenBy(r => r.Width).ThenBy(r => r.Height).ThenBy(r => r.Colors).Select(r => new {r.Id, Name = r.ToString()}), - "Id", "Name"); + ViewData["NativeResolutionId"] = new SelectList(_context.Resolutions.OrderBy(r => r.Chars). + ThenBy(r => r.Width).ThenBy(r => r.Height). + ThenBy(r => r.Colors).Select(r => new + { + r.Id, Name = r.ToString() + }), "Id", "Name"); return View(); } @@ -50,8 +51,7 @@ namespace Marechai.Areas.Admin.Controllers // POST: Screens/Create // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Create( [Bind("Width,Height,Diagonal,EffectiveColors,Type,NativeResolutionId,Id")] Screen screen) @@ -60,13 +60,16 @@ namespace Marechai.Areas.Admin.Controllers { _context.Add(screen); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - ViewData["NativeResolutionId"] = - new - SelectList(_context.Resolutions.OrderBy(r => r.Chars).ThenBy(r => r.Width).ThenBy(r => r.Height).ThenBy(r => r.Colors).Select(r => new {r.Id, Name = r.ToString()}), - "Id", "Name"); + ViewData["NativeResolutionId"] = new SelectList(_context.Resolutions.OrderBy(r => r.Chars). + ThenBy(r => r.Width).ThenBy(r => r.Height). + ThenBy(r => r.Colors).Select(r => new + { + r.Id, Name = r.ToString() + }), "Id", "Name"); return View(screen); } @@ -74,15 +77,20 @@ namespace Marechai.Areas.Admin.Controllers // GET: Screens/Edit/5 public async Task Edit(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); Screen screen = await _context.Screens.FindAsync(id); - if(screen == null) return NotFound(); - ViewData["NativeResolutionId"] = - new - SelectList(_context.Resolutions.OrderBy(r => r.Chars).ThenBy(r => r.Width).ThenBy(r => r.Height).ThenBy(r => r.Colors).Select(r => new {r.Id, Name = r.ToString()}), - "Id", "Name"); + if(screen == null) + return NotFound(); + + ViewData["NativeResolutionId"] = new SelectList(_context.Resolutions.OrderBy(r => r.Chars). + ThenBy(r => r.Width).ThenBy(r => r.Height). + ThenBy(r => r.Colors).Select(r => new + { + r.Id, Name = r.ToString() + }), "Id", "Name"); return View(screen); } @@ -90,13 +98,13 @@ namespace Marechai.Areas.Admin.Controllers // POST: Screens/Edit/5 // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Edit( int id, [Bind("Width,Height,Diagonal,EffectiveColors,NativeResolutionId,Type,Id")] Screen screen) { - if(id != screen.Id) return NotFound(); + if(id != screen.Id) + return NotFound(); if(ModelState.IsValid) { @@ -107,7 +115,8 @@ namespace Marechai.Areas.Admin.Controllers } catch(DbUpdateConcurrencyException) { - if(!ScreenExists(screen.Id)) return NotFound(); + if(!ScreenExists(screen.Id)) + return NotFound(); throw; } @@ -115,10 +124,12 @@ namespace Marechai.Areas.Admin.Controllers return RedirectToAction(nameof(Index)); } - ViewData["NativeResolutionId"] = - new - SelectList(_context.Resolutions.OrderBy(r => r.Chars).ThenBy(r => r.Width).ThenBy(r => r.Height).ThenBy(r => r.Colors).Select(r => new {r.Id, Name = r.ToString()}), - "Id", "Name"); + ViewData["NativeResolutionId"] = new SelectList(_context.Resolutions.OrderBy(r => r.Chars). + ThenBy(r => r.Width).ThenBy(r => r.Height). + ThenBy(r => r.Colors).Select(r => new + { + r.Id, Name = r.ToString() + }), "Id", "Name"); return View(screen); } @@ -126,29 +137,28 @@ namespace Marechai.Areas.Admin.Controllers // GET: Screens/Delete/5 public async Task Delete(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); Screen screen = await _context.Screens.FirstOrDefaultAsync(m => m.Id == id); - if(screen == null) return NotFound(); + + if(screen == null) + return NotFound(); return View(screen); } // POST: Screens/Delete/5 - [HttpPost] - [ActionName("Delete")] - [ValidateAntiForgeryToken] + [HttpPost, ActionName("Delete"), ValidateAntiForgeryToken] public async Task DeleteConfirmed(int id) { Screen screen = await _context.Screens.FindAsync(id); _context.Screens.Remove(screen); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - bool ScreenExists(int id) - { - return _context.Screens.Any(e => e.Id == id); - } + bool ScreenExists(int id) => _context.Screens.Any(e => e.Id == id); } } \ No newline at end of file diff --git a/Marechai/Areas/Admin/Controllers/SoundByMachineController.cs b/Marechai/Areas/Admin/Controllers/SoundByMachineController.cs index c33108e7..ec1170dc 100644 --- a/Marechai/Areas/Admin/Controllers/SoundByMachineController.cs +++ b/Marechai/Areas/Admin/Controllers/SoundByMachineController.cs @@ -1,7 +1,7 @@ using System.Linq; using System.Threading.Tasks; -using Marechai.Database.Models; using Marechai.Areas.Admin.Models; +using Marechai.Database.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; @@ -10,40 +10,38 @@ using Microsoft.EntityFrameworkCore.Query; namespace Marechai.Areas.Admin.Controllers { - [Area("Admin")] - [Authorize] + [Area("Admin"), Authorize] public class SoundByMachineController : Controller { readonly MarechaiContext _context; - public SoundByMachineController(MarechaiContext context) - { - _context = context; - } + public SoundByMachineController(MarechaiContext context) => _context = context; // GET: SoundByMachine public async Task Index() { IIncludableQueryable marechaiContext = _context.SoundByMachine.Include(s => s.Machine).Include(s => s.SoundSynth); - return View(await marechaiContext.OrderBy(s => s.Machine.Name).ThenBy(s => s.SoundSynth.Name) - .Select(s => new SoundByMachineViewModel - { - Id = s.Id, - Machine = s.Machine.Name, - SoundSynth = s.SoundSynth.Name - }).ToListAsync()); + + return View(await marechaiContext.OrderBy(s => s.Machine.Name).ThenBy(s => s.SoundSynth.Name). + Select(s => new SoundByMachineViewModel + { + Id = s.Id, Machine = s.Machine.Name, SoundSynth = s.SoundSynth.Name + }).ToListAsync()); } // GET: SoundByMachine/Details/5 public async Task Details(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); - SoundByMachine soundByMachine = await _context.SoundByMachine - .Include(s => s.Machine).Include(s => s.SoundSynth) - .FirstOrDefaultAsync(m => m.Id == id); - if(soundByMachine == null) return NotFound(); + SoundByMachine soundByMachine = await _context. + SoundByMachine.Include(s => s.Machine).Include(s => s.SoundSynth). + FirstOrDefaultAsync(m => m.Id == id); + + if(soundByMachine == null) + return NotFound(); return View(soundByMachine); } @@ -51,52 +49,58 @@ namespace Marechai.Areas.Admin.Controllers // GET: SoundByMachine/Create public IActionResult Create() { - ViewData["MachineId"] = new SelectList(_context.Machines, "Id", "Name"); + ViewData["MachineId"] = new SelectList(_context.Machines, "Id", "Name"); ViewData["SoundSynthId"] = new SelectList(_context.SoundSynths, "Id", "Name"); + return View(); } // POST: SoundByMachine/Create - // To protect from overposting attacks, please enable the specific properties you want to bind to, for + // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Create([Bind("SoundSynthId,MachineId,Id")] SoundByMachine soundByMachine) { if(ModelState.IsValid) { _context.Add(soundByMachine); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - ViewData["MachineId"] = new SelectList(_context.Machines, "Id", "Name", soundByMachine.MachineId); + ViewData["MachineId"] = new SelectList(_context.Machines, "Id", "Name", soundByMachine.MachineId); ViewData["SoundSynthId"] = new SelectList(_context.SoundSynths, "Id", "Name", soundByMachine.SoundSynthId); + return View(soundByMachine); } // GET: SoundByMachine/Edit/5 public async Task Edit(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); SoundByMachine soundByMachine = await _context.SoundByMachine.FindAsync(id); - if(soundByMachine == null) return NotFound(); - ViewData["MachineId"] = new SelectList(_context.Machines, "Id", "Name", soundByMachine.MachineId); + if(soundByMachine == null) + return NotFound(); + + ViewData["MachineId"] = new SelectList(_context.Machines, "Id", "Name", soundByMachine.MachineId); ViewData["SoundSynthId"] = new SelectList(_context.SoundSynths, "Id", "Name", soundByMachine.SoundSynthId); + return View(soundByMachine); } // POST: SoundByMachine/Edit/5 - // To protect from overposting attacks, please enable the specific properties you want to bind to, for + // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Edit( long id, [Bind("SoundSynthId,MachineId,Id")] SoundByMachine soundByMachine) { - if(id != soundByMachine.Id) return NotFound(); + if(id != soundByMachine.Id) + return NotFound(); if(ModelState.IsValid) { @@ -107,7 +111,8 @@ namespace Marechai.Areas.Admin.Controllers } catch(DbUpdateConcurrencyException) { - if(!SoundByMachineExists(soundByMachine.Id)) return NotFound(); + if(!SoundByMachineExists(soundByMachine.Id)) + return NotFound(); throw; } @@ -115,39 +120,39 @@ namespace Marechai.Areas.Admin.Controllers return RedirectToAction(nameof(Index)); } - ViewData["MachineId"] = new SelectList(_context.Machines, "Id", "Name", soundByMachine.MachineId); + ViewData["MachineId"] = new SelectList(_context.Machines, "Id", "Name", soundByMachine.MachineId); ViewData["SoundSynthId"] = new SelectList(_context.SoundSynths, "Id", "Name", soundByMachine.SoundSynthId); + return View(soundByMachine); } // GET: SoundByMachine/Delete/5 public async Task Delete(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); - SoundByMachine soundByMachine = await _context.SoundByMachine - .Include(s => s.Machine).Include(s => s.SoundSynth) - .FirstOrDefaultAsync(m => m.Id == id); - if(soundByMachine == null) return NotFound(); + SoundByMachine soundByMachine = await _context. + SoundByMachine.Include(s => s.Machine).Include(s => s.SoundSynth). + FirstOrDefaultAsync(m => m.Id == id); + + if(soundByMachine == null) + return NotFound(); return View(soundByMachine); } // POST: SoundByMachine/Delete/5 - [HttpPost] - [ActionName("Delete")] - [ValidateAntiForgeryToken] + [HttpPost, ActionName("Delete"), ValidateAntiForgeryToken] public async Task DeleteConfirmed(long id) { SoundByMachine soundByMachine = await _context.SoundByMachine.FindAsync(id); _context.SoundByMachine.Remove(soundByMachine); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - bool SoundByMachineExists(long id) - { - return _context.SoundByMachine.Any(e => e.Id == id); - } + bool SoundByMachineExists(long id) => _context.SoundByMachine.Any(e => e.Id == id); } } \ No newline at end of file diff --git a/Marechai/Areas/Admin/Controllers/SoundByOwnedMachineController.cs b/Marechai/Areas/Admin/Controllers/SoundByOwnedMachineController.cs index 6e4f0ec2..e02d04df 100644 --- a/Marechai/Areas/Admin/Controllers/SoundByOwnedMachineController.cs +++ b/Marechai/Areas/Admin/Controllers/SoundByOwnedMachineController.cs @@ -1,7 +1,7 @@ using System.Linq; using System.Threading.Tasks; -using Marechai.Database.Models; using Marechai.Areas.Admin.Models; +using Marechai.Database.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; @@ -10,54 +10,50 @@ using Microsoft.EntityFrameworkCore.Query; namespace Marechai.Areas.Admin.Controllers { - [Area("Admin")] - [Authorize] + [Area("Admin"), Authorize] public class SoundByOwnedMachineController : Controller { readonly MarechaiContext _context; - public SoundByOwnedMachineController(MarechaiContext context) - { - _context = context; - } + public SoundByOwnedMachineController(MarechaiContext context) => _context = context; // GET: SoundByOwnedMachine public async Task Index() { IIncludableQueryable marechaiContext = _context.SoundByOwnedMachine.Include(s => s.OwnedMachine).Include(s => s.SoundSynth); - return View(await marechaiContext.OrderBy(s => s.OwnedMachine.Machine.Company.Name) - .ThenBy(s => s.OwnedMachine.Machine.Name) - .ThenBy(s => s.OwnedMachine.User.UserName).ThenBy(s => s.SoundSynth.Name) - .Select(s => new SoundByMachineViewModel - { - Id = s.Id, - Machine = - $"{s.OwnedMachine.Machine.Company.Name} {s.OwnedMachine.Machine.Name} <{s.OwnedMachine.User.UserName}>", - SoundSynth = s.SoundSynth.Name - }).ToListAsync()); + + return View(await marechaiContext.OrderBy(s => s.OwnedMachine.Machine.Company.Name). + ThenBy(s => s.OwnedMachine.Machine.Name). + ThenBy(s => s.OwnedMachine.User.UserName).ThenBy(s => s.SoundSynth.Name). + Select(s => new SoundByMachineViewModel + { + Id = s.Id, + Machine = + $"{s.OwnedMachine.Machine.Company.Name} {s.OwnedMachine.Machine.Name} <{s.OwnedMachine.User.UserName}>", + SoundSynth = s.SoundSynth.Name + }).ToListAsync()); } // GET: SoundByOwnedMachine/Details/5 public async Task Details(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); - SoundByMachineViewModel soundByOwnedMachine = await _context.SoundByOwnedMachine - .OrderBy(s => s.OwnedMachine.Machine.Company - .Name) - .ThenBy(s => s.OwnedMachine.Machine.Name) - .ThenBy(s => s.OwnedMachine.User.UserName) - .ThenBy(s => s.SoundSynth.Name) - .Select(s => new SoundByMachineViewModel - { - Id = s.Id, - Machine = - $"{s.OwnedMachine.Machine.Company.Name} {s.OwnedMachine.Machine.Name} <{s.OwnedMachine.User.UserName}>", - SoundSynth = s.SoundSynth.Name - }).FirstOrDefaultAsync(m => m.Id == - id); - if(soundByOwnedMachine == null) return NotFound(); + SoundByMachineViewModel soundByOwnedMachine = + await _context.SoundByOwnedMachine.OrderBy(s => s.OwnedMachine.Machine.Company.Name). + ThenBy(s => s.OwnedMachine.Machine.Name).ThenBy(s => s.OwnedMachine.User.UserName). + ThenBy(s => s.SoundSynth.Name).Select(s => new SoundByMachineViewModel + { + Id = s.Id, + Machine = + $"{s.OwnedMachine.Machine.Company.Name} {s.OwnedMachine.Machine.Name} <{s.OwnedMachine.User.UserName}>", + SoundSynth = s.SoundSynth.Name + }).FirstOrDefaultAsync(m => m.Id == id); + + if(soundByOwnedMachine == null) + return NotFound(); return View(soundByOwnedMachine); } @@ -65,19 +61,24 @@ namespace Marechai.Areas.Admin.Controllers // GET: SoundByOwnedMachine/Create public IActionResult Create() { - ViewData["OwnedMachineId"] = - new - SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name).ThenBy(m => m.Machine.Name).ThenBy(m => m.User.UserName).Select(m => new {m.Id, Name = $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>"}), - "Id", "Name"); + ViewData["OwnedMachineId"] = new SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name). + ThenBy(m => m.Machine.Name). + ThenBy(m => m.User.UserName).Select(m => new + { + m.Id, + Name = + $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>" + }), "Id", "Name"); + ViewData["SoundSynthId"] = new SelectList(_context.SoundSynths, "Id", "Name"); + return View(); } // POST: SoundByOwnedMachine/Create - // To protect from overposting attacks, please enable the specific properties you want to bind to, for + // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Create([Bind("SoundSynthId,OwnedMachineId,Id")] SoundByOwnedMachine soundByOwnedMachine) { @@ -85,44 +86,60 @@ namespace Marechai.Areas.Admin.Controllers { _context.Add(soundByOwnedMachine); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - ViewData["OwnedMachineId"] = - new - SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name).ThenBy(m => m.Machine.Name).ThenBy(m => m.User.UserName).Select(m => new {m.Id, Name = $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>"}), - "Id", "Name", soundByOwnedMachine.OwnedMachineId); + ViewData["OwnedMachineId"] = new SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name). + ThenBy(m => m.Machine.Name). + ThenBy(m => m.User.UserName).Select(m => new + { + m.Id, + Name = + $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>" + }), "Id", "Name", soundByOwnedMachine.OwnedMachineId); + ViewData["SoundSynthId"] = new SelectList(_context.SoundSynths, "Id", "Name", soundByOwnedMachine.SoundSynthId); + return View(soundByOwnedMachine); } // GET: SoundByOwnedMachine/Edit/5 public async Task Edit(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); SoundByOwnedMachine soundByOwnedMachine = await _context.SoundByOwnedMachine.FindAsync(id); - if(soundByOwnedMachine == null) return NotFound(); - ViewData["OwnedMachineId"] = - new - SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name).ThenBy(m => m.Machine.Name).ThenBy(m => m.User.UserName).Select(m => new {m.Id, Name = $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>"}), - "Id", "Name", soundByOwnedMachine.OwnedMachineId); + if(soundByOwnedMachine == null) + return NotFound(); + + ViewData["OwnedMachineId"] = new SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name). + ThenBy(m => m.Machine.Name). + ThenBy(m => m.User.UserName).Select(m => new + { + m.Id, + Name = + $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>" + }), "Id", "Name", soundByOwnedMachine.OwnedMachineId); + ViewData["SoundSynthId"] = new SelectList(_context.SoundSynths, "Id", "Name", soundByOwnedMachine.SoundSynthId); + return View(soundByOwnedMachine); } // POST: SoundByOwnedMachine/Edit/5 - // To protect from overposting attacks, please enable the specific properties you want to bind to, for + // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Edit(long id, [Bind("SoundSynthId,OwnedMachineId,Id")] SoundByOwnedMachine soundByOwnedMachine) { - if(id != soundByOwnedMachine.Id) return NotFound(); + if(id != soundByOwnedMachine.Id) + return NotFound(); if(ModelState.IsValid) { @@ -133,7 +150,8 @@ namespace Marechai.Areas.Admin.Controllers } catch(DbUpdateConcurrencyException) { - if(!SoundByOwnedMachineExists(soundByOwnedMachine.Id)) return NotFound(); + if(!SoundByOwnedMachineExists(soundByOwnedMachine.Id)) + return NotFound(); throw; } @@ -141,54 +159,55 @@ namespace Marechai.Areas.Admin.Controllers return RedirectToAction(nameof(Index)); } - ViewData["OwnedMachineId"] = - new - SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name).ThenBy(m => m.Machine.Name).ThenBy(m => m.User.UserName).Select(m => new {m.Id, Name = $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>"}), - "Id", "Name", soundByOwnedMachine.OwnedMachineId); + ViewData["OwnedMachineId"] = new SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name). + ThenBy(m => m.Machine.Name). + ThenBy(m => m.User.UserName).Select(m => new + { + m.Id, + Name = + $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>" + }), "Id", "Name", soundByOwnedMachine.OwnedMachineId); + ViewData["SoundSynthId"] = new SelectList(_context.SoundSynths, "Id", "Name", soundByOwnedMachine.SoundSynthId); + return View(soundByOwnedMachine); } // GET: SoundByOwnedMachine/Delete/5 public async Task Delete(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); - SoundByMachineViewModel soundByOwnedMachine = await _context.SoundByOwnedMachine - .OrderBy(s => s.OwnedMachine.Machine.Company - .Name) - .ThenBy(s => s.OwnedMachine.Machine.Name) - .ThenBy(s => s.OwnedMachine.User.UserName) - .ThenBy(s => s.SoundSynth.Name) - .Select(s => new SoundByMachineViewModel - { - Id = s.Id, - Machine = - $"{s.OwnedMachine.Machine.Company.Name} {s.OwnedMachine.Machine.Name} <{s.OwnedMachine.User.UserName}>", - SoundSynth = s.SoundSynth.Name - }).FirstOrDefaultAsync(m => m.Id == - id); - if(soundByOwnedMachine == null) return NotFound(); + SoundByMachineViewModel soundByOwnedMachine = + await _context.SoundByOwnedMachine.OrderBy(s => s.OwnedMachine.Machine.Company.Name). + ThenBy(s => s.OwnedMachine.Machine.Name).ThenBy(s => s.OwnedMachine.User.UserName). + ThenBy(s => s.SoundSynth.Name).Select(s => new SoundByMachineViewModel + { + Id = s.Id, + Machine = + $"{s.OwnedMachine.Machine.Company.Name} {s.OwnedMachine.Machine.Name} <{s.OwnedMachine.User.UserName}>", + SoundSynth = s.SoundSynth.Name + }).FirstOrDefaultAsync(m => m.Id == id); + + if(soundByOwnedMachine == null) + return NotFound(); return View(soundByOwnedMachine); } // POST: SoundByOwnedMachine/Delete/5 - [HttpPost] - [ActionName("Delete")] - [ValidateAntiForgeryToken] + [HttpPost, ActionName("Delete"), ValidateAntiForgeryToken] public async Task DeleteConfirmed(long id) { SoundByOwnedMachine soundByOwnedMachine = await _context.SoundByOwnedMachine.FindAsync(id); _context.SoundByOwnedMachine.Remove(soundByOwnedMachine); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - bool SoundByOwnedMachineExists(long id) - { - return _context.SoundByOwnedMachine.Any(e => e.Id == id); - } + bool SoundByOwnedMachineExists(long id) => _context.SoundByOwnedMachine.Any(e => e.Id == id); } } \ No newline at end of file diff --git a/Marechai/Areas/Admin/Controllers/SoundSynthsController.cs b/Marechai/Areas/Admin/Controllers/SoundSynthsController.cs index 3ab95564..0adf6cd4 100644 --- a/Marechai/Areas/Admin/Controllers/SoundSynthsController.cs +++ b/Marechai/Areas/Admin/Controllers/SoundSynthsController.cs @@ -30,8 +30,8 @@ using System.Linq; using System.Threading.Tasks; -using Marechai.Database.Models; using Marechai.Areas.Admin.Models; +using Marechai.Database.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; @@ -40,41 +40,37 @@ using Microsoft.EntityFrameworkCore.Query; namespace Marechai.Areas.Admin.Controllers { - [Area("Admin")] - [Authorize] + [Area("Admin"), Authorize] public class SoundSynthsController : Controller { readonly MarechaiContext _context; - public SoundSynthsController(MarechaiContext context) - { - _context = context; - } + public SoundSynthsController(MarechaiContext context) => _context = context; // GET: Admin/SoundSynths public async Task Index() { IIncludableQueryable marechaiContext = _context.SoundSynths.Include(s => s.Company); - return View(await marechaiContext.OrderBy(s => s.Company).ThenBy(s => s.Name).ThenBy(s => s.ModelCode) - .Select(s => new SoundSynthViewModel - { - Company = s.Company.Name, - Id = s.Id, - Introduced = s.Introduced, - ModelCode = s.ModelCode, - Name = s.Name, - Type = s.Type - }).ToListAsync()); + + return View(await marechaiContext.OrderBy(s => s.Company).ThenBy(s => s.Name).ThenBy(s => s.ModelCode). + Select(s => new SoundSynthViewModel + { + Company = s.Company.Name, Id = s.Id, Introduced = s.Introduced, + ModelCode = s.ModelCode, Name = s.Name, Type = s.Type + }).ToListAsync()); } // GET: Admin/SoundSynths/Details/5 public async Task Details(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); SoundSynth soundSynth = await _context.SoundSynths.Include(s => s.Company).FirstOrDefaultAsync(m => m.Id == id); - if(soundSynth == null) return NotFound(); + + if(soundSynth == null) + return NotFound(); return View(soundSynth); } @@ -83,14 +79,14 @@ namespace Marechai.Areas.Admin.Controllers public IActionResult Create() { ViewData["CompanyId"] = new SelectList(_context.Companies, "Id", "Name"); + return View(); } // POST: Admin/SoundSynths/Create // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Create( [Bind("Id,Name,CompanyId,ModelCode,Introduced,Voices,Frequency,Depth,SquareWave,WhiteNoise,Type")] SoundSynth soundSynth) @@ -99,35 +95,41 @@ namespace Marechai.Areas.Admin.Controllers { _context.Add(soundSynth); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } ViewData["CompanyId"] = new SelectList(_context.Companies, "Id", "Name", soundSynth.CompanyId); + return View(soundSynth); } // GET: Admin/SoundSynths/Edit/5 public async Task Edit(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); SoundSynth soundSynth = await _context.SoundSynths.FindAsync(id); - if(soundSynth == null) return NotFound(); + + if(soundSynth == null) + return NotFound(); ViewData["CompanyId"] = new SelectList(_context.Companies, "Id", "Name", soundSynth.CompanyId); + return View(soundSynth); } // POST: Admin/SoundSynths/Edit/5 // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Edit( int id, [Bind("Id,Name,CompanyId,ModelCode,Introduced,Voices,Frequency,Depth,SquareWave,WhiteNoise,Type")] SoundSynth soundSynth) { - if(id != soundSynth.Id) return NotFound(); + if(id != soundSynth.Id) + return NotFound(); if(ModelState.IsValid) { @@ -138,7 +140,8 @@ namespace Marechai.Areas.Admin.Controllers } catch(DbUpdateConcurrencyException) { - if(!SoundSynthExists(soundSynth.Id)) return NotFound(); + if(!SoundSynthExists(soundSynth.Id)) + return NotFound(); throw; } @@ -147,36 +150,36 @@ namespace Marechai.Areas.Admin.Controllers } ViewData["CompanyId"] = new SelectList(_context.Companies, "Id", "Name", soundSynth.CompanyId); + return View(soundSynth); } // GET: Admin/SoundSynths/Delete/5 public async Task Delete(int? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); SoundSynth soundSynth = await _context.SoundSynths.Include(s => s.Company).FirstOrDefaultAsync(m => m.Id == id); - if(soundSynth == null) return NotFound(); + + if(soundSynth == null) + return NotFound(); return View(soundSynth); } // POST: Admin/SoundSynths/Delete/5 - [HttpPost] - [ActionName("Delete")] - [ValidateAntiForgeryToken] + [HttpPost, ActionName("Delete"), ValidateAntiForgeryToken] public async Task DeleteConfirmed(int id) { SoundSynth soundSynth = await _context.SoundSynths.FindAsync(id); _context.SoundSynths.Remove(soundSynth); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - bool SoundSynthExists(int id) - { - return _context.SoundSynths.Any(e => e.Id == id); - } + bool SoundSynthExists(int id) => _context.SoundSynths.Any(e => e.Id == id); } } \ No newline at end of file diff --git a/Marechai/Areas/Admin/Controllers/StorageByMachinesController.cs b/Marechai/Areas/Admin/Controllers/StorageByMachinesController.cs index 1b74cf12..7e6084d1 100644 --- a/Marechai/Areas/Admin/Controllers/StorageByMachinesController.cs +++ b/Marechai/Areas/Admin/Controllers/StorageByMachinesController.cs @@ -30,8 +30,8 @@ using System.Linq; using System.Threading.Tasks; -using Marechai.Database.Models; using Marechai.Areas.Admin.Models; +using Marechai.Database.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; @@ -40,42 +40,40 @@ using Microsoft.EntityFrameworkCore.Query; namespace Marechai.Areas.Admin.Controllers { - [Area("Admin")] - [Authorize] + [Area("Admin"), Authorize] public class StorageByMachinesController : Controller { readonly MarechaiContext _context; - public StorageByMachinesController(MarechaiContext context) - { - _context = context; - } + public StorageByMachinesController(MarechaiContext context) => _context = context; // GET: Admin/StorageByMachines public async Task Index() { IIncludableQueryable marechaiContext = _context.StorageByMachine.Include(s => s.Machine); - return View(await marechaiContext.OrderBy(s => s.Machine.Company.Name).ThenBy(s => s.Machine.Name) - .Select(s => new StorageByMachineViewModel - { - Id = s.Id, - Company = s.Machine.Company.Name, - Machine = s.Machine.Name, - Type = s.Type, - Interface = s.Interface, - Capacity = s.Capacity - }).ToListAsync()); + + return View(await marechaiContext.OrderBy(s => s.Machine.Company.Name).ThenBy(s => s.Machine.Name). + Select(s => new StorageByMachineViewModel + { + Id = s.Id, Company = s.Machine.Company.Name, + Machine = s.Machine.Name, + Type = s.Type, Interface = s.Interface, + Capacity = s.Capacity + }).ToListAsync()); } // GET: Admin/StorageByMachines/Details/5 public async Task Details(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); StorageByMachine storageByMachine = await _context.StorageByMachine.Include(s => s.Machine).FirstOrDefaultAsync(m => m.Id == id); - if(storageByMachine == null) return NotFound(); + + if(storageByMachine == null) + return NotFound(); return View(storageByMachine); } @@ -84,14 +82,14 @@ namespace Marechai.Areas.Admin.Controllers public IActionResult Create() { ViewData["MachineId"] = new SelectList(_context.Machines, "Id", "Name"); + return View(); } // POST: Admin/StorageByMachines/Create // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Create([Bind("MachineId,Type,Interface,Capacity,Id")] StorageByMachine storageByMachine) { @@ -99,34 +97,40 @@ namespace Marechai.Areas.Admin.Controllers { _context.Add(storageByMachine); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } ViewData["MachineId"] = new SelectList(_context.Machines, "Id", "Name", storageByMachine.MachineId); + return View(storageByMachine); } // GET: Admin/StorageByMachines/Edit/5 public async Task Edit(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); StorageByMachine storageByMachine = await _context.StorageByMachine.FindAsync(id); - if(storageByMachine == null) return NotFound(); + + if(storageByMachine == null) + return NotFound(); ViewData["MachineId"] = new SelectList(_context.Machines, "Id", "Name", storageByMachine.MachineId); + return View(storageByMachine); } // POST: Admin/StorageByMachines/Edit/5 // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Edit(long id, [Bind("MachineId,Type,Interface,Capacity,Id")] StorageByMachine storageByMachine) { - if(id != storageByMachine.Id) return NotFound(); + if(id != storageByMachine.Id) + return NotFound(); if(ModelState.IsValid) { @@ -137,7 +141,8 @@ namespace Marechai.Areas.Admin.Controllers } catch(DbUpdateConcurrencyException) { - if(!StorageByMachineExists(storageByMachine.Id)) return NotFound(); + if(!StorageByMachineExists(storageByMachine.Id)) + return NotFound(); throw; } @@ -146,36 +151,36 @@ namespace Marechai.Areas.Admin.Controllers } ViewData["MachineId"] = new SelectList(_context.Machines, "Id", "Name", storageByMachine.MachineId); + return View(storageByMachine); } // GET: Admin/StorageByMachines/Delete/5 public async Task Delete(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); StorageByMachine storageByMachine = await _context.StorageByMachine.Include(s => s.Machine).FirstOrDefaultAsync(m => m.Id == id); - if(storageByMachine == null) return NotFound(); + + if(storageByMachine == null) + return NotFound(); return View(storageByMachine); } // POST: Admin/StorageByMachines/Delete/5 - [HttpPost] - [ActionName("Delete")] - [ValidateAntiForgeryToken] + [HttpPost, ActionName("Delete"), ValidateAntiForgeryToken] public async Task DeleteConfirmed(long id) { StorageByMachine storageByMachine = await _context.StorageByMachine.FindAsync(id); _context.StorageByMachine.Remove(storageByMachine); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - bool StorageByMachineExists(long id) - { - return _context.StorageByMachine.Any(e => e.Id == id); - } + bool StorageByMachineExists(long id) => _context.StorageByMachine.Any(e => e.Id == id); } } \ No newline at end of file diff --git a/Marechai/Areas/Admin/Controllers/StorageByOwnedMachinesController.cs b/Marechai/Areas/Admin/Controllers/StorageByOwnedMachinesController.cs index b2a8552a..b6057742 100644 --- a/Marechai/Areas/Admin/Controllers/StorageByOwnedMachinesController.cs +++ b/Marechai/Areas/Admin/Controllers/StorageByOwnedMachinesController.cs @@ -30,8 +30,8 @@ using System.Linq; using System.Threading.Tasks; -using Marechai.Database.Models; using Marechai.Areas.Admin.Models; +using Marechai.Database.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; @@ -40,60 +40,50 @@ using Microsoft.EntityFrameworkCore.Query; namespace Marechai.Areas.Admin.Controllers { - [Area("Admin")] - [Authorize] + [Area("Admin"), Authorize] public class StorageByOwnedMachinesController : Controller { readonly MarechaiContext _context; - public StorageByOwnedMachinesController(MarechaiContext context) - { - _context = context; - } + public StorageByOwnedMachinesController(MarechaiContext context) => _context = context; // GET: Admin/StorageByOwnedMachines public async Task Index() { IIncludableQueryable marechaiContext = _context.StorageByOwnedMachine.Include(s => s.OwnedMachine); - return View(await marechaiContext.OrderBy(s => s.OwnedMachine.Machine.Company.Name) - .ThenBy(s => s.OwnedMachine.Machine.Name) - .ThenBy(s => s.OwnedMachine.User.UserName) - .Select(s => new StorageByMachineViewModel - { - Id = s.Id, - Company = s.OwnedMachine.Machine.Company.Name, - Machine = - $"{s.OwnedMachine.Machine.Company.Name} {s.OwnedMachine.Machine.Name} <{s.OwnedMachine.User.UserName}>", - Type = s.Type, - Interface = s.Interface, - Capacity = s.Capacity - }).ToListAsync()); + + return View(await marechaiContext.OrderBy(s => s.OwnedMachine.Machine.Company.Name). + ThenBy(s => s.OwnedMachine.Machine.Name). + ThenBy(s => s.OwnedMachine.User.UserName). + Select(s => new StorageByMachineViewModel + { + Id = s.Id, Company = s.OwnedMachine.Machine.Company.Name, + Machine = + $"{s.OwnedMachine.Machine.Company.Name} {s.OwnedMachine.Machine.Name} <{s.OwnedMachine.User.UserName}>", + Type = s.Type, Interface = s.Interface, Capacity = s.Capacity + }).ToListAsync()); } // GET: Admin/StorageByOwnedMachines/Details/5 public async Task Details(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); - StorageByMachineViewModel storageByOwnedMachine = await _context - .StorageByOwnedMachine - .OrderBy(s => s.OwnedMachine.Machine.Company.Name) - .ThenBy(s => s.OwnedMachine.Machine.Name) - .ThenBy(s => s.OwnedMachine.User.UserName) - .Select(s => new StorageByMachineViewModel - { - Id = s.Id, - Company = - s.OwnedMachine.Machine.Company - .Name, - Machine = - $"{s.OwnedMachine.Machine.Company.Name} {s.OwnedMachine.Machine.Name} <{s.OwnedMachine.User.UserName}>", - Type = s.Type, - Interface = s.Interface, - Capacity = s.Capacity - }).FirstOrDefaultAsync(m => m.Id == id); - if(storageByOwnedMachine == null) return NotFound(); + StorageByMachineViewModel storageByOwnedMachine = + await _context.StorageByOwnedMachine.OrderBy(s => s.OwnedMachine.Machine.Company.Name). + ThenBy(s => s.OwnedMachine.Machine.Name).ThenBy(s => s.OwnedMachine.User.UserName). + Select(s => new StorageByMachineViewModel + { + Id = s.Id, Company = s.OwnedMachine.Machine.Company.Name, + Machine = + $"{s.OwnedMachine.Machine.Company.Name} {s.OwnedMachine.Machine.Name} <{s.OwnedMachine.User.UserName}>", + Type = s.Type, Interface = s.Interface, Capacity = s.Capacity + }).FirstOrDefaultAsync(m => m.Id == id); + + if(storageByOwnedMachine == null) + return NotFound(); return View(storageByOwnedMachine); } @@ -101,18 +91,22 @@ namespace Marechai.Areas.Admin.Controllers // GET: Admin/StorageByOwnedMachines/Create public IActionResult Create() { - ViewData["OwnedMachineId"] = - new - SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name).ThenBy(m => m.Machine.Name).ThenBy(m => m.User.UserName).Select(m => new {m.Id, Name = $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>"}), - "Id", "Name"); + ViewData["OwnedMachineId"] = new SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name). + ThenBy(m => m.Machine.Name). + ThenBy(m => m.User.UserName).Select(m => new + { + m.Id, + Name = + $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>" + }), "Id", "Name"); + return View(); } // POST: Admin/StorageByOwnedMachines/Create - // To protect from overposting attacks, please enable the specific properties you want to bind to, for + // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Create([Bind("OwnedMachineId,Type,Interface,Capacity,Id")] StorageByOwnedMachine storageByOwnedMachine) { @@ -120,40 +114,56 @@ namespace Marechai.Areas.Admin.Controllers { _context.Add(storageByOwnedMachine); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - ViewData["OwnedMachineId"] = - new - SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name).ThenBy(m => m.Machine.Name).ThenBy(m => m.User.UserName).Select(m => new {m.Id, Name = $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>"}), - "Id", "Name", storageByOwnedMachine.OwnedMachineId); + ViewData["OwnedMachineId"] = new SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name). + ThenBy(m => m.Machine.Name). + ThenBy(m => m.User.UserName).Select(m => new + { + m.Id, + Name = + $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>" + }), "Id", "Name", + storageByOwnedMachine.OwnedMachineId); + return View(storageByOwnedMachine); } // GET: Admin/StorageByOwnedMachines/Edit/5 public async Task Edit(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); StorageByOwnedMachine storageByOwnedMachine = await _context.StorageByOwnedMachine.FindAsync(id); - if(storageByOwnedMachine == null) return NotFound(); - ViewData["OwnedMachineId"] = - new - SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name).ThenBy(m => m.Machine.Name).ThenBy(m => m.User.UserName).Select(m => new {m.Id, Name = $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>"}), - "Id", "Name", storageByOwnedMachine.OwnedMachineId); + if(storageByOwnedMachine == null) + return NotFound(); + + ViewData["OwnedMachineId"] = new SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name). + ThenBy(m => m.Machine.Name). + ThenBy(m => m.User.UserName).Select(m => new + { + m.Id, + Name = + $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>" + }), "Id", "Name", + storageByOwnedMachine.OwnedMachineId); + return View(storageByOwnedMachine); } // POST: Admin/StorageByOwnedMachines/Edit/5 - // To protect from overposting attacks, please enable the specific properties you want to bind to, for + // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. - [HttpPost] - [ValidateAntiForgeryToken] + [HttpPost, ValidateAntiForgeryToken] public async Task Edit(long id, [Bind("OwnedMachineId,Type,Interface,Capacity,Id")] StorageByOwnedMachine storageByOwnedMachine) { - if(id != storageByOwnedMachine.Id) return NotFound(); + if(id != storageByOwnedMachine.Id) + return NotFound(); if(ModelState.IsValid) { @@ -164,7 +174,8 @@ namespace Marechai.Areas.Admin.Controllers } catch(DbUpdateConcurrencyException) { - if(!StorageByOwnedMachineExists(storageByOwnedMachine.Id)) return NotFound(); + if(!StorageByOwnedMachineExists(storageByOwnedMachine.Id)) + return NotFound(); throw; } @@ -172,55 +183,53 @@ namespace Marechai.Areas.Admin.Controllers return RedirectToAction(nameof(Index)); } - ViewData["OwnedMachineId"] = - new - SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name).ThenBy(m => m.Machine.Name).ThenBy(m => m.User.UserName).Select(m => new {m.Id, Name = $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>"}), - "Id", "Name", storageByOwnedMachine.OwnedMachineId); + ViewData["OwnedMachineId"] = new SelectList(_context.OwnedMachines.OrderBy(m => m.Machine.Company.Name). + ThenBy(m => m.Machine.Name). + ThenBy(m => m.User.UserName).Select(m => new + { + m.Id, + Name = + $"{m.Machine.Company.Name} {m.Machine.Name} <{m.User.UserName}>" + }), "Id", "Name", + storageByOwnedMachine.OwnedMachineId); + return View(storageByOwnedMachine); } // GET: Admin/StorageByOwnedMachines/Delete/5 public async Task Delete(long? id) { - if(id == null) return NotFound(); + if(id == null) + return NotFound(); - StorageByMachineViewModel storageByOwnedMachine = await _context - .StorageByOwnedMachine - .OrderBy(s => s.OwnedMachine.Machine.Company.Name) - .ThenBy(s => s.OwnedMachine.Machine.Name) - .ThenBy(s => s.OwnedMachine.User.UserName) - .Select(s => new StorageByMachineViewModel - { - Id = s.Id, - Company = - s.OwnedMachine.Machine.Company - .Name, - Machine = - $"{s.OwnedMachine.Machine.Company.Name} {s.OwnedMachine.Machine.Name} <{s.OwnedMachine.User.UserName}>", - Type = s.Type, - Interface = s.Interface, - Capacity = s.Capacity - }).FirstOrDefaultAsync(m => m.Id == id); - if(storageByOwnedMachine == null) return NotFound(); + StorageByMachineViewModel storageByOwnedMachine = + await _context.StorageByOwnedMachine.OrderBy(s => s.OwnedMachine.Machine.Company.Name). + ThenBy(s => s.OwnedMachine.Machine.Name).ThenBy(s => s.OwnedMachine.User.UserName). + Select(s => new StorageByMachineViewModel + { + Id = s.Id, Company = s.OwnedMachine.Machine.Company.Name, + Machine = + $"{s.OwnedMachine.Machine.Company.Name} {s.OwnedMachine.Machine.Name} <{s.OwnedMachine.User.UserName}>", + Type = s.Type, Interface = s.Interface, Capacity = s.Capacity + }).FirstOrDefaultAsync(m => m.Id == id); + + if(storageByOwnedMachine == null) + return NotFound(); return View(storageByOwnedMachine); } // POST: Admin/StorageByOwnedMachines/Delete/5 - [HttpPost] - [ActionName("Delete")] - [ValidateAntiForgeryToken] + [HttpPost, ActionName("Delete"), ValidateAntiForgeryToken] public async Task DeleteConfirmed(long id) { StorageByOwnedMachine storageByOwnedMachine = await _context.StorageByOwnedMachine.FindAsync(id); _context.StorageByOwnedMachine.Remove(storageByOwnedMachine); await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } - bool StorageByOwnedMachineExists(long id) - { - return _context.StorageByOwnedMachine.Any(e => e.Id == id); - } + bool StorageByOwnedMachineExists(long id) => _context.StorageByOwnedMachine.Any(e => e.Id == id); } } \ No newline at end of file diff --git a/Marechai/Areas/Admin/Models/CompanyViewModel.cs b/Marechai/Areas/Admin/Models/CompanyViewModel.cs index c3cdb5ab..6b69d5b4 100644 --- a/Marechai/Areas/Admin/Models/CompanyViewModel.cs +++ b/Marechai/Areas/Admin/Models/CompanyViewModel.cs @@ -9,11 +9,9 @@ namespace Marechai.Areas.Admin.Models public class CompanyViewModel : BaseViewModel { public string Name { get; set; } - [DisplayFormat(DataFormatString = "{0:d}", ApplyFormatInEditMode = true)] - [DataType(DataType.Date)] + [DisplayFormat(DataFormatString = "{0:d}", ApplyFormatInEditMode = true), DataType(DataType.Date)] public DateTime? Founded { get; set; } - [DisplayFormat(DataFormatString = "{0:d}")] - [DataType(DataType.Date)] + [DisplayFormat(DataFormatString = "{0:d}"), DataType(DataType.Date)] public DateTime? Sold { get; set; } [DisplayName("Sold to")] public string SoldTo { get; set; } @@ -21,17 +19,15 @@ namespace Marechai.Areas.Admin.Models [Required] public CompanyStatus Status { get; set; } - [DisplayName("Sold")] - [NotMapped] - public string SoldView => - Status != CompanyStatus.Active && Status != CompanyStatus.Unknown - ? Sold is null - ? "Unknown" - : Sold.Value.ToShortDateString() - : Sold is null - ? SoldTo is null - ? "" - : "Unknown" - : Sold.Value.ToShortDateString(); + [DisplayName("Sold"), NotMapped] + public string SoldView => Status != CompanyStatus.Active && Status != CompanyStatus.Unknown + ? Sold is null + ? "Unknown" + : Sold.Value.ToShortDateString() + : Sold is null + ? SoldTo is null + ? "" + : "Unknown" + : Sold.Value.ToShortDateString(); } } \ No newline at end of file diff --git a/Marechai/Areas/Admin/Models/GpuViewModel.cs b/Marechai/Areas/Admin/Models/GpuViewModel.cs index fa54ef51..28f0aecb 100644 --- a/Marechai/Areas/Admin/Models/GpuViewModel.cs +++ b/Marechai/Areas/Admin/Models/GpuViewModel.cs @@ -39,8 +39,7 @@ namespace Marechai.Areas.Admin.Models public class GpuViewModel : BaseViewModel { public string Company; - [DisplayFormat(DataFormatString = "{0:d}")] - [DataType(DataType.Date)] + [DisplayFormat(DataFormatString = "{0:d}"), DataType(DataType.Date)] public DateTime? Introduced; [DisplayName("Model code")] public string ModelCode; diff --git a/Marechai/Areas/Admin/Models/MachinePhotoDetailsViewModel.cs b/Marechai/Areas/Admin/Models/MachinePhotoDetailsViewModel.cs index 0a9bcd64..c6b35494 100644 --- a/Marechai/Areas/Admin/Models/MachinePhotoDetailsViewModel.cs +++ b/Marechai/Areas/Admin/Models/MachinePhotoDetailsViewModel.cs @@ -59,8 +59,7 @@ namespace Marechai.Areas.Admin.Models public string SoftwareUsed { get; set; } [DisplayName("Subject distance range")] public SubjectDistanceRange? SubjectDistanceRange { get; set; } - [Timestamp] - [DisplayName("Uploaded on")] + [Timestamp, DisplayName("Uploaded on")] public DateTime UploadDate { get; set; } [DisplayName("Vertical resolution")] public double? VerticalResolution { get; set; } diff --git a/Marechai/Areas/Admin/Models/MachinePhotoViewModel.cs b/Marechai/Areas/Admin/Models/MachinePhotoViewModel.cs index a7adb4e6..2dd4520f 100644 --- a/Marechai/Areas/Admin/Models/MachinePhotoViewModel.cs +++ b/Marechai/Areas/Admin/Models/MachinePhotoViewModel.cs @@ -15,9 +15,7 @@ namespace Marechai.Areas.Admin.Models public DateTime UploadDate { get; set; } [DisplayName("Uploaded by")] public string UploadUser { get; set; } - [NotMapped] - [Required(ErrorMessage = "Image file required")] - [DisplayName("Upload photo:")] + [NotMapped, Required(ErrorMessage = "Image file required"), DisplayName("Upload photo:")] public IFormFile Photo { get; set; } public int MachineId { get; set; } public int LicenseId { get; set; } diff --git a/Marechai/Areas/Admin/Models/MachineViewModel.cs b/Marechai/Areas/Admin/Models/MachineViewModel.cs index 7aec445e..61d39b88 100644 --- a/Marechai/Areas/Admin/Models/MachineViewModel.cs +++ b/Marechai/Areas/Admin/Models/MachineViewModel.cs @@ -10,8 +10,7 @@ namespace Marechai.Areas.Admin.Models [StringLength(255)] public string Name { get; set; } public MachineType Type { get; set; } - [DisplayFormat(DataFormatString = "{0:d}")] - [DataType(DataType.Date)] + [DisplayFormat(DataFormatString = "{0:d}"), DataType(DataType.Date)] public DateTime? Introduced { get; set; } public string Family { get; set; } [StringLength(50)] diff --git a/Marechai/Areas/Admin/Models/OwnedMachineViewModel.cs b/Marechai/Areas/Admin/Models/OwnedMachineViewModel.cs index 33e2bd60..814c67a5 100644 --- a/Marechai/Areas/Admin/Models/OwnedMachineViewModel.cs +++ b/Marechai/Areas/Admin/Models/OwnedMachineViewModel.cs @@ -7,8 +7,7 @@ namespace Marechai.Areas.Admin.Models { public class OwnedMachineViewModel : BaseViewModel { - [DataType(DataType.Date)] - [DisplayName("Acquired")] + [DataType(DataType.Date), DisplayName("Acquired")] public DateTime AcquisitionDate { get; set; } public StatusType Status { get; set; } public string Machine { get; set; } diff --git a/Marechai/Areas/Admin/Models/ProcessorViewModel.cs b/Marechai/Areas/Admin/Models/ProcessorViewModel.cs index 3b3dedab..d77d48ce 100644 --- a/Marechai/Areas/Admin/Models/ProcessorViewModel.cs +++ b/Marechai/Areas/Admin/Models/ProcessorViewModel.cs @@ -42,8 +42,7 @@ namespace Marechai.Areas.Admin.Models public string Company { get; set; } [DisplayName("Model code")] public string ModelCode { get; set; } - [DisplayFormat(DataFormatString = "{0:d}")] - [DataType(DataType.Date)] + [DisplayFormat(DataFormatString = "{0:d}"), DataType(DataType.Date)] public DateTime? Introduced { get; set; } [DisplayName("Instruction set")] public string InstructionSet { get; set; } diff --git a/Marechai/Areas/Admin/Models/SoundSynthViewModel.cs b/Marechai/Areas/Admin/Models/SoundSynthViewModel.cs index fc04cdc1..f9f2f7d9 100644 --- a/Marechai/Areas/Admin/Models/SoundSynthViewModel.cs +++ b/Marechai/Areas/Admin/Models/SoundSynthViewModel.cs @@ -41,8 +41,7 @@ namespace Marechai.Areas.Admin.Models public string Name { get; set; } [DisplayName("Model code")] public string ModelCode { get; set; } - [DisplayFormat(DataFormatString = "{0:d}")] - [DataType(DataType.Date)] + [DisplayFormat(DataFormatString = "{0:d}"), DataType(DataType.Date)] public DateTime? Introduced { get; set; } public int? Type { get; set; } diff --git a/Marechai/Areas/Admin/Views/BrowserTests/Delete.cshtml b/Marechai/Areas/Admin/Views/BrowserTests/Delete.cshtml index 7eac36ba..ce7a255a 100644 --- a/Marechai/Areas/Admin/Views/BrowserTests/Delete.cshtml +++ b/Marechai/Areas/Admin/Views/BrowserTests/Delete.cshtml @@ -34,9 +34,7 @@ @{ ViewData["Title"] = "Delete"; } -

Delete

-

Are you sure you want to delete this?

Browser test

@@ -139,15 +137,10 @@ @Html.DisplayFor(model => model.Flash) -
- - - + + + Back to List
diff --git a/Marechai/Areas/Admin/Views/BrowserTests/Details.cshtml b/Marechai/Areas/Admin/Views/BrowserTests/Details.cshtml index adeb6b1b..ac9d93dd 100644 --- a/Marechai/Areas/Admin/Views/BrowserTests/Details.cshtml +++ b/Marechai/Areas/Admin/Views/BrowserTests/Details.cshtml @@ -34,9 +34,7 @@ @{ ViewData["Title"] = "Details"; } -

Details

-

Browser test


@@ -142,4 +140,4 @@ +
\ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/BrowserTests/Edit.cshtml b/Marechai/Areas/Admin/Views/BrowserTests/Edit.cshtml index 34b8177d..5a84ea62 100644 --- a/Marechai/Areas/Admin/Views/BrowserTests/Edit.cshtml +++ b/Marechai/Areas/Admin/Views/BrowserTests/Edit.cshtml @@ -34,67 +34,48 @@ @{ ViewData["Title"] = "Edit"; } -

Edit

-

Browser test


-
+
- +
-
-
-
-
-
@@ -175,11 +156,8 @@
diff --git a/Marechai/Areas/Admin/Views/BrowserTests/Index.cshtml b/Marechai/Areas/Admin/Views/BrowserTests/Index.cshtml index c9a1b2ef..be5d1360 100644 --- a/Marechai/Areas/Admin/Views/BrowserTests/Index.cshtml +++ b/Marechai/Areas/Admin/Views/BrowserTests/Index.cshtml @@ -29,15 +29,12 @@ // Copyright © 2003-2020 Natalia Portillo *******************************************************************************/ } -@using Marechai.Database.Models @model IEnumerable @{ ViewData["Title"] = "Browser tests (Admin)"; } -

Browser tests

- @@ -93,7 +90,7 @@ - @foreach(BrowserTest item in Model) + @foreach (var item in Model) { diff --git a/Marechai/Areas/Admin/Views/Companies/Create.cshtml b/Marechai/Areas/Admin/Views/Companies/Create.cshtml index 781f5316..80b1ea3e 100644 --- a/Marechai/Areas/Admin/Views/Companies/Create.cshtml +++ b/Marechai/Areas/Admin/Views/Companies/Create.cshtml @@ -35,157 +35,110 @@ @{ ViewData["Title"] = "Create"; } -

Create

-

Company


-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Marechai/Areas/Admin/Views/Companies/Delete.cshtml b/Marechai/Areas/Admin/Views/Companies/Delete.cshtml index 27eddd85..ed61eaec 100644 --- a/Marechai/Areas/Admin/Views/Companies/Delete.cshtml +++ b/Marechai/Areas/Admin/Views/Companies/Delete.cshtml @@ -34,9 +34,7 @@ @{ ViewData["Title"] = "Delete"; } -

Delete

-

Are you sure you want to delete this?

Company

@@ -121,15 +119,10 @@ @Html.DisplayFor(model => model.SoldTo.Name) - - - - + + + Back to List diff --git a/Marechai/Areas/Admin/Views/Companies/Details.cshtml b/Marechai/Areas/Admin/Views/Companies/Details.cshtml index b20e4aaf..0d9c351a 100644 --- a/Marechai/Areas/Admin/Views/Companies/Details.cshtml +++ b/Marechai/Areas/Admin/Views/Companies/Details.cshtml @@ -34,9 +34,7 @@ @{ ViewData["Title"] = "Details"; } -

Details

-

Company


@@ -124,4 +122,4 @@ +
\ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/Companies/Edit.cshtml b/Marechai/Areas/Admin/Views/Companies/Edit.cshtml index 8418f0b2..6bf52b99 100644 --- a/Marechai/Areas/Admin/Views/Companies/Edit.cshtml +++ b/Marechai/Areas/Admin/Views/Companies/Edit.cshtml @@ -35,162 +35,113 @@ @{ ViewData["Title"] = "Edit"; } -

Edit

-

Company


-
+
- +
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Marechai/Areas/Admin/Views/Companies/Index.cshtml b/Marechai/Areas/Admin/Views/Companies/Index.cshtml index d676c40a..614545f0 100644 --- a/Marechai/Areas/Admin/Views/Companies/Index.cshtml +++ b/Marechai/Areas/Admin/Views/Companies/Index.cshtml @@ -29,18 +29,14 @@ // Copyright © 2003-2020 Natalia Portillo *******************************************************************************/ } -@using CompanyViewModel = Marechai.Areas.Admin.Models.CompanyViewModel @model IEnumerable @{ ViewData["Title"] = "Companies (Admin)"; } -

Companies

-

- + Create New

@@ -69,7 +65,7 @@
- @foreach(CompanyViewModel item in Model) + @foreach (var item in Model) { diff --git a/Marechai/Areas/Admin/Views/CompanyDescriptions/Create.cshtml b/Marechai/Areas/Admin/Views/CompanyDescriptions/Create.cshtml index 27b2894c..b8654364 100644 --- a/Marechai/Areas/Admin/Views/CompanyDescriptions/Create.cshtml +++ b/Marechai/Areas/Admin/Views/CompanyDescriptions/Create.cshtml @@ -34,47 +34,36 @@ @{ ViewData["Title"] = "Create"; } -

Create

-

Company description


-
+
-
-
diff --git a/Marechai/Areas/Admin/Views/CompanyDescriptions/Delete.cshtml b/Marechai/Areas/Admin/Views/CompanyDescriptions/Delete.cshtml index e6faede7..ebfc6812 100644 --- a/Marechai/Areas/Admin/Views/CompanyDescriptions/Delete.cshtml +++ b/Marechai/Areas/Admin/Views/CompanyDescriptions/Delete.cshtml @@ -34,9 +34,7 @@ @{ ViewData["Title"] = "Delete"; } -

Delete

-

Are you sure you want to delete this?

Company description

@@ -55,15 +53,10 @@ @Html.Raw(Model.Html) - - - - + + + Back to List diff --git a/Marechai/Areas/Admin/Views/CompanyDescriptions/Details.cshtml b/Marechai/Areas/Admin/Views/CompanyDescriptions/Details.cshtml index bdb4b78f..5517f451 100644 --- a/Marechai/Areas/Admin/Views/CompanyDescriptions/Details.cshtml +++ b/Marechai/Areas/Admin/Views/CompanyDescriptions/Details.cshtml @@ -34,9 +34,7 @@ @{ ViewData["Title"] = "Details"; } -

Details

-

Company description


@@ -62,13 +60,10 @@
\ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/CompanyDescriptions/Edit.cshtml b/Marechai/Areas/Admin/Views/CompanyDescriptions/Edit.cshtml index ed401b07..eea403ac 100644 --- a/Marechai/Areas/Admin/Views/CompanyDescriptions/Edit.cshtml +++ b/Marechai/Areas/Admin/Views/CompanyDescriptions/Edit.cshtml @@ -34,52 +34,38 @@ @{ ViewData["Title"] = "Edit"; } -

Edit

-

Company description


-
+
- +
-
-
- diff --git a/Marechai/Areas/Admin/Views/CompanyDescriptions/Index.cshtml b/Marechai/Areas/Admin/Views/CompanyDescriptions/Index.cshtml index a20691cc..4504e7f9 100644 --- a/Marechai/Areas/Admin/Views/CompanyDescriptions/Index.cshtml +++ b/Marechai/Areas/Admin/Views/CompanyDescriptions/Index.cshtml @@ -29,18 +29,14 @@ // Copyright © 2003-2020 Natalia Portillo *******************************************************************************/ } -@using Marechai.Areas.Admin.Models @model IEnumerable @{ ViewData["Title"] = "Company descriptions (Admin)"; } -

Company description

-

- + Create New

@@ -54,26 +50,20 @@
- @foreach(CompanyDescriptionViewModel item in Model) + @foreach (var item in Model) { diff --git a/Marechai/Areas/Admin/Views/CompanyLogos/Create.cshtml b/Marechai/Areas/Admin/Views/CompanyLogos/Create.cshtml index 7e15f161..5cddf8ec 100644 --- a/Marechai/Areas/Admin/Views/CompanyLogos/Create.cshtml +++ b/Marechai/Areas/Admin/Views/CompanyLogos/Create.cshtml @@ -7,52 +7,38 @@
- -
+ +
-
-
-
diff --git a/Marechai/Areas/Admin/Views/CompanyLogos/Delete.cshtml b/Marechai/Areas/Admin/Views/CompanyLogos/Delete.cshtml index 2d58326d..8fb7074f 100644 --- a/Marechai/Areas/Admin/Views/CompanyLogos/Delete.cshtml +++ b/Marechai/Areas/Admin/Views/CompanyLogos/Delete.cshtml @@ -3,9 +3,7 @@ @{ ViewData["Title"] = "Delete"; } -

Delete

-

Are you sure you want to delete this?

Company logo

@@ -24,19 +22,12 @@ @Html.DisplayFor(model => model.Year) - - - - - - + + + + + Back to List
diff --git a/Marechai/Areas/Admin/Views/CompanyLogos/Details.cshtml b/Marechai/Areas/Admin/Views/CompanyLogos/Details.cshtml index c53bdfe0..9f83fc65 100644 --- a/Marechai/Areas/Admin/Views/CompanyLogos/Details.cshtml +++ b/Marechai/Areas/Admin/Views/CompanyLogos/Details.cshtml @@ -3,16 +3,12 @@ @{ ViewData["Title"] = "Details"; } -

Details

diff --git a/Marechai/Areas/Admin/Views/CompanyLogos/Edit.cshtml b/Marechai/Areas/Admin/Views/CompanyLogos/Edit.cshtml index 06a95984..2ea0b6e5 100644 --- a/Marechai/Areas/Admin/Views/CompanyLogos/Edit.cshtml +++ b/Marechai/Areas/Admin/Views/CompanyLogos/Edit.cshtml @@ -3,55 +3,38 @@ @{ ViewData["Title"] = "Edit"; } -

Edit

-

Company logo


-
+
- +
-
-
-
diff --git a/Marechai/Areas/Admin/Views/CompanyLogos/Index.cshtml b/Marechai/Areas/Admin/Views/CompanyLogos/Index.cshtml index 3e6788d5..3b6f714e 100644 --- a/Marechai/Areas/Admin/Views/CompanyLogos/Index.cshtml +++ b/Marechai/Areas/Admin/Views/CompanyLogos/Index.cshtml @@ -1,15 +1,11 @@ -@using Marechai.Areas.Admin.Models @model IEnumerable @{ ViewData["Title"] = "Index"; } -

Company logos

-

- + Create New

@@ -26,7 +22,7 @@
- @foreach(CompanyLogoViewModel item in Model) + @foreach (var item in Model) { diff --git a/Marechai/Areas/Admin/Views/DocumentCompanies/Create.cshtml b/Marechai/Areas/Admin/Views/DocumentCompanies/Create.cshtml index 9b9da253..b72faac1 100644 --- a/Marechai/Areas/Admin/Views/DocumentCompanies/Create.cshtml +++ b/Marechai/Areas/Admin/Views/DocumentCompanies/Create.cshtml @@ -3,46 +3,33 @@ @{ ViewData["Title"] = "Create"; } -

Create

-

Document company


-
+
-
-
diff --git a/Marechai/Areas/Admin/Views/DocumentCompanies/Delete.cshtml b/Marechai/Areas/Admin/Views/DocumentCompanies/Delete.cshtml index ee4ca2cf..938660d1 100644 --- a/Marechai/Areas/Admin/Views/DocumentCompanies/Delete.cshtml +++ b/Marechai/Areas/Admin/Views/DocumentCompanies/Delete.cshtml @@ -3,9 +3,7 @@ @{ ViewData["Title"] = "Delete"; } -

Delete

-

Are you sure you want to delete this?

Document company

@@ -21,21 +19,14 @@ @Html.DisplayNameFor(model => model.Company)
- + @Html.DisplayFor(modelItem => Model.Company)
- - - - + + + Back to List diff --git a/Marechai/Areas/Admin/Views/DocumentCompanies/Details.cshtml b/Marechai/Areas/Admin/Views/DocumentCompanies/Details.cshtml index 7ee4faec..9f341a1c 100644 --- a/Marechai/Areas/Admin/Views/DocumentCompanies/Details.cshtml +++ b/Marechai/Areas/Admin/Views/DocumentCompanies/Details.cshtml @@ -3,9 +3,7 @@ @{ ViewData["Title"] = "Details"; } -

Details

-

Document company


@@ -20,21 +18,16 @@ @Html.DisplayNameFor(model => model.Company)
- + @Html.DisplayFor(modelItem => Model.Company)
\ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/DocumentCompanies/Edit.cshtml b/Marechai/Areas/Admin/Views/DocumentCompanies/Edit.cshtml index 591123d6..5e31f48f 100644 --- a/Marechai/Areas/Admin/Views/DocumentCompanies/Edit.cshtml +++ b/Marechai/Areas/Admin/Views/DocumentCompanies/Edit.cshtml @@ -3,47 +3,34 @@ @{ ViewData["Title"] = "Edit"; } -

Edit

-

Document company


-
+
-
-
- +
diff --git a/Marechai/Areas/Admin/Views/DocumentCompanies/Index.cshtml b/Marechai/Areas/Admin/Views/DocumentCompanies/Index.cshtml index c1abf5d2..f27763ab 100644 --- a/Marechai/Areas/Admin/Views/DocumentCompanies/Index.cshtml +++ b/Marechai/Areas/Admin/Views/DocumentCompanies/Index.cshtml @@ -1,15 +1,11 @@ -@using Marechai.Areas.Admin.Models @model IEnumerable @{ ViewData["Title"] = "Index"; } -

Document companies

-

- + Create New

@@ -26,32 +22,24 @@
- @foreach(DocumentCompanyViewModel item in Model) + @foreach (var item in Model) { diff --git a/Marechai/Areas/Admin/Views/DocumentPeople/Create.cshtml b/Marechai/Areas/Admin/Views/DocumentPeople/Create.cshtml index d8abe776..d2136729 100644 --- a/Marechai/Areas/Admin/Views/DocumentPeople/Create.cshtml +++ b/Marechai/Areas/Admin/Views/DocumentPeople/Create.cshtml @@ -3,76 +3,54 @@ @{ ViewData["Title"] = "Create"; } -

Create

-

Document person


-
+
-
-
-
-
-
diff --git a/Marechai/Areas/Admin/Views/DocumentPeople/Delete.cshtml b/Marechai/Areas/Admin/Views/DocumentPeople/Delete.cshtml index 4ea25789..d5668c13 100644 --- a/Marechai/Areas/Admin/Views/DocumentPeople/Delete.cshtml +++ b/Marechai/Areas/Admin/Views/DocumentPeople/Delete.cshtml @@ -3,9 +3,7 @@ @{ ViewData["Title"] = "Delete"; } -

Delete

-

Are you sure you want to delete this?

Document person

@@ -39,21 +37,14 @@ @Html.DisplayNameFor(model => model.Person)
- + @Html.DisplayFor(modelItem => Model.Person.FullName)
- - - - + + + Back to List diff --git a/Marechai/Areas/Admin/Views/DocumentPeople/Details.cshtml b/Marechai/Areas/Admin/Views/DocumentPeople/Details.cshtml index 66ef3702..87030cc6 100644 --- a/Marechai/Areas/Admin/Views/DocumentPeople/Details.cshtml +++ b/Marechai/Areas/Admin/Views/DocumentPeople/Details.cshtml @@ -3,9 +3,7 @@ @{ ViewData["Title"] = "Details"; } -

Details

-

Document person


@@ -38,21 +36,16 @@ @Html.DisplayNameFor(model => model.Person)
- + @Html.DisplayFor(modelItem => Model.Person.FullName)
\ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/DocumentPeople/Edit.cshtml b/Marechai/Areas/Admin/Views/DocumentPeople/Edit.cshtml index 3611d74e..2564a319 100644 --- a/Marechai/Areas/Admin/Views/DocumentPeople/Edit.cshtml +++ b/Marechai/Areas/Admin/Views/DocumentPeople/Edit.cshtml @@ -3,78 +3,55 @@ @{ ViewData["Title"] = "Edit"; } -

Edit

-

Document person


-
+
-
-
-
-
-
- + diff --git a/Marechai/Areas/Admin/Views/DocumentPeople/Index.cshtml b/Marechai/Areas/Admin/Views/DocumentPeople/Index.cshtml index 5ca15626..7a596dfa 100644 --- a/Marechai/Areas/Admin/Views/DocumentPeople/Index.cshtml +++ b/Marechai/Areas/Admin/Views/DocumentPeople/Index.cshtml @@ -1,15 +1,11 @@ -@using Marechai.Areas.Admin.Models @model IEnumerable @{ ViewData["Title"] = "Index"; } -

Document people

-

- + Create New

@@ -26,32 +22,24 @@
- @foreach(DocumentPersonViewModel item in Model) + @foreach (var item in Model) { diff --git a/Marechai/Areas/Admin/Views/Gpus/Create.cshtml b/Marechai/Areas/Admin/Views/Gpus/Create.cshtml index e757ef9d..3af218b4 100644 --- a/Marechai/Areas/Admin/Views/Gpus/Create.cshtml +++ b/Marechai/Areas/Admin/Views/Gpus/Create.cshtml @@ -34,112 +34,79 @@ @{ ViewData["Title"] = "Create"; } -

Create

-

GPU


-
+
-
-
-
-
-
-
-
-
-
diff --git a/Marechai/Areas/Admin/Views/Gpus/Delete.cshtml b/Marechai/Areas/Admin/Views/Gpus/Delete.cshtml index 769a5e53..3c127853 100644 --- a/Marechai/Areas/Admin/Views/Gpus/Delete.cshtml +++ b/Marechai/Areas/Admin/Views/Gpus/Delete.cshtml @@ -34,9 +34,7 @@ @{ ViewData["Title"] = "Delete"; } -

Delete

-

Are you sure you want to delete this?

GPU

@@ -97,15 +95,10 @@ @Html.DisplayFor(model => model.Transistors) - - - - + + + Back to List diff --git a/Marechai/Areas/Admin/Views/Gpus/Details.cshtml b/Marechai/Areas/Admin/Views/Gpus/Details.cshtml index 33456a47..fe315797 100644 --- a/Marechai/Areas/Admin/Views/Gpus/Details.cshtml +++ b/Marechai/Areas/Admin/Views/Gpus/Details.cshtml @@ -34,9 +34,7 @@ @{ ViewData["Title"] = "Details"; } -

Details

-

GPU


@@ -98,13 +96,10 @@
\ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/Gpus/Edit.cshtml b/Marechai/Areas/Admin/Views/Gpus/Edit.cshtml index 62b86763..528d5521 100644 --- a/Marechai/Areas/Admin/Views/Gpus/Edit.cshtml +++ b/Marechai/Areas/Admin/Views/Gpus/Edit.cshtml @@ -34,117 +34,82 @@ @{ ViewData["Title"] = "Edit"; } -

Edit

-

GPU


-
+
- +
-
-
-
-
-
-
-
-
-
diff --git a/Marechai/Areas/Admin/Views/Gpus/Index.cshtml b/Marechai/Areas/Admin/Views/Gpus/Index.cshtml index a9b19df0..86dfaadc 100644 --- a/Marechai/Areas/Admin/Views/Gpus/Index.cshtml +++ b/Marechai/Areas/Admin/Views/Gpus/Index.cshtml @@ -29,18 +29,14 @@ // Copyright © 2003-2020 Natalia Portillo *******************************************************************************/ } -@using Marechai.Areas.Admin.Models @model IEnumerable @{ ViewData["Title"] = "GPUs (Admin)"; } -

GPUs

-

- + Create New

@@ -63,7 +59,7 @@
- @foreach(GpuViewModel item in Model) + @foreach (var item in Model) { diff --git a/Marechai/Areas/Admin/Views/GpusByMachine/Create.cshtml b/Marechai/Areas/Admin/Views/GpusByMachine/Create.cshtml index 3f98c0b1..81ed8d8c 100644 --- a/Marechai/Areas/Admin/Views/GpusByMachine/Create.cshtml +++ b/Marechai/Areas/Admin/Views/GpusByMachine/Create.cshtml @@ -3,9 +3,7 @@ @{ ViewData["Title"] = "Create"; } -

Create

-

GPU by machine


@@ -14,17 +12,16 @@
- +
- +
- - + \ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/GpusByMachine/Delete.cshtml b/Marechai/Areas/Admin/Views/GpusByMachine/Delete.cshtml index 424bf171..4a3e4ee3 100644 --- a/Marechai/Areas/Admin/Views/GpusByMachine/Delete.cshtml +++ b/Marechai/Areas/Admin/Views/GpusByMachine/Delete.cshtml @@ -3,31 +3,28 @@ @{ ViewData["Title"] = "Delete"; } -

Delete

-

Are you sure you want to delete this?

GPU by machine


-
+
@Html.DisplayNameFor(model => model.Machine)
-
+
@Html.DisplayFor(model => model.Machine.Name)
-
+
@Html.DisplayNameFor(model => model.Gpu)
-
+
@Html.DisplayFor(model => model.Gpu.Name)
-
- + Back to List -
+ \ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/GpusByMachine/Details.cshtml b/Marechai/Areas/Admin/Views/GpusByMachine/Details.cshtml index 39e756c8..3093fea5 100644 --- a/Marechai/Areas/Admin/Views/GpusByMachine/Details.cshtml +++ b/Marechai/Areas/Admin/Views/GpusByMachine/Details.cshtml @@ -3,23 +3,21 @@ @{ ViewData["Title"] = "Details"; } -

Details

-

GPU by machine


-
+
@Html.DisplayNameFor(model => model.Machine)
-
+
@Html.DisplayFor(model => model.Machine.Name)
-
+
@Html.DisplayNameFor(model => model.Gpu)
-
+
@Html.DisplayFor(model => model.Gpu.Name)
@@ -27,4 +25,4 @@ +
\ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/GpusByMachine/Edit.cshtml b/Marechai/Areas/Admin/Views/GpusByMachine/Edit.cshtml index abc82542..66c2e1d6 100644 --- a/Marechai/Areas/Admin/Views/GpusByMachine/Edit.cshtml +++ b/Marechai/Areas/Admin/Views/GpusByMachine/Edit.cshtml @@ -3,9 +3,7 @@ @{ ViewData["Title"] = "Edit"; } -

Edit

-

GpusByMachine


@@ -24,10 +22,9 @@
- - + \ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/GpusByMachine/Index.cshtml b/Marechai/Areas/Admin/Views/GpusByMachine/Index.cshtml index 21a1c23c..8a5212aa 100644 --- a/Marechai/Areas/Admin/Views/GpusByMachine/Index.cshtml +++ b/Marechai/Areas/Admin/Views/GpusByMachine/Index.cshtml @@ -1,15 +1,11 @@ -@using Marechai.Areas.Admin.Models @model IEnumerable @{ ViewData["Title"] = "Index"; } -

GPUs by machine

-

- + Create New

@@ -26,7 +22,7 @@
- @foreach(GpusByMachineViewModel item in Model) + @foreach (var item in Model) { diff --git a/Marechai/Areas/Admin/Views/GpusByOwnedMachine/Create.cshtml b/Marechai/Areas/Admin/Views/GpusByOwnedMachine/Create.cshtml index e64a2b17..64673159 100644 --- a/Marechai/Areas/Admin/Views/GpusByOwnedMachine/Create.cshtml +++ b/Marechai/Areas/Admin/Views/GpusByOwnedMachine/Create.cshtml @@ -3,41 +3,29 @@ @{ ViewData["Title"] = "Create"; } -

Create

-

GPU by owned machine


-
+
-
-
diff --git a/Marechai/Areas/Admin/Views/GpusByOwnedMachine/Delete.cshtml b/Marechai/Areas/Admin/Views/GpusByOwnedMachine/Delete.cshtml index e225a807..e94c472e 100644 --- a/Marechai/Areas/Admin/Views/GpusByOwnedMachine/Delete.cshtml +++ b/Marechai/Areas/Admin/Views/GpusByOwnedMachine/Delete.cshtml @@ -3,9 +3,7 @@ @{ ViewData["Title"] = "Delete"; } -

Delete

-

Are you sure you want to delete this?

GPU by owned machine

@@ -24,15 +22,10 @@ @Html.DisplayFor(model => model.Gpu) - - - - + + + Back to List diff --git a/Marechai/Areas/Admin/Views/GpusByOwnedMachine/Details.cshtml b/Marechai/Areas/Admin/Views/GpusByOwnedMachine/Details.cshtml index 0c9610e1..d2c3d14b 100644 --- a/Marechai/Areas/Admin/Views/GpusByOwnedMachine/Details.cshtml +++ b/Marechai/Areas/Admin/Views/GpusByOwnedMachine/Details.cshtml @@ -3,9 +3,7 @@ @{ ViewData["Title"] = "Details"; } -

Details

-

GPU by owned machine


@@ -25,13 +23,10 @@
\ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/GpusByOwnedMachine/Edit.cshtml b/Marechai/Areas/Admin/Views/GpusByOwnedMachine/Edit.cshtml index 159b70c7..b6cf45ee 100644 --- a/Marechai/Areas/Admin/Views/GpusByOwnedMachine/Edit.cshtml +++ b/Marechai/Areas/Admin/Views/GpusByOwnedMachine/Edit.cshtml @@ -3,49 +3,34 @@ @{ ViewData["Title"] = "Edit"; } -

Edit

-

Gpus by owned machine


-
+
-
-
- + diff --git a/Marechai/Areas/Admin/Views/GpusByOwnedMachine/Index.cshtml b/Marechai/Areas/Admin/Views/GpusByOwnedMachine/Index.cshtml index 21a1c23c..8a5212aa 100644 --- a/Marechai/Areas/Admin/Views/GpusByOwnedMachine/Index.cshtml +++ b/Marechai/Areas/Admin/Views/GpusByOwnedMachine/Index.cshtml @@ -1,15 +1,11 @@ -@using Marechai.Areas.Admin.Models @model IEnumerable @{ ViewData["Title"] = "Index"; } -

GPUs by machine

-

- + Create New

@@ -26,7 +22,7 @@
- @foreach(GpusByMachineViewModel item in Model) + @foreach (var item in Model) { diff --git a/Marechai/Areas/Admin/Views/Home/Index.cshtml b/Marechai/Areas/Admin/Views/Home/Index.cshtml index 6e193611..f225c17c 100644 --- a/Marechai/Areas/Admin/Views/Home/Index.cshtml +++ b/Marechai/Areas/Admin/Views/Home/Index.cshtml @@ -31,55 +31,84 @@ ViewData["Title"] = "Admin"; } -

Administration

- -

Administrative pages for documents

- Document companies
- Document people
+ Document companies +
+ Document people +
- -

User administrative pages

@* TODO *@ To be implemented diff --git a/Marechai/Areas/Admin/Views/InstructionSetExtensions/Create.cshtml b/Marechai/Areas/Admin/Views/InstructionSetExtensions/Create.cshtml index baa52efa..c3fcec5f 100644 --- a/Marechai/Areas/Admin/Views/InstructionSetExtensions/Create.cshtml +++ b/Marechai/Areas/Admin/Views/InstructionSetExtensions/Create.cshtml @@ -34,33 +34,24 @@ @{ ViewData["Title"] = "Create"; } -

Create

-

Instruction set extension


-
+
-
diff --git a/Marechai/Areas/Admin/Views/InstructionSetExtensions/Delete.cshtml b/Marechai/Areas/Admin/Views/InstructionSetExtensions/Delete.cshtml index 1f75495a..ee2ef16c 100644 --- a/Marechai/Areas/Admin/Views/InstructionSetExtensions/Delete.cshtml +++ b/Marechai/Areas/Admin/Views/InstructionSetExtensions/Delete.cshtml @@ -34,9 +34,7 @@ @{ ViewData["Title"] = "Delete"; } -

Delete

-

Are you sure you want to delete this?

Instruction set extension

@@ -49,15 +47,10 @@ @Html.DisplayFor(model => model.Extension) - - - - + + + Back to List diff --git a/Marechai/Areas/Admin/Views/InstructionSetExtensions/Details.cshtml b/Marechai/Areas/Admin/Views/InstructionSetExtensions/Details.cshtml index 4619769e..1df9ab39 100644 --- a/Marechai/Areas/Admin/Views/InstructionSetExtensions/Details.cshtml +++ b/Marechai/Areas/Admin/Views/InstructionSetExtensions/Details.cshtml @@ -34,9 +34,7 @@ @{ ViewData["Title"] = "Details"; } -

Details

-

Instruction set extension


@@ -48,14 +46,14 @@ @Html.DisplayFor(model => model.Extension) - @if(ViewBag.Processors != null) + @if (ViewBag.Processors != null) {
Processors
- @foreach(string processor in ViewBag.Processors) + @foreach (string processor in ViewBag.Processors) { @processor
} @@ -64,13 +62,10 @@ }
\ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/InstructionSetExtensions/Edit.cshtml b/Marechai/Areas/Admin/Views/InstructionSetExtensions/Edit.cshtml index a6d8c5a2..17132367 100644 --- a/Marechai/Areas/Admin/Views/InstructionSetExtensions/Edit.cshtml +++ b/Marechai/Areas/Admin/Views/InstructionSetExtensions/Edit.cshtml @@ -34,35 +34,25 @@ @{ ViewData["Title"] = "Edit"; } -

Edit

-

Instruction set extension


-
+
- +
-
diff --git a/Marechai/Areas/Admin/Views/InstructionSetExtensions/Index.cshtml b/Marechai/Areas/Admin/Views/InstructionSetExtensions/Index.cshtml index b8c4cde3..034f01b0 100644 --- a/Marechai/Areas/Admin/Views/InstructionSetExtensions/Index.cshtml +++ b/Marechai/Areas/Admin/Views/InstructionSetExtensions/Index.cshtml @@ -29,18 +29,14 @@ // Copyright © 2003-2020 Natalia Portillo *******************************************************************************/ } -@using Marechai.Database.Models @model IEnumerable @{ ViewData["Title"] = "Instruction set extensions (Admin)"; } -

Instruction set extensions

-

- + Create New

@@ -54,26 +50,20 @@
- @foreach(InstructionSetExtension item in Model) + @foreach (var item in Model) { diff --git a/Marechai/Areas/Admin/Views/InstructionSetExtensionsByProcessor/Create.cshtml b/Marechai/Areas/Admin/Views/InstructionSetExtensionsByProcessor/Create.cshtml index d0531e1e..bb6dd791 100644 --- a/Marechai/Areas/Admin/Views/InstructionSetExtensionsByProcessor/Create.cshtml +++ b/Marechai/Areas/Admin/Views/InstructionSetExtensionsByProcessor/Create.cshtml @@ -3,47 +3,33 @@ @{ ViewData["Title"] = "Create"; } -

Create

-

Instruction set extensions by processor


-
+
-
-
diff --git a/Marechai/Areas/Admin/Views/InstructionSetExtensionsByProcessor/Delete.cshtml b/Marechai/Areas/Admin/Views/InstructionSetExtensionsByProcessor/Delete.cshtml index 9d4689ec..aa5faa97 100644 --- a/Marechai/Areas/Admin/Views/InstructionSetExtensionsByProcessor/Delete.cshtml +++ b/Marechai/Areas/Admin/Views/InstructionSetExtensionsByProcessor/Delete.cshtml @@ -3,9 +3,7 @@ @{ ViewData["Title"] = "Delete"; } -

Delete

-

Are you sure you want to delete this?

Instruction set extensions by processor

@@ -24,19 +22,12 @@ @Html.DisplayFor(model => model.Processor.Name) - - - - - - + + + + + Back to List diff --git a/Marechai/Areas/Admin/Views/InstructionSetExtensionsByProcessor/Details.cshtml b/Marechai/Areas/Admin/Views/InstructionSetExtensionsByProcessor/Details.cshtml index 1bbe19f4..1a69e45f 100644 --- a/Marechai/Areas/Admin/Views/InstructionSetExtensionsByProcessor/Details.cshtml +++ b/Marechai/Areas/Admin/Views/InstructionSetExtensionsByProcessor/Details.cshtml @@ -3,9 +3,7 @@ @{ ViewData["Title"] = "Details"; } -

Details

-

Instruction set extensions by processor


@@ -25,13 +23,10 @@
\ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/InstructionSetExtensionsByProcessor/Edit.cshtml b/Marechai/Areas/Admin/Views/InstructionSetExtensionsByProcessor/Edit.cshtml index 6579a650..7fa77225 100644 --- a/Marechai/Areas/Admin/Views/InstructionSetExtensionsByProcessor/Edit.cshtml +++ b/Marechai/Areas/Admin/Views/InstructionSetExtensionsByProcessor/Edit.cshtml @@ -3,49 +3,34 @@ @{ ViewData["Title"] = "Edit"; } -

Edit

-

Instruction set extensions by processor


-
+
- +
-
-
diff --git a/Marechai/Areas/Admin/Views/InstructionSetExtensionsByProcessor/Index.cshtml b/Marechai/Areas/Admin/Views/InstructionSetExtensionsByProcessor/Index.cshtml index 3c001de9..03b14c9d 100644 --- a/Marechai/Areas/Admin/Views/InstructionSetExtensionsByProcessor/Index.cshtml +++ b/Marechai/Areas/Admin/Views/InstructionSetExtensionsByProcessor/Index.cshtml @@ -1,15 +1,11 @@ -@using Marechai.Areas.Admin.Models @model IEnumerable @{ ViewData["Title"] = "Index"; } -

Instruction set extensions by processor

-

- + Create New

@@ -26,7 +22,7 @@
- @foreach(InstructionSetExtensionsByProcessorViewModel item in Model) + @foreach (var item in Model) { diff --git a/Marechai/Areas/Admin/Views/InstructionSets/Create.cshtml b/Marechai/Areas/Admin/Views/InstructionSets/Create.cshtml index 0efec9ac..14bee765 100644 --- a/Marechai/Areas/Admin/Views/InstructionSets/Create.cshtml +++ b/Marechai/Areas/Admin/Views/InstructionSets/Create.cshtml @@ -34,33 +34,24 @@ @{ ViewData["Title"] = "Create"; } -

Create

-

Instruction set


-
+
-
diff --git a/Marechai/Areas/Admin/Views/InstructionSets/Delete.cshtml b/Marechai/Areas/Admin/Views/InstructionSets/Delete.cshtml index 24e19667..dfaf35cd 100644 --- a/Marechai/Areas/Admin/Views/InstructionSets/Delete.cshtml +++ b/Marechai/Areas/Admin/Views/InstructionSets/Delete.cshtml @@ -34,9 +34,7 @@ @{ ViewData["Title"] = "Delete"; } -

Delete

-

Are you sure you want to delete this?

Instruction set

@@ -49,15 +47,10 @@ @Html.DisplayFor(model => model.Name) - - - - + + + Back to List diff --git a/Marechai/Areas/Admin/Views/InstructionSets/Details.cshtml b/Marechai/Areas/Admin/Views/InstructionSets/Details.cshtml index fb1e1dfa..412c2f0b 100644 --- a/Marechai/Areas/Admin/Views/InstructionSets/Details.cshtml +++ b/Marechai/Areas/Admin/Views/InstructionSets/Details.cshtml @@ -34,9 +34,7 @@ @{ ViewData["Title"] = "Details"; } -

Details

-

Instruction set


@@ -52,4 +50,4 @@ +
\ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/InstructionSets/Edit.cshtml b/Marechai/Areas/Admin/Views/InstructionSets/Edit.cshtml index a01d4193..cc0a17b9 100644 --- a/Marechai/Areas/Admin/Views/InstructionSets/Edit.cshtml +++ b/Marechai/Areas/Admin/Views/InstructionSets/Edit.cshtml @@ -34,35 +34,25 @@ @{ ViewData["Title"] = "Edit"; } -

Edit

-

Instruction set


-
+
- +
-
diff --git a/Marechai/Areas/Admin/Views/InstructionSets/Index.cshtml b/Marechai/Areas/Admin/Views/InstructionSets/Index.cshtml index a1f2a3cc..226c605d 100644 --- a/Marechai/Areas/Admin/Views/InstructionSets/Index.cshtml +++ b/Marechai/Areas/Admin/Views/InstructionSets/Index.cshtml @@ -29,18 +29,14 @@ // Copyright © 2003-2020 Natalia Portillo *******************************************************************************/ } -@using Marechai.Database.Models @model IEnumerable @{ ViewData["Title"] = "Instruction sets (Admin)"; } -

Instruction sets

-

- + Create New

@@ -54,26 +50,20 @@
- @foreach(InstructionSet item in Model) + @foreach (var item in Model) { diff --git a/Marechai/Areas/Admin/Views/Licenses/Create.cshtml b/Marechai/Areas/Admin/Views/Licenses/Create.cshtml index c27ef58f..d6bfd7aa 100644 --- a/Marechai/Areas/Admin/Views/Licenses/Create.cshtml +++ b/Marechai/Areas/Admin/Views/Licenses/Create.cshtml @@ -3,74 +3,55 @@ @{ ViewData["Title"] = "Create"; } -

Create

-

License


-
+
-
-
-
-
diff --git a/Marechai/Areas/Admin/Views/Licenses/Delete.cshtml b/Marechai/Areas/Admin/Views/Licenses/Delete.cshtml index ca53a1eb..13a651ec 100644 --- a/Marechai/Areas/Admin/Views/Licenses/Delete.cshtml +++ b/Marechai/Areas/Admin/Views/Licenses/Delete.cshtml @@ -3,9 +3,7 @@ @{ ViewData["Title"] = "Delete"; } -

Delete

-

Are you sure you want to delete this?

License

@@ -48,15 +46,10 @@ @Html.DisplayFor(model => model.Text) - - - - + + + Back to List diff --git a/Marechai/Areas/Admin/Views/Licenses/Details.cshtml b/Marechai/Areas/Admin/Views/Licenses/Details.cshtml index f898d2db..efc2d451 100644 --- a/Marechai/Areas/Admin/Views/Licenses/Details.cshtml +++ b/Marechai/Areas/Admin/Views/Licenses/Details.cshtml @@ -3,9 +3,7 @@ @{ ViewData["Title"] = "Details"; } -

Details

-

License


@@ -49,13 +47,10 @@
\ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/Licenses/Edit.cshtml b/Marechai/Areas/Admin/Views/Licenses/Edit.cshtml index 801c76d8..98492bf5 100644 --- a/Marechai/Areas/Admin/Views/Licenses/Edit.cshtml +++ b/Marechai/Areas/Admin/Views/Licenses/Edit.cshtml @@ -3,76 +3,56 @@ @{ ViewData["Title"] = "Edit"; } -

Edit

-

License


-
+
-
-
-
-
- + diff --git a/Marechai/Areas/Admin/Views/Licenses/Index.cshtml b/Marechai/Areas/Admin/Views/Licenses/Index.cshtml index 60320b8f..791dfbc8 100644 --- a/Marechai/Areas/Admin/Views/Licenses/Index.cshtml +++ b/Marechai/Areas/Admin/Views/Licenses/Index.cshtml @@ -1,15 +1,11 @@ -@using Marechai.Database.Models @model IEnumerable @{ ViewData["Title"] = "Index"; } -

Licenses

-

- + Create New

@@ -35,7 +31,7 @@
- @foreach(License item in Model) + @foreach (var item in Model) { diff --git a/Marechai/Areas/Admin/Views/MachineFamilies/Create.cshtml b/Marechai/Areas/Admin/Views/MachineFamilies/Create.cshtml index 94f7b02f..6554669e 100644 --- a/Marechai/Areas/Admin/Views/MachineFamilies/Create.cshtml +++ b/Marechai/Areas/Admin/Views/MachineFamilies/Create.cshtml @@ -34,42 +34,30 @@ @{ ViewData["Title"] = "Create"; } -

Create

-

Machine family


-
+
-
-
diff --git a/Marechai/Areas/Admin/Views/MachineFamilies/Delete.cshtml b/Marechai/Areas/Admin/Views/MachineFamilies/Delete.cshtml index 9dd66fb8..f5dcfad2 100644 --- a/Marechai/Areas/Admin/Views/MachineFamilies/Delete.cshtml +++ b/Marechai/Areas/Admin/Views/MachineFamilies/Delete.cshtml @@ -34,9 +34,7 @@ @{ ViewData["Title"] = "Delete"; } -

Delete

-

Are you sure you want to delete this?

Machine family

@@ -55,15 +53,10 @@ @Html.DisplayFor(model => model.Name) - - - - + + + Back to List diff --git a/Marechai/Areas/Admin/Views/MachineFamilies/Details.cshtml b/Marechai/Areas/Admin/Views/MachineFamilies/Details.cshtml index 8245aaf6..d9ed8457 100644 --- a/Marechai/Areas/Admin/Views/MachineFamilies/Details.cshtml +++ b/Marechai/Areas/Admin/Views/MachineFamilies/Details.cshtml @@ -34,9 +34,7 @@ @{ ViewData["Title"] = "Details"; } -

Details

-

Machine family


@@ -58,4 +56,4 @@ +
\ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/MachineFamilies/Edit.cshtml b/Marechai/Areas/Admin/Views/MachineFamilies/Edit.cshtml index c0221391..caa875cb 100644 --- a/Marechai/Areas/Admin/Views/MachineFamilies/Edit.cshtml +++ b/Marechai/Areas/Admin/Views/MachineFamilies/Edit.cshtml @@ -34,47 +34,33 @@ @{ ViewData["Title"] = "Edit"; } -

Edit

-

Machine family


-
+
- +
-
-
diff --git a/Marechai/Areas/Admin/Views/MachineFamilies/Index.cshtml b/Marechai/Areas/Admin/Views/MachineFamilies/Index.cshtml index 32363f98..b4eeb2f7 100644 --- a/Marechai/Areas/Admin/Views/MachineFamilies/Index.cshtml +++ b/Marechai/Areas/Admin/Views/MachineFamilies/Index.cshtml @@ -29,18 +29,14 @@ // Copyright © 2003-2020 Natalia Portillo *******************************************************************************/ } -@using Marechai.Areas.Admin.Models @model IEnumerable @{ ViewData["Title"] = "Machine families (Admin)"; } -

Machine families

-

- + Create New

@@ -57,7 +53,7 @@
- @foreach(MachineFamilyViewModel item in Model) + @foreach (var item in Model) { diff --git a/Marechai/Areas/Admin/Views/MachinePhotos/Create.cshtml b/Marechai/Areas/Admin/Views/MachinePhotos/Create.cshtml index c4f09a48..b1e1ac35 100644 --- a/Marechai/Areas/Admin/Views/MachinePhotos/Create.cshtml +++ b/Marechai/Areas/Admin/Views/MachinePhotos/Create.cshtml @@ -6,9 +6,7 @@ @{ ViewData["Title"] = "Create"; } -

Create

-

Machine photo


@@ -36,68 +34,47 @@
- -
+ +
-
-
-
-
-
diff --git a/Marechai/Areas/Admin/Views/MachinePhotos/Delete.cshtml b/Marechai/Areas/Admin/Views/MachinePhotos/Delete.cshtml index fca96fda..e3d0f399 100644 --- a/Marechai/Areas/Admin/Views/MachinePhotos/Delete.cshtml +++ b/Marechai/Areas/Admin/Views/MachinePhotos/Delete.cshtml @@ -3,9 +3,7 @@ @{ ViewData["Title"] = "Delete"; } -

Delete

-

Are you sure you want to delete this?

Machine photo

@@ -45,15 +43,10 @@ - - - - + + + Back to List diff --git a/Marechai/Areas/Admin/Views/MachinePhotos/Details.cshtml b/Marechai/Areas/Admin/Views/MachinePhotos/Details.cshtml index 25ef9b74..748d4518 100644 --- a/Marechai/Areas/Admin/Views/MachinePhotos/Details.cshtml +++ b/Marechai/Areas/Admin/Views/MachinePhotos/Details.cshtml @@ -3,9 +3,7 @@ @{ ViewData["Title"] = "Details"; } -

Details

-

Machine photo


@@ -32,11 +30,7 @@ @Html.DisplayNameFor(model => model.Machine)
- + @Html.DisplayFor(model => model.Machine)
@@ -44,7 +38,7 @@ @Html.DisplayNameFor(model => model.Source)
- @if(Model.Source != null) + @if (Model.Source != null) { Link } @@ -53,21 +47,17 @@
-
-@if(Model.Author != null) +@if (Model.Author != null) {
@Html.DisplayNameFor(model => model.Author) @@ -76,7 +66,7 @@ @Html.DisplayFor(model => model.Author) } -@if(Model.CameraManufacturer != null) +@if (Model.CameraManufacturer != null) {
@Html.DisplayNameFor(model => model.CameraManufacturer) @@ -85,7 +75,7 @@ @Html.DisplayFor(model => model.CameraManufacturer) } -@if(Model.CameraModel != null) +@if (Model.CameraModel != null) {
@Html.DisplayNameFor(model => model.CameraModel) @@ -94,7 +84,7 @@ @Html.DisplayFor(model => model.CameraModel) } -@if(Model.ColorSpace != null) +@if (Model.ColorSpace != null) {
@Html.DisplayNameFor(model => model.ColorSpace) @@ -103,7 +93,7 @@ @Html.DisplayFor(model => model.ColorSpace) } -@if(Model.Comments != null) +@if (Model.Comments != null) {
@Html.DisplayNameFor(model => model.Comments) @@ -112,7 +102,7 @@ @Html.DisplayFor(model => model.Comments) } -@if(Model.Contrast != null) +@if (Model.Contrast != null) {
@Html.DisplayNameFor(model => model.Contrast) @@ -121,7 +111,7 @@ @Html.DisplayFor(model => model.Contrast) } -@if(Model.CreationDate != null) +@if (Model.CreationDate != null) {
@Html.DisplayNameFor(model => model.CreationDate) @@ -130,7 +120,7 @@ @Html.DisplayFor(model => model.CreationDate) } -@if(Model.DigitalZoomRatio != null) +@if (Model.DigitalZoomRatio != null) {
@Html.DisplayNameFor(model => model.DigitalZoomRatio) @@ -139,7 +129,7 @@ @Html.DisplayFor(model => model.DigitalZoomRatio) } -@if(Model.ExifVersion != null) +@if (Model.ExifVersion != null) {
@Html.DisplayNameFor(model => model.ExifVersion) @@ -148,7 +138,7 @@ @Html.DisplayFor(model => model.ExifVersion) } -@if(Model.Exposure != null) +@if (Model.Exposure != null) {
@Html.DisplayNameFor(model => model.Exposure) @@ -157,7 +147,7 @@ @Html.DisplayFor(model => model.Exposure) } -@if(Model.ExposureMethod != null) +@if (Model.ExposureMethod != null) {
@Html.DisplayNameFor(model => model.ExposureMethod) @@ -166,7 +156,7 @@ @Html.DisplayFor(model => model.ExposureMethod) } -@if(Model.ExposureProgram != null) +@if (Model.ExposureProgram != null) {
@Html.DisplayNameFor(model => model.ExposureProgram) @@ -175,7 +165,7 @@ @Html.DisplayFor(model => model.ExposureProgram) } -@if(Model.Flash != null) +@if (Model.Flash != null) {
@Html.DisplayNameFor(model => model.Flash) @@ -184,7 +174,7 @@ @Html.DisplayFor(model => model.Flash) } -@if(Model.Focal != null) +@if (Model.Focal != null) {
@Html.DisplayNameFor(model => model.Focal) @@ -193,7 +183,7 @@ @Html.DisplayFor(model => model.Focal) } -@if(Model.FocalLength != null) +@if (Model.FocalLength != null) {
@Html.DisplayNameFor(model => model.FocalLength) @@ -202,7 +192,7 @@ @Html.DisplayFor(model => model.FocalLength) } -@if(Model.FocalLengthEquivalent != null) +@if (Model.FocalLengthEquivalent != null) {
@Html.DisplayNameFor(model => model.FocalLengthEquivalent) @@ -211,7 +201,7 @@ @Html.DisplayFor(model => model.FocalLengthEquivalent) } -@if(Model.HorizontalResolution != null) +@if (Model.HorizontalResolution != null) {
@Html.DisplayNameFor(model => model.HorizontalResolution) @@ -220,7 +210,7 @@ @Html.DisplayFor(model => model.HorizontalResolution) } -@if(Model.IsoRating != null) +@if (Model.IsoRating != null) {
@Html.DisplayNameFor(model => model.IsoRating) @@ -229,7 +219,7 @@ @Html.DisplayFor(model => model.IsoRating) } -@if(Model.Lens != null) +@if (Model.Lens != null) {
@Html.DisplayNameFor(model => model.Lens) @@ -238,7 +228,7 @@ @Html.DisplayFor(model => model.Lens) } -@if(Model.LightSource != null) +@if (Model.LightSource != null) {
@Html.DisplayNameFor(model => model.LightSource) @@ -247,7 +237,7 @@ @Html.DisplayFor(model => model.LightSource) } -@if(Model.MeteringMode != null) +@if (Model.MeteringMode != null) {
@Html.DisplayNameFor(model => model.MeteringMode) @@ -256,7 +246,7 @@ @Html.DisplayFor(model => model.MeteringMode) } -@if(Model.ResolutionUnit != null) +@if (Model.ResolutionUnit != null) {
@Html.DisplayNameFor(model => model.ResolutionUnit) @@ -265,7 +255,7 @@ @Html.DisplayFor(model => model.ResolutionUnit) } -@if(Model.Orientation != null) +@if (Model.Orientation != null) {
@Html.DisplayNameFor(model => model.Orientation) @@ -274,7 +264,7 @@ @Html.DisplayFor(model => model.Orientation) } -@if(Model.Saturation != null) +@if (Model.Saturation != null) {
@Html.DisplayNameFor(model => model.Saturation) @@ -283,7 +273,7 @@ @Html.DisplayFor(model => model.Saturation) } -@if(Model.SceneCaptureType != null) +@if (Model.SceneCaptureType != null) {
@Html.DisplayNameFor(model => model.SceneCaptureType) @@ -292,7 +282,7 @@ @Html.DisplayFor(model => model.SceneCaptureType) } -@if(Model.SensingMethod != null) +@if (Model.SensingMethod != null) {
@Html.DisplayNameFor(model => model.SensingMethod) @@ -301,7 +291,7 @@ @Html.DisplayFor(model => model.SensingMethod) } -@if(Model.Sharpness != null) +@if (Model.Sharpness != null) {
@Html.DisplayNameFor(model => model.Sharpness) @@ -310,7 +300,7 @@ @Html.DisplayFor(model => model.Sharpness) } -@if(Model.SoftwareUsed != null) +@if (Model.SoftwareUsed != null) {
@Html.DisplayNameFor(model => model.SoftwareUsed) @@ -319,7 +309,7 @@ @Html.DisplayFor(model => model.SoftwareUsed) } -@if(Model.SubjectDistanceRange != null) +@if (Model.SubjectDistanceRange != null) {
@Html.DisplayNameFor(model => model.SubjectDistanceRange) @@ -328,7 +318,7 @@ @Html.DisplayFor(model => model.SubjectDistanceRange) } -@if(Model.VerticalResolution != null) +@if (Model.VerticalResolution != null) {
@Html.DisplayNameFor(model => model.VerticalResolution) @@ -337,7 +327,7 @@ @Html.DisplayFor(model => model.VerticalResolution) } -@if(Model.WhiteBalance != null) +@if (Model.WhiteBalance != null) {
@Html.DisplayNameFor(model => model.WhiteBalance) diff --git a/Marechai/Areas/Admin/Views/MachinePhotos/Edit.cshtml b/Marechai/Areas/Admin/Views/MachinePhotos/Edit.cshtml index 4f9ffe59..586d1347 100644 --- a/Marechai/Areas/Admin/Views/MachinePhotos/Edit.cshtml +++ b/Marechai/Areas/Admin/Views/MachinePhotos/Edit.cshtml @@ -4,411 +4,286 @@ @{ ViewData["Title"] = "Edit"; } -

Edit

-

Machine photo


-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- + diff --git a/Marechai/Areas/Admin/Views/MachinePhotos/Index.cshtml b/Marechai/Areas/Admin/Views/MachinePhotos/Index.cshtml index 0deb1679..9f692007 100644 --- a/Marechai/Areas/Admin/Views/MachinePhotos/Index.cshtml +++ b/Marechai/Areas/Admin/Views/MachinePhotos/Index.cshtml @@ -1,15 +1,11 @@ -@using Marechai.Areas.Admin.Models @model IEnumerable @{ ViewData["Title"] = "Index"; } -

Machine photos

-

- + Create New

@@ -36,23 +32,17 @@
- @foreach(MachinePhotoViewModel item in Model) + @foreach (var item in Model) { diff --git a/Marechai/Areas/Admin/Views/Machines/Create.cshtml b/Marechai/Areas/Admin/Views/Machines/Create.cshtml index 6aec11a4..752e7c41 100644 --- a/Marechai/Areas/Admin/Views/Machines/Create.cshtml +++ b/Marechai/Areas/Admin/Views/Machines/Create.cshtml @@ -35,83 +35,58 @@ @{ ViewData["Title"] = "Create"; } -

Create

-

Machine


-
+
-
-
-
-
-
-
diff --git a/Marechai/Areas/Admin/Views/Machines/Delete.cshtml b/Marechai/Areas/Admin/Views/Machines/Delete.cshtml index 6c882334..d809d1c9 100644 --- a/Marechai/Areas/Admin/Views/Machines/Delete.cshtml +++ b/Marechai/Areas/Admin/Views/Machines/Delete.cshtml @@ -34,9 +34,7 @@ @{ ViewData["Title"] = "Delete"; } -

Delete

-

Are you sure you want to delete this?

Machine

@@ -79,15 +77,10 @@ @Html.DisplayFor(model => model.Type) - - - - + + + Back to List diff --git a/Marechai/Areas/Admin/Views/Machines/Details.cshtml b/Marechai/Areas/Admin/Views/Machines/Details.cshtml index 43bfc31e..22f879c9 100644 --- a/Marechai/Areas/Admin/Views/Machines/Details.cshtml +++ b/Marechai/Areas/Admin/Views/Machines/Details.cshtml @@ -34,9 +34,7 @@ @{ ViewData["Title"] = "Details"; } -

Details

-

Machine


@@ -80,13 +78,10 @@
\ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/Machines/Edit.cshtml b/Marechai/Areas/Admin/Views/Machines/Edit.cshtml index 8d49c1bd..ec1e3225 100644 --- a/Marechai/Areas/Admin/Views/Machines/Edit.cshtml +++ b/Marechai/Areas/Admin/Views/Machines/Edit.cshtml @@ -35,85 +35,59 @@ @{ ViewData["Title"] = "Edit"; } -

Edit

-

Machine


-
+
- +
-
-
-
-
-
-
diff --git a/Marechai/Areas/Admin/Views/Machines/Index.cshtml b/Marechai/Areas/Admin/Views/Machines/Index.cshtml index 18e27143..43e3da27 100644 --- a/Marechai/Areas/Admin/Views/Machines/Index.cshtml +++ b/Marechai/Areas/Admin/Views/Machines/Index.cshtml @@ -29,18 +29,14 @@ // Copyright © 2003-2020 Natalia Portillo *******************************************************************************/ } -@using Marechai.Areas.Admin.Models @model IEnumerable @{ ViewData["Title"] = "Machines (Admin)"; } -

Machines

-

- + Create New

@@ -69,7 +65,7 @@
- @foreach(MachineViewModel item in Model) + @foreach (var item in Model) { diff --git a/Marechai/Areas/Admin/Views/MemoryByMachines/Create.cshtml b/Marechai/Areas/Admin/Views/MemoryByMachines/Create.cshtml index 3ed8b9a0..17610230 100644 --- a/Marechai/Areas/Admin/Views/MemoryByMachines/Create.cshtml +++ b/Marechai/Areas/Admin/Views/MemoryByMachines/Create.cshtml @@ -35,76 +35,53 @@ @{ ViewData["Title"] = "Create"; } -

Create

-

Memory by machine


-
+
-
-
-
-
-
diff --git a/Marechai/Areas/Admin/Views/MemoryByMachines/Delete.cshtml b/Marechai/Areas/Admin/Views/MemoryByMachines/Delete.cshtml index f5f62997..1cab4207 100644 --- a/Marechai/Areas/Admin/Views/MemoryByMachines/Delete.cshtml +++ b/Marechai/Areas/Admin/Views/MemoryByMachines/Delete.cshtml @@ -34,9 +34,7 @@ @{ ViewData["Title"] = "Delete"; } -

Delete

-

Are you sure you want to delete this?

Memory by machine

@@ -73,15 +71,10 @@ @Html.DisplayFor(model => model.Speed) - - - - + + + Back to List diff --git a/Marechai/Areas/Admin/Views/MemoryByMachines/Details.cshtml b/Marechai/Areas/Admin/Views/MemoryByMachines/Details.cshtml index dbf2c33c..d6dd8ca2 100644 --- a/Marechai/Areas/Admin/Views/MemoryByMachines/Details.cshtml +++ b/Marechai/Areas/Admin/Views/MemoryByMachines/Details.cshtml @@ -34,9 +34,7 @@ @{ ViewData["Title"] = "Details"; } -

Details

-

Memory by machine


@@ -74,13 +72,10 @@
\ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/MemoryByMachines/Edit.cshtml b/Marechai/Areas/Admin/Views/MemoryByMachines/Edit.cshtml index f516c946..ce9a383e 100644 --- a/Marechai/Areas/Admin/Views/MemoryByMachines/Edit.cshtml +++ b/Marechai/Areas/Admin/Views/MemoryByMachines/Edit.cshtml @@ -35,78 +35,54 @@ @{ ViewData["Title"] = "Edit"; } -

Edit

-

Memory by machine


-
+
-
-
-
-
-
- + diff --git a/Marechai/Areas/Admin/Views/MemoryByMachines/Index.cshtml b/Marechai/Areas/Admin/Views/MemoryByMachines/Index.cshtml index f080cc1c..e542441d 100644 --- a/Marechai/Areas/Admin/Views/MemoryByMachines/Index.cshtml +++ b/Marechai/Areas/Admin/Views/MemoryByMachines/Index.cshtml @@ -29,18 +29,14 @@ // Copyright © 2003-2020 Natalia Portillo *******************************************************************************/ } -@using Marechai.Areas.Admin.Models @model IEnumerable @{ ViewData["Title"] = "Memory by machines (Admin)"; } -

Memory by machines

-

- + Create New

@@ -66,7 +62,7 @@
- @foreach(MemoryByMachineViewModel item in Model) + @foreach (var item in Model) { diff --git a/Marechai/Areas/Admin/Views/MemoryByOwnedMachines/Create.cshtml b/Marechai/Areas/Admin/Views/MemoryByOwnedMachines/Create.cshtml index d05b0091..5bb304d0 100644 --- a/Marechai/Areas/Admin/Views/MemoryByOwnedMachines/Create.cshtml +++ b/Marechai/Areas/Admin/Views/MemoryByOwnedMachines/Create.cshtml @@ -35,76 +35,53 @@ @{ ViewData["Title"] = "Create"; } -

Create

-

Memory by machine


-
+
-
-
-
-
-
diff --git a/Marechai/Areas/Admin/Views/MemoryByOwnedMachines/Delete.cshtml b/Marechai/Areas/Admin/Views/MemoryByOwnedMachines/Delete.cshtml index 6bb0d08c..50a6debe 100644 --- a/Marechai/Areas/Admin/Views/MemoryByOwnedMachines/Delete.cshtml +++ b/Marechai/Areas/Admin/Views/MemoryByOwnedMachines/Delete.cshtml @@ -34,9 +34,7 @@ @{ ViewData["Title"] = "Delete"; } -

Delete

-

Are you sure you want to delete this?

Memory by machine

@@ -73,15 +71,10 @@ @Html.DisplayFor(model => model.Speed) - - - - + + + Back to List diff --git a/Marechai/Areas/Admin/Views/MemoryByOwnedMachines/Details.cshtml b/Marechai/Areas/Admin/Views/MemoryByOwnedMachines/Details.cshtml index c31ac22c..613775b5 100644 --- a/Marechai/Areas/Admin/Views/MemoryByOwnedMachines/Details.cshtml +++ b/Marechai/Areas/Admin/Views/MemoryByOwnedMachines/Details.cshtml @@ -34,9 +34,7 @@ @{ ViewData["Title"] = "Details"; } -

Details

-

Memory by machine


@@ -74,13 +72,10 @@
\ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/MemoryByOwnedMachines/Edit.cshtml b/Marechai/Areas/Admin/Views/MemoryByOwnedMachines/Edit.cshtml index 5485c044..5ac3c25a 100644 --- a/Marechai/Areas/Admin/Views/MemoryByOwnedMachines/Edit.cshtml +++ b/Marechai/Areas/Admin/Views/MemoryByOwnedMachines/Edit.cshtml @@ -35,78 +35,54 @@ @{ ViewData["Title"] = "Edit"; } -

Edit

-

Memory by machine


-
+
-
-
-
-
-
- + diff --git a/Marechai/Areas/Admin/Views/MemoryByOwnedMachines/Index.cshtml b/Marechai/Areas/Admin/Views/MemoryByOwnedMachines/Index.cshtml index f080cc1c..e542441d 100644 --- a/Marechai/Areas/Admin/Views/MemoryByOwnedMachines/Index.cshtml +++ b/Marechai/Areas/Admin/Views/MemoryByOwnedMachines/Index.cshtml @@ -29,18 +29,14 @@ // Copyright © 2003-2020 Natalia Portillo *******************************************************************************/ } -@using Marechai.Areas.Admin.Models @model IEnumerable @{ ViewData["Title"] = "Memory by machines (Admin)"; } -

Memory by machines

-

- + Create New

@@ -66,7 +62,7 @@
- @foreach(MemoryByMachineViewModel item in Model) + @foreach (var item in Model) { diff --git a/Marechai/Areas/Admin/Views/News/Delete.cshtml b/Marechai/Areas/Admin/Views/News/Delete.cshtml index 82c3c8a4..4a0c0d52 100644 --- a/Marechai/Areas/Admin/Views/News/Delete.cshtml +++ b/Marechai/Areas/Admin/Views/News/Delete.cshtml @@ -34,9 +34,7 @@ @{ ViewData["Title"] = "Delete"; } -

Delete

-

Are you sure you want to delete this?

News

@@ -61,15 +59,10 @@ @Html.DisplayFor(model => model.AddedId) - - - - + + + Back to List diff --git a/Marechai/Areas/Admin/Views/News/Index.cshtml b/Marechai/Areas/Admin/Views/News/Index.cshtml index da54be1c..5ef41f84 100644 --- a/Marechai/Areas/Admin/Views/News/Index.cshtml +++ b/Marechai/Areas/Admin/Views/News/Index.cshtml @@ -29,15 +29,12 @@ // Copyright © 2003-2020 Natalia Portillo *******************************************************************************/ } -@using Marechai.Database.Models @model IEnumerable @{ ViewData["Title"] = "News (Admin)"; } -

News

-
@@ -145,19 +142,13 @@ @Html.DisplayFor(modelItem => item.Flash) - + Details - + Edit - + Delete
@@ -91,19 +87,13 @@ @Html.DisplayFor(modelItem => item.SoldTo) - + Details - + Edit - + Delete
@Html.DisplayFor(modelItem => item.Company) - + Details - + Edit - + Delete
@@ -36,19 +32,13 @@ @Html.DisplayFor(modelItem => item.Year) - + Details - + Edit - + Delete
@Html.DisplayFor(modelItem => item.Name) - + @Html.DisplayFor(modelItem => item.Company) - + Details - + Edit - + Delete
@Html.DisplayFor(modelItem => item.Name) - + @Html.DisplayFor(modelItem => item.Person) - + Details - + Edit - + Delete
@@ -79,19 +75,13 @@ @Html.DisplayFor(modelItem => item.IntroducedView) - + Details - + Edit - + Delete
@@ -36,19 +32,13 @@ @Html.DisplayFor(modelItem => item.Gpu) - + Details - + Edit - + Delete
@@ -36,19 +32,13 @@ @Html.DisplayFor(modelItem => item.Gpu) - + Details - + Edit - + Delete
@Html.DisplayFor(modelItem => item.Extension) - + Details - + Edit - + Delete
@@ -36,19 +32,13 @@ @Html.DisplayFor(modelItem => item.Extension) - + Details - + Edit - + Delete
@Html.DisplayFor(modelItem => item.Name) - + Details - + Edit - + Delete
@@ -51,28 +47,21 @@ @Html.DisplayFor(modelItem => item.OsiApproved) - @if(item.Link != null) + @if (item.Link != null) { - + Link } - + Details - + Edit - + Delete
@@ -67,19 +63,13 @@ @Html.DisplayFor(modelItem => item.Name) - + Details - + Edit - + Delete
- + /assets/photos/machines/thumbs/jpg/3x/@(item.Id).jpg 3x" src="/assets/photos/machines/thumbs/jpg/1x/@(item.Id).jpg" ) alt="" height="auto" width="auto" style="max-height: 64px; max-width: 64px" /> @@ -71,19 +61,13 @@ @Html.DisplayFor(modelItem => item.License) - + Details - + Edit - + Delete
@@ -91,19 +87,13 @@ @Html.DisplayFor(modelItem => item.Type) - + Details - + Edit - + Delete
@@ -85,19 +81,13 @@ @Html.DisplayFor(modelItem => item.Speed) - + Details - + Edit - + Delete
@@ -85,19 +81,13 @@ @Html.DisplayFor(modelItem => item.Speed) - + Details - + Edit - + Delete
@@ -54,7 +51,7 @@ - @foreach(News item in Model) + @foreach (var item in Model) { diff --git a/Marechai/Areas/Admin/Views/OwnedMachine/Create.cshtml b/Marechai/Areas/Admin/Views/OwnedMachine/Create.cshtml index f2d11956..6f675588 100644 --- a/Marechai/Areas/Admin/Views/OwnedMachine/Create.cshtml +++ b/Marechai/Areas/Admin/Views/OwnedMachine/Create.cshtml @@ -4,118 +4,85 @@ @{ ViewData["Title"] = "Create"; } -

Create

-

Owned machine


-
+
-
-
-
-
-
-
-
diff --git a/Marechai/Areas/Admin/Views/OwnedMachine/Delete.cshtml b/Marechai/Areas/Admin/Views/OwnedMachine/Delete.cshtml index 007de011..596d583b 100644 --- a/Marechai/Areas/Admin/Views/OwnedMachine/Delete.cshtml +++ b/Marechai/Areas/Admin/Views/OwnedMachine/Delete.cshtml @@ -3,9 +3,7 @@ @{ ViewData["Title"] = "Delete"; } -

Delete

-

Are you sure you want to delete this?

Owned machine

@@ -78,15 +76,10 @@ @Html.DisplayFor(model => model.User) - - - - + + + Back to List diff --git a/Marechai/Areas/Admin/Views/OwnedMachine/Details.cshtml b/Marechai/Areas/Admin/Views/OwnedMachine/Details.cshtml index d12ed197..3f257f79 100644 --- a/Marechai/Areas/Admin/Views/OwnedMachine/Details.cshtml +++ b/Marechai/Areas/Admin/Views/OwnedMachine/Details.cshtml @@ -3,9 +3,7 @@ @{ ViewData["Title"] = "Details"; } -

Details

-

Owned machine


@@ -79,13 +77,10 @@
\ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/OwnedMachine/Edit.cshtml b/Marechai/Areas/Admin/Views/OwnedMachine/Edit.cshtml index 93b04e41..c9e5ba2f 100644 --- a/Marechai/Areas/Admin/Views/OwnedMachine/Edit.cshtml +++ b/Marechai/Areas/Admin/Views/OwnedMachine/Edit.cshtml @@ -4,121 +4,86 @@ @{ ViewData["Title"] = "Edit"; } -

Edit

-

Owned machine


-
+
-
-
-
-
-
-
-
- + diff --git a/Marechai/Areas/Admin/Views/OwnedMachine/Index.cshtml b/Marechai/Areas/Admin/Views/OwnedMachine/Index.cshtml index 483110cc..7b708d12 100644 --- a/Marechai/Areas/Admin/Views/OwnedMachine/Index.cshtml +++ b/Marechai/Areas/Admin/Views/OwnedMachine/Index.cshtml @@ -3,9 +3,7 @@ @{ ViewData["Title"] = "Index"; } -

Owned machines

-

Create New

@@ -28,7 +26,8 @@
- @foreach (var item in Model) { + @foreach (var item in Model) + { } -
@@ -67,9 +64,7 @@ @Html.DisplayFor(modelItem => item.AddedId) - + Delete
@Html.DisplayFor(modelItem => item.Machine) @@ -50,4 +49,4 @@
+ \ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/People/Create.cshtml b/Marechai/Areas/Admin/Views/People/Create.cshtml index dd79657e..685638a1 100644 --- a/Marechai/Areas/Admin/Views/People/Create.cshtml +++ b/Marechai/Areas/Admin/Views/People/Create.cshtml @@ -3,122 +3,86 @@ @{ ViewData["Title"] = "Create"; } -

Create

-

Person


-
+
-
-
-
-
-
-
-
-
-
-
diff --git a/Marechai/Areas/Admin/Views/People/Delete.cshtml b/Marechai/Areas/Admin/Views/People/Delete.cshtml index d02c98bb..83d29e0d 100644 --- a/Marechai/Areas/Admin/Views/People/Delete.cshtml +++ b/Marechai/Areas/Admin/Views/People/Delete.cshtml @@ -3,9 +3,7 @@ @{ ViewData["Title"] = "Delete"; } -

Delete

-

Are you sure you want to delete this?

Person

@@ -63,7 +61,7 @@ @Html.DisplayNameFor(model => model.Twitter)
- @if(Model.Twitter != null) + @if (Model.Twitter != null) { @Html.DisplayFor(model => model.Twitter) } @@ -72,21 +70,16 @@ @Html.DisplayNameFor(model => model.Facebook)
- @if(Model.Facebook != null) + @if (Model.Facebook != null) { @Html.DisplayFor(model => model.Facebook) }
- - - - + + + Back to List diff --git a/Marechai/Areas/Admin/Views/People/Details.cshtml b/Marechai/Areas/Admin/Views/People/Details.cshtml index 537ae6fc..26435aaf 100644 --- a/Marechai/Areas/Admin/Views/People/Details.cshtml +++ b/Marechai/Areas/Admin/Views/People/Details.cshtml @@ -3,9 +3,7 @@ @{ ViewData["Title"] = "Details"; } -

Details

-

Person


@@ -62,7 +60,7 @@ @Html.DisplayNameFor(model => model.Twitter)
- @if(Model.Twitter != null) + @if (Model.Twitter != null) { @Html.DisplayFor(model => model.Twitter) } @@ -71,7 +69,7 @@ @Html.DisplayNameFor(model => model.Facebook)
- @if(Model.Facebook != null) + @if (Model.Facebook != null) { @Html.DisplayFor(model => model.Facebook) } @@ -79,13 +77,10 @@
\ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/People/Edit.cshtml b/Marechai/Areas/Admin/Views/People/Edit.cshtml index 1d96271b..0cec0c6f 100644 --- a/Marechai/Areas/Admin/Views/People/Edit.cshtml +++ b/Marechai/Areas/Admin/Views/People/Edit.cshtml @@ -3,124 +3,87 @@ @{ ViewData["Title"] = "Edit"; } -

Edit

-

Person


-
+
-
-
-
-
-
-
-
-
-
-
- + diff --git a/Marechai/Areas/Admin/Views/People/Index.cshtml b/Marechai/Areas/Admin/Views/People/Index.cshtml index d9bb8d21..c8ffb32c 100644 --- a/Marechai/Areas/Admin/Views/People/Index.cshtml +++ b/Marechai/Areas/Admin/Views/People/Index.cshtml @@ -3,41 +3,40 @@ @{ ViewData["Title"] = "People"; } -

People

-

Create New

- - - - - - - - - - + + + + + + + + + + -@foreach (var item in Model) { + @foreach (var item in Model) + { -} + } -
- @Html.DisplayNameFor(model => model.FullName) - - @Html.DisplayNameFor(model => model.CountryOfBirth) - - @Html.DisplayNameFor(model => model.BirthDate) - - @Html.DisplayNameFor(model => model.DeathDate) - - @Html.DisplayNameFor(model => model.Webpage) - - @Html.DisplayNameFor(model => model.Twitter) - - @Html.DisplayNameFor(model => model.Facebook) -
+ @Html.DisplayNameFor(model => model.FullName) + + @Html.DisplayNameFor(model => model.CountryOfBirth) + + @Html.DisplayNameFor(model => model.BirthDate) + + @Html.DisplayNameFor(model => model.DeathDate) + + @Html.DisplayNameFor(model => model.Webpage) + + @Html.DisplayNameFor(model => model.Twitter) + + @Html.DisplayNameFor(model => model.Facebook) +
@Html.DisplayFor(modelItem => item.FullName) @@ -55,13 +54,13 @@ @Html.DisplayFor(modelItem => item.Webpage) - @if(item.Twitter != null) + @if (item.Twitter != null) { @Html.DisplayFor(modelItem => item.Twitter) } - @if(item.Facebook != null) + @if (item.Facebook != null) { @Html.DisplayFor(modelItem => item.Facebook) } @@ -72,6 +71,6 @@ Delete
+ \ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/Processors/Create.cshtml b/Marechai/Areas/Admin/Views/Processors/Create.cshtml index f558ae74..ac078df9 100644 --- a/Marechai/Areas/Admin/Views/Processors/Create.cshtml +++ b/Marechai/Areas/Admin/Views/Processors/Create.cshtml @@ -34,276 +34,195 @@ @{ ViewData["Title"] = "Create"; } -

Create

-

Processor


-
- -
-
-
- - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
- - -
+
+
+
+
+
+ + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+ +
+
@section Scripts { diff --git a/Marechai/Areas/Admin/Views/Processors/Delete.cshtml b/Marechai/Areas/Admin/Views/Processors/Delete.cshtml index 66095529..7470482b 100644 --- a/Marechai/Areas/Admin/Views/Processors/Delete.cshtml +++ b/Marechai/Areas/Admin/Views/Processors/Delete.cshtml @@ -34,9 +34,7 @@ @{ ViewData["Title"] = "Delete"; } -

Delete

-

Are you sure you want to delete this?

Processor

@@ -193,15 +191,10 @@ @Html.DisplayFor(model => model.L3) -
- - - + + + Back to List
diff --git a/Marechai/Areas/Admin/Views/Processors/Details.cshtml b/Marechai/Areas/Admin/Views/Processors/Details.cshtml index 93f3d4d3..081f265c 100644 --- a/Marechai/Areas/Admin/Views/Processors/Details.cshtml +++ b/Marechai/Areas/Admin/Views/Processors/Details.cshtml @@ -34,9 +34,7 @@ @{ ViewData["Title"] = "Details"; } -

Details

-

Processor


@@ -194,13 +192,10 @@
\ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/Processors/Edit.cshtml b/Marechai/Areas/Admin/Views/Processors/Edit.cshtml index a7746670..06f05ff0 100644 --- a/Marechai/Areas/Admin/Views/Processors/Edit.cshtml +++ b/Marechai/Areas/Admin/Views/Processors/Edit.cshtml @@ -34,278 +34,196 @@ @{ ViewData["Title"] = "Edit"; } -

Edit

-

Processor


-
-
-
-
- -
- - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
- -
-
+
+
+
+
+ +
+ + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+ +
+
@section Scripts { diff --git a/Marechai/Areas/Admin/Views/Processors/Index.cshtml b/Marechai/Areas/Admin/Views/Processors/Index.cshtml index 80e83347..cd4666a3 100644 --- a/Marechai/Areas/Admin/Views/Processors/Index.cshtml +++ b/Marechai/Areas/Admin/Views/Processors/Index.cshtml @@ -29,18 +29,14 @@ // Copyright © 2003-2020 Natalia Portillo *******************************************************************************/ } -@using Marechai.Areas.Admin.Models @model IEnumerable @{ ViewData["Title"] = "Processors (Admin)"; } -

Processors

-

- + Create New

@@ -66,7 +62,7 @@ - @foreach(ProcessorViewModel item in Model) + @foreach (var item in Model) { @@ -85,19 +81,13 @@ @Html.DisplayFor(modelItem => item.InstructionSet) - + Details - + Edit - + Delete diff --git a/Marechai/Areas/Admin/Views/ProcessorsByMachines/Create.cshtml b/Marechai/Areas/Admin/Views/ProcessorsByMachines/Create.cshtml index 449ea7c8..a5cc2aca 100644 --- a/Marechai/Areas/Admin/Views/ProcessorsByMachines/Create.cshtml +++ b/Marechai/Areas/Admin/Views/ProcessorsByMachines/Create.cshtml @@ -34,51 +34,36 @@ @{ ViewData["Title"] = "Create"; } -

Create

-

Processor by machine


-
+
-
-
-
diff --git a/Marechai/Areas/Admin/Views/ProcessorsByMachines/Delete.cshtml b/Marechai/Areas/Admin/Views/ProcessorsByMachines/Delete.cshtml index d761ffab..01915175 100644 --- a/Marechai/Areas/Admin/Views/ProcessorsByMachines/Delete.cshtml +++ b/Marechai/Areas/Admin/Views/ProcessorsByMachines/Delete.cshtml @@ -34,9 +34,7 @@ @{ ViewData["Title"] = "Delete"; } -

Delete

-

Are you sure you want to delete this?

Processors by machine

@@ -61,15 +59,10 @@ @Html.DisplayFor(model => model.Speed) - - - - + + + Back to List diff --git a/Marechai/Areas/Admin/Views/ProcessorsByMachines/Details.cshtml b/Marechai/Areas/Admin/Views/ProcessorsByMachines/Details.cshtml index 43a4b377..854acf6b 100644 --- a/Marechai/Areas/Admin/Views/ProcessorsByMachines/Details.cshtml +++ b/Marechai/Areas/Admin/Views/ProcessorsByMachines/Details.cshtml @@ -34,9 +34,7 @@ @{ ViewData["Title"] = "Details"; } -

Details

-

Processors by machine


@@ -62,13 +60,10 @@
\ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/ProcessorsByMachines/Edit.cshtml b/Marechai/Areas/Admin/Views/ProcessorsByMachines/Edit.cshtml index 6d09ac5a..c4d209f6 100644 --- a/Marechai/Areas/Admin/Views/ProcessorsByMachines/Edit.cshtml +++ b/Marechai/Areas/Admin/Views/ProcessorsByMachines/Edit.cshtml @@ -34,59 +34,41 @@ @{ ViewData["Title"] = "Edit"; } -

Edit

-

Processors by machine


-
+
-
-
-
- + diff --git a/Marechai/Areas/Admin/Views/ProcessorsByMachines/Index.cshtml b/Marechai/Areas/Admin/Views/ProcessorsByMachines/Index.cshtml index f406330c..ef2e3193 100644 --- a/Marechai/Areas/Admin/Views/ProcessorsByMachines/Index.cshtml +++ b/Marechai/Areas/Admin/Views/ProcessorsByMachines/Index.cshtml @@ -29,18 +29,14 @@ // Copyright © 2003-2020 Natalia Portillo *******************************************************************************/ } -@using Marechai.Areas.Admin.Models @model IEnumerable @{ ViewData["Title"] = "Processors by machine (Admin)"; } -

Processors by machine

-

- + Create New

@@ -60,7 +56,7 @@ - @foreach(ProcessorsByMachineViewModel item in Model) + @foreach (var item in Model) { @@ -73,19 +69,13 @@ @Html.DisplayFor(modelItem => item.Speed) - + Details - + Edit - + Delete diff --git a/Marechai/Areas/Admin/Views/ProcessorsByOwnedMachines/Create.cshtml b/Marechai/Areas/Admin/Views/ProcessorsByOwnedMachines/Create.cshtml index 03922643..2eee82d4 100644 --- a/Marechai/Areas/Admin/Views/ProcessorsByOwnedMachines/Create.cshtml +++ b/Marechai/Areas/Admin/Views/ProcessorsByOwnedMachines/Create.cshtml @@ -34,51 +34,36 @@ @{ ViewData["Title"] = "Create"; } -

Create

-

Processor by machine


-
+
-
-
-
diff --git a/Marechai/Areas/Admin/Views/ProcessorsByOwnedMachines/Delete.cshtml b/Marechai/Areas/Admin/Views/ProcessorsByOwnedMachines/Delete.cshtml index 84cd40cb..b5ce6d44 100644 --- a/Marechai/Areas/Admin/Views/ProcessorsByOwnedMachines/Delete.cshtml +++ b/Marechai/Areas/Admin/Views/ProcessorsByOwnedMachines/Delete.cshtml @@ -34,9 +34,7 @@ @{ ViewData["Title"] = "Delete"; } -

Delete

-

Are you sure you want to delete this?

Processors by machine

@@ -61,15 +59,10 @@ @Html.DisplayFor(model => model.Speed) - - - - + + + Back to List diff --git a/Marechai/Areas/Admin/Views/ProcessorsByOwnedMachines/Details.cshtml b/Marechai/Areas/Admin/Views/ProcessorsByOwnedMachines/Details.cshtml index 39f3016b..9ccaa51f 100644 --- a/Marechai/Areas/Admin/Views/ProcessorsByOwnedMachines/Details.cshtml +++ b/Marechai/Areas/Admin/Views/ProcessorsByOwnedMachines/Details.cshtml @@ -34,9 +34,7 @@ @{ ViewData["Title"] = "Details"; } -

Details

-

Processors by machine


@@ -62,13 +60,10 @@
\ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/ProcessorsByOwnedMachines/Edit.cshtml b/Marechai/Areas/Admin/Views/ProcessorsByOwnedMachines/Edit.cshtml index 46891732..87168eda 100644 --- a/Marechai/Areas/Admin/Views/ProcessorsByOwnedMachines/Edit.cshtml +++ b/Marechai/Areas/Admin/Views/ProcessorsByOwnedMachines/Edit.cshtml @@ -34,59 +34,41 @@ @{ ViewData["Title"] = "Edit"; } -

Edit

-

Processors by machine


-
+
-
-
-
- + diff --git a/Marechai/Areas/Admin/Views/ProcessorsByOwnedMachines/Index.cshtml b/Marechai/Areas/Admin/Views/ProcessorsByOwnedMachines/Index.cshtml index f406330c..ef2e3193 100644 --- a/Marechai/Areas/Admin/Views/ProcessorsByOwnedMachines/Index.cshtml +++ b/Marechai/Areas/Admin/Views/ProcessorsByOwnedMachines/Index.cshtml @@ -29,18 +29,14 @@ // Copyright © 2003-2020 Natalia Portillo *******************************************************************************/ } -@using Marechai.Areas.Admin.Models @model IEnumerable @{ ViewData["Title"] = "Processors by machine (Admin)"; } -

Processors by machine

-

- + Create New

@@ -60,7 +56,7 @@ - @foreach(ProcessorsByMachineViewModel item in Model) + @foreach (var item in Model) { @@ -73,19 +69,13 @@ @Html.DisplayFor(modelItem => item.Speed) - + Details - + Edit - + Delete diff --git a/Marechai/Areas/Admin/Views/Resolutions/Create.cshtml b/Marechai/Areas/Admin/Views/Resolutions/Create.cshtml index 5f2954fd..f095b508 100644 --- a/Marechai/Areas/Admin/Views/Resolutions/Create.cshtml +++ b/Marechai/Areas/Admin/Views/Resolutions/Create.cshtml @@ -34,55 +34,40 @@ @{ ViewData["Title"] = "Create"; } -

Create

-

Resolution


-
+
-
-
-
-
@@ -100,11 +85,8 @@
diff --git a/Marechai/Areas/Admin/Views/Resolutions/Delete.cshtml b/Marechai/Areas/Admin/Views/Resolutions/Delete.cshtml index 7a10e00b..ea2d3949 100644 --- a/Marechai/Areas/Admin/Views/Resolutions/Delete.cshtml +++ b/Marechai/Areas/Admin/Views/Resolutions/Delete.cshtml @@ -34,9 +34,7 @@ @{ ViewData["Title"] = "Delete"; } -

Delete

-

Are you sure you want to delete this?

Resolution

@@ -79,15 +77,10 @@ @Html.DisplayFor(model => model.Grayscale) - - - - + + + Back to List diff --git a/Marechai/Areas/Admin/Views/Resolutions/Details.cshtml b/Marechai/Areas/Admin/Views/Resolutions/Details.cshtml index b7d0c9d0..076d2b22 100644 --- a/Marechai/Areas/Admin/Views/Resolutions/Details.cshtml +++ b/Marechai/Areas/Admin/Views/Resolutions/Details.cshtml @@ -34,9 +34,7 @@ @{ ViewData["Title"] = "Details"; } -

Details

-

Resolution


@@ -80,13 +78,10 @@
\ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/Resolutions/Edit.cshtml b/Marechai/Areas/Admin/Views/Resolutions/Edit.cshtml index eae43b13..78d419ce 100644 --- a/Marechai/Areas/Admin/Views/Resolutions/Edit.cshtml +++ b/Marechai/Areas/Admin/Views/Resolutions/Edit.cshtml @@ -34,57 +34,41 @@ @{ ViewData["Title"] = "Edit"; } -

Edit

-

Resolution


-
+
- +
-
-
-
-
@@ -102,11 +86,8 @@
diff --git a/Marechai/Areas/Admin/Views/Resolutions/Index.cshtml b/Marechai/Areas/Admin/Views/Resolutions/Index.cshtml index 5879dc86..d2289cf3 100644 --- a/Marechai/Areas/Admin/Views/Resolutions/Index.cshtml +++ b/Marechai/Areas/Admin/Views/Resolutions/Index.cshtml @@ -29,18 +29,14 @@ // Copyright © 2003-2020 Natalia Portillo *******************************************************************************/ } -@using Marechai.Database.Models @model IEnumerable @{ ViewData["Title"] = "Resolutions (Admin)"; } -

Resolutions

-

- + Create New

@@ -54,26 +50,20 @@ - @foreach(Resolution item in Model) + @foreach (var item in Model) { @item.ToString() - + Details - + Edit - + Delete diff --git a/Marechai/Areas/Admin/Views/ResolutionsByGpu/Create.cshtml b/Marechai/Areas/Admin/Views/ResolutionsByGpu/Create.cshtml index ad451b21..694e2c7b 100644 --- a/Marechai/Areas/Admin/Views/ResolutionsByGpu/Create.cshtml +++ b/Marechai/Areas/Admin/Views/ResolutionsByGpu/Create.cshtml @@ -3,47 +3,33 @@ @{ ViewData["Title"] = "Create"; } -

Create

-

Resolutions by GPU


-
+
-
-
diff --git a/Marechai/Areas/Admin/Views/ResolutionsByGpu/Delete.cshtml b/Marechai/Areas/Admin/Views/ResolutionsByGpu/Delete.cshtml index c4ca2c03..20f0b602 100644 --- a/Marechai/Areas/Admin/Views/ResolutionsByGpu/Delete.cshtml +++ b/Marechai/Areas/Admin/Views/ResolutionsByGpu/Delete.cshtml @@ -3,9 +3,7 @@ @{ ViewData["Title"] = "Delete"; } -

Delete

-

Are you sure you want to delete this?

Resolution by GPU

@@ -24,15 +22,10 @@ @Model.Resolution.ToString() - - - - + + + Back to List diff --git a/Marechai/Areas/Admin/Views/ResolutionsByGpu/Details.cshtml b/Marechai/Areas/Admin/Views/ResolutionsByGpu/Details.cshtml index 4f1adfd3..55499aa8 100644 --- a/Marechai/Areas/Admin/Views/ResolutionsByGpu/Details.cshtml +++ b/Marechai/Areas/Admin/Views/ResolutionsByGpu/Details.cshtml @@ -3,9 +3,7 @@ @{ ViewData["Title"] = "Details"; } -

Details

-

Resolution by GPU


@@ -25,13 +23,10 @@
\ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/ResolutionsByGpu/Edit.cshtml b/Marechai/Areas/Admin/Views/ResolutionsByGpu/Edit.cshtml index ce99d1ed..2a7a29e8 100644 --- a/Marechai/Areas/Admin/Views/ResolutionsByGpu/Edit.cshtml +++ b/Marechai/Areas/Admin/Views/ResolutionsByGpu/Edit.cshtml @@ -3,49 +3,34 @@ @{ ViewData["Title"] = "Edit"; } -

Edit

-

Resolution by GPU


-
+
-
-
- + diff --git a/Marechai/Areas/Admin/Views/ResolutionsByGpu/Index.cshtml b/Marechai/Areas/Admin/Views/ResolutionsByGpu/Index.cshtml index 062dde3c..ca749619 100644 --- a/Marechai/Areas/Admin/Views/ResolutionsByGpu/Index.cshtml +++ b/Marechai/Areas/Admin/Views/ResolutionsByGpu/Index.cshtml @@ -1,15 +1,11 @@ -@using Marechai.Areas.Admin.Models @model IEnumerable @{ ViewData["Title"] = "Index"; } -

Resolutions by GPU

-

- + Create New

@@ -26,7 +22,7 @@ - @foreach(ResolutionsByGpuViewModel item in Model) + @foreach (var item in Model) { @@ -37,19 +33,13 @@ @item.Resolution - + Details - + Edit - + Delete diff --git a/Marechai/Areas/Admin/Views/ResolutionsByScreen/Create.cshtml b/Marechai/Areas/Admin/Views/ResolutionsByScreen/Create.cshtml index 5c05f280..43ad6b4f 100644 --- a/Marechai/Areas/Admin/Views/ResolutionsByScreen/Create.cshtml +++ b/Marechai/Areas/Admin/Views/ResolutionsByScreen/Create.cshtml @@ -3,47 +3,33 @@ @{ ViewData["Title"] = "Create"; } -

Create

-

Resolutions by screen


-
+
-
-
diff --git a/Marechai/Areas/Admin/Views/ResolutionsByScreen/Delete.cshtml b/Marechai/Areas/Admin/Views/ResolutionsByScreen/Delete.cshtml index b3689a7f..d4878ff2 100644 --- a/Marechai/Areas/Admin/Views/ResolutionsByScreen/Delete.cshtml +++ b/Marechai/Areas/Admin/Views/ResolutionsByScreen/Delete.cshtml @@ -3,9 +3,7 @@ @{ ViewData["Title"] = "Delete"; } -

Delete

-

Are you sure you want to delete this?

Resolutions by screen

@@ -15,9 +13,14 @@ @Html.DisplayNameFor(model => model.Screen)
- @if(Model.Screen.NativeResolution != null) { @($"{Model.Screen.Diagonal}\" {Model.Screen.Type} with {Model.Screen.NativeResolution}") } + @if (Model.Screen.NativeResolution != null) + { + @($"{Model.Screen.Diagonal}\" {Model.Screen.Type} with {Model.Screen.NativeResolution}") + } else - { @($"{Model.Screen.Diagonal}\" {Model.Screen.Type}") } + { + @($"{Model.Screen.Diagonal}\" {Model.Screen.Type}") + }
@Html.DisplayNameFor(model => model.Resolution) @@ -26,15 +29,10 @@ @Model.Resolution.ToString() - - - - + + + Back to List
diff --git a/Marechai/Areas/Admin/Views/ResolutionsByScreen/Details.cshtml b/Marechai/Areas/Admin/Views/ResolutionsByScreen/Details.cshtml index 0dfd8414..67cac630 100644 --- a/Marechai/Areas/Admin/Views/ResolutionsByScreen/Details.cshtml +++ b/Marechai/Areas/Admin/Views/ResolutionsByScreen/Details.cshtml @@ -3,9 +3,7 @@ @{ ViewData["Title"] = "Details"; } -

Details

-

Resolutions by screen


@@ -14,9 +12,14 @@ @Html.DisplayNameFor(model => model.Screen)
- @if(Model.Screen.NativeResolution != null) { @($"{Model.Screen.Diagonal}\" {Model.Screen.Type} with {Model.Screen.NativeResolution}") } + @if (Model.Screen.NativeResolution != null) + { + @($"{Model.Screen.Diagonal}\" {Model.Screen.Type} with {Model.Screen.NativeResolution}") + } else - { @($"{Model.Screen.Diagonal}\" {Model.Screen.Type}") } + { + @($"{Model.Screen.Diagonal}\" {Model.Screen.Type}") + }
@Html.DisplayNameFor(model => model.Resolution) @@ -27,13 +30,10 @@
\ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/ResolutionsByScreen/Edit.cshtml b/Marechai/Areas/Admin/Views/ResolutionsByScreen/Edit.cshtml index af83c8b6..8ad505f7 100644 --- a/Marechai/Areas/Admin/Views/ResolutionsByScreen/Edit.cshtml +++ b/Marechai/Areas/Admin/Views/ResolutionsByScreen/Edit.cshtml @@ -3,48 +3,34 @@ @{ ViewData["Title"] = "Edit"; } -

Edit

-

Resolutions by screen


-
+
-
-
- +
diff --git a/Marechai/Areas/Admin/Views/ResolutionsByScreen/Index.cshtml b/Marechai/Areas/Admin/Views/ResolutionsByScreen/Index.cshtml index 3c1f600c..a9430892 100644 --- a/Marechai/Areas/Admin/Views/ResolutionsByScreen/Index.cshtml +++ b/Marechai/Areas/Admin/Views/ResolutionsByScreen/Index.cshtml @@ -1,15 +1,11 @@ -@using Marechai.Database.Models @model IEnumerable @{ ViewData["Title"] = "Index"; } -

Resolutions by screen

-

- + Create New

@@ -26,31 +22,30 @@ - @foreach(ResolutionsByScreen item in Model) + @foreach (var item in Model) { - @if(item.Screen.NativeResolution != null) { @($"{item.Screen.Diagonal}\" {item.Screen.Type} with {item.Screen.NativeResolution}") } + @if (item.Screen.NativeResolution != null) + { + @($"{item.Screen.Diagonal}\" {item.Screen.Type} with {item.Screen.NativeResolution}") + } else - { @($"{item.Screen.Diagonal}\" {item.Screen.Type}") } + { + @($"{item.Screen.Diagonal}\" {item.Screen.Type}") + } @item.Resolution.ToString() - + Details - + Edit - + Delete diff --git a/Marechai/Areas/Admin/Views/Screens/Create.cshtml b/Marechai/Areas/Admin/Views/Screens/Create.cshtml index d6a52703..ff25df67 100644 --- a/Marechai/Areas/Admin/Views/Screens/Create.cshtml +++ b/Marechai/Areas/Admin/Views/Screens/Create.cshtml @@ -3,85 +3,60 @@ @{ ViewData["Title"] = "Create"; } -

Create

-

Screen


-
+
-
-
-
-
-
-
diff --git a/Marechai/Areas/Admin/Views/Screens/Delete.cshtml b/Marechai/Areas/Admin/Views/Screens/Delete.cshtml index aeb8f05f..f3d88efb 100644 --- a/Marechai/Areas/Admin/Views/Screens/Delete.cshtml +++ b/Marechai/Areas/Admin/Views/Screens/Delete.cshtml @@ -3,9 +3,7 @@ @{ ViewData["Title"] = "Delete"; } -

Delete

-

Are you sure you want to delete this?

Screen

@@ -42,15 +40,10 @@ @Html.DisplayFor(model => model.Type) - - - - + + + Back to List diff --git a/Marechai/Areas/Admin/Views/Screens/Details.cshtml b/Marechai/Areas/Admin/Views/Screens/Details.cshtml index 30059e19..74bdc14d 100644 --- a/Marechai/Areas/Admin/Views/Screens/Details.cshtml +++ b/Marechai/Areas/Admin/Views/Screens/Details.cshtml @@ -3,9 +3,7 @@ @{ ViewData["Title"] = "Details"; } -

Details

-

Screen


@@ -43,13 +41,10 @@
\ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/Screens/Edit.cshtml b/Marechai/Areas/Admin/Views/Screens/Edit.cshtml index dc96eb68..a20aa0d5 100644 --- a/Marechai/Areas/Admin/Views/Screens/Edit.cshtml +++ b/Marechai/Areas/Admin/Views/Screens/Edit.cshtml @@ -3,88 +3,61 @@ @{ ViewData["Title"] = "Edit"; } -

Edit

-

Screen


-
+
-
-
-
-
-
-
- + diff --git a/Marechai/Areas/Admin/Views/Screens/Index.cshtml b/Marechai/Areas/Admin/Views/Screens/Index.cshtml index c71bf652..3a606fab 100644 --- a/Marechai/Areas/Admin/Views/Screens/Index.cshtml +++ b/Marechai/Areas/Admin/Views/Screens/Index.cshtml @@ -1,15 +1,11 @@ -@using Marechai.Database.Models @model IEnumerable @{ ViewData["Title"] = "Index"; } -

Screens

-

- + Create New

@@ -32,7 +28,7 @@ - @foreach(Screen item in Model) + @foreach (var item in Model) { @@ -48,19 +44,13 @@ @Html.DisplayFor(modelItem => item.Type) - + Details - + Edit - + Delete diff --git a/Marechai/Areas/Admin/Views/ScreensByMachine/Create.cshtml b/Marechai/Areas/Admin/Views/ScreensByMachine/Create.cshtml index 792503c0..9ea7d4a9 100644 --- a/Marechai/Areas/Admin/Views/ScreensByMachine/Create.cshtml +++ b/Marechai/Areas/Admin/Views/ScreensByMachine/Create.cshtml @@ -3,47 +3,33 @@ @{ ViewData["Title"] = "Create"; } -

Create

-

Screens by machine


-
+
-
-
diff --git a/Marechai/Areas/Admin/Views/ScreensByMachine/Delete.cshtml b/Marechai/Areas/Admin/Views/ScreensByMachine/Delete.cshtml index bab7aa0f..17f68282 100644 --- a/Marechai/Areas/Admin/Views/ScreensByMachine/Delete.cshtml +++ b/Marechai/Areas/Admin/Views/ScreensByMachine/Delete.cshtml @@ -3,9 +3,7 @@ @{ ViewData["Title"] = "Delete"; } -

Delete

-

Are you sure you want to delete this?

Screens by machine

@@ -24,15 +22,10 @@ @Html.DisplayFor(model => model.Machine) - - - - + + + Back to List diff --git a/Marechai/Areas/Admin/Views/ScreensByMachine/Details.cshtml b/Marechai/Areas/Admin/Views/ScreensByMachine/Details.cshtml index 3fa6bdba..32cb2005 100644 --- a/Marechai/Areas/Admin/Views/ScreensByMachine/Details.cshtml +++ b/Marechai/Areas/Admin/Views/ScreensByMachine/Details.cshtml @@ -3,9 +3,7 @@ @{ ViewData["Title"] = "Details"; } -

Details

-

Screens by machine


@@ -25,13 +23,10 @@
\ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/ScreensByMachine/Edit.cshtml b/Marechai/Areas/Admin/Views/ScreensByMachine/Edit.cshtml index 43a6e739..99d0b75c 100644 --- a/Marechai/Areas/Admin/Views/ScreensByMachine/Edit.cshtml +++ b/Marechai/Areas/Admin/Views/ScreensByMachine/Edit.cshtml @@ -3,53 +3,38 @@ @{ ViewData["Title"] = "Edit"; } -

Edit

-

Screens by machine


-
+
-
-
- +
-
diff --git a/Marechai/Areas/Admin/Views/ScreensByMachine/Index.cshtml b/Marechai/Areas/Admin/Views/ScreensByMachine/Index.cshtml index 24c354ca..787e34f8 100644 --- a/Marechai/Areas/Admin/Views/ScreensByMachine/Index.cshtml +++ b/Marechai/Areas/Admin/Views/ScreensByMachine/Index.cshtml @@ -1,15 +1,11 @@ -@using Marechai.Areas.Admin.Models @model IEnumerable @{ ViewData["Title"] = "Index"; } -

Screens by machine

-

- + Create New

@@ -26,7 +22,7 @@ - @foreach(ScreensByMachineViewModel item in Model) + @foreach (var item in Model) { @@ -36,19 +32,13 @@ @Html.DisplayFor(modelItem => item.Machine) - + Details - + Edit - + Delete diff --git a/Marechai/Areas/Admin/Views/SoundByMachine/Create.cshtml b/Marechai/Areas/Admin/Views/SoundByMachine/Create.cshtml index 2d3bd9ba..2cbe0c2a 100644 --- a/Marechai/Areas/Admin/Views/SoundByMachine/Create.cshtml +++ b/Marechai/Areas/Admin/Views/SoundByMachine/Create.cshtml @@ -3,9 +3,7 @@ @{ ViewData["Title"] = "Create"; } -

Create

-

Sound by machine


@@ -14,17 +12,16 @@
- +
- +
-
- +
\ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/SoundByMachine/Delete.cshtml b/Marechai/Areas/Admin/Views/SoundByMachine/Delete.cshtml index b794a30b..9572e55d 100644 --- a/Marechai/Areas/Admin/Views/SoundByMachine/Delete.cshtml +++ b/Marechai/Areas/Admin/Views/SoundByMachine/Delete.cshtml @@ -3,31 +3,28 @@ @{ ViewData["Title"] = "Delete"; } -

Delete

-

Are you sure you want to delete this?

Sound by machine


-
+
@Html.DisplayNameFor(model => model.Machine)
-
+
@Html.DisplayFor(model => model.Machine.Name)
-
+
@Html.DisplayNameFor(model => model.SoundSynth)
-
+
@Html.DisplayFor(model => model.SoundSynth.Name)
-
- + Back to List
-
+
\ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/SoundByMachine/Details.cshtml b/Marechai/Areas/Admin/Views/SoundByMachine/Details.cshtml index 6b3b4e9c..0983aa93 100644 --- a/Marechai/Areas/Admin/Views/SoundByMachine/Details.cshtml +++ b/Marechai/Areas/Admin/Views/SoundByMachine/Details.cshtml @@ -3,23 +3,21 @@ @{ ViewData["Title"] = "Details"; } -

Details

-

Sound by machine


-
+
@Html.DisplayNameFor(model => model.Machine)
-
+
@Html.DisplayFor(model => model.Machine.Name)
-
+
@Html.DisplayNameFor(model => model.SoundSynth)
-
+
@Html.DisplayFor(model => model.SoundSynth.Name)
@@ -27,4 +25,4 @@ +
\ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/SoundByMachine/Edit.cshtml b/Marechai/Areas/Admin/Views/SoundByMachine/Edit.cshtml index eb1bf784..03abc662 100644 --- a/Marechai/Areas/Admin/Views/SoundByMachine/Edit.cshtml +++ b/Marechai/Areas/Admin/Views/SoundByMachine/Edit.cshtml @@ -3,9 +3,7 @@ @{ ViewData["Title"] = "Edit"; } -

Edit

-

Sound by machine


@@ -24,10 +22,9 @@
-
- +
\ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/SoundByMachine/Index.cshtml b/Marechai/Areas/Admin/Views/SoundByMachine/Index.cshtml index 86953b29..e0b95556 100644 --- a/Marechai/Areas/Admin/Views/SoundByMachine/Index.cshtml +++ b/Marechai/Areas/Admin/Views/SoundByMachine/Index.cshtml @@ -1,15 +1,11 @@ -@using Marechai.Areas.Admin.Models @model IEnumerable @{ ViewData["Title"] = "Index"; } -

Sound synthetizers by machine

-

- + Create New

@@ -26,7 +22,7 @@ - @foreach(SoundByMachineViewModel item in Model) + @foreach (var item in Model) { @@ -36,19 +32,13 @@ @Html.DisplayFor(modelItem => item.SoundSynth) - + Details - + Edit - + Delete diff --git a/Marechai/Areas/Admin/Views/SoundByOwnedMachine/Create.cshtml b/Marechai/Areas/Admin/Views/SoundByOwnedMachine/Create.cshtml index ab3529ed..e7fcbc2d 100644 --- a/Marechai/Areas/Admin/Views/SoundByOwnedMachine/Create.cshtml +++ b/Marechai/Areas/Admin/Views/SoundByOwnedMachine/Create.cshtml @@ -3,41 +3,29 @@ @{ ViewData["Title"] = "Create"; } -

Create

-

Sound by machine


-
+
-
-
diff --git a/Marechai/Areas/Admin/Views/SoundByOwnedMachine/Delete.cshtml b/Marechai/Areas/Admin/Views/SoundByOwnedMachine/Delete.cshtml index 4a1afa84..56eb2ea2 100644 --- a/Marechai/Areas/Admin/Views/SoundByOwnedMachine/Delete.cshtml +++ b/Marechai/Areas/Admin/Views/SoundByOwnedMachine/Delete.cshtml @@ -3,9 +3,7 @@ @{ ViewData["Title"] = "Delete"; } -

Delete

-

Are you sure you want to delete this?

Sound by machine

@@ -24,15 +22,10 @@ @Html.DisplayFor(model => model.SoundSynth) - - - - + + + Back to List diff --git a/Marechai/Areas/Admin/Views/SoundByOwnedMachine/Details.cshtml b/Marechai/Areas/Admin/Views/SoundByOwnedMachine/Details.cshtml index aba05415..6a980e5b 100644 --- a/Marechai/Areas/Admin/Views/SoundByOwnedMachine/Details.cshtml +++ b/Marechai/Areas/Admin/Views/SoundByOwnedMachine/Details.cshtml @@ -3,9 +3,7 @@ @{ ViewData["Title"] = "Details"; } -

Details

-

Sound by machine


@@ -25,13 +23,10 @@
\ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/SoundByOwnedMachine/Edit.cshtml b/Marechai/Areas/Admin/Views/SoundByOwnedMachine/Edit.cshtml index 8238077f..c1588d0e 100644 --- a/Marechai/Areas/Admin/Views/SoundByOwnedMachine/Edit.cshtml +++ b/Marechai/Areas/Admin/Views/SoundByOwnedMachine/Edit.cshtml @@ -3,49 +3,34 @@ @{ ViewData["Title"] = "Edit"; } -

Edit

-

Sound by machine


-
+
-
-
- + diff --git a/Marechai/Areas/Admin/Views/SoundByOwnedMachine/Index.cshtml b/Marechai/Areas/Admin/Views/SoundByOwnedMachine/Index.cshtml index 86953b29..e0b95556 100644 --- a/Marechai/Areas/Admin/Views/SoundByOwnedMachine/Index.cshtml +++ b/Marechai/Areas/Admin/Views/SoundByOwnedMachine/Index.cshtml @@ -1,15 +1,11 @@ -@using Marechai.Areas.Admin.Models @model IEnumerable @{ ViewData["Title"] = "Index"; } -

Sound synthetizers by machine

-

- + Create New

@@ -26,7 +22,7 @@ - @foreach(SoundByMachineViewModel item in Model) + @foreach (var item in Model) { @@ -36,19 +32,13 @@ @Html.DisplayFor(modelItem => item.SoundSynth) - + Details - + Edit - + Delete diff --git a/Marechai/Areas/Admin/Views/SoundSynths/Create.cshtml b/Marechai/Areas/Admin/Views/SoundSynths/Create.cshtml index 65247eea..45b07193 100644 --- a/Marechai/Areas/Admin/Views/SoundSynths/Create.cshtml +++ b/Marechai/Areas/Admin/Views/SoundSynths/Create.cshtml @@ -34,122 +34,86 @@ @{ ViewData["Title"] = "Create"; } -

Create

-

Sound synthetizer


-
+
-
-
-
-
-
-
-
-
-
-
diff --git a/Marechai/Areas/Admin/Views/SoundSynths/Delete.cshtml b/Marechai/Areas/Admin/Views/SoundSynths/Delete.cshtml index e0088a6b..06cdafb6 100644 --- a/Marechai/Areas/Admin/Views/SoundSynths/Delete.cshtml +++ b/Marechai/Areas/Admin/Views/SoundSynths/Delete.cshtml @@ -34,9 +34,7 @@ @{ ViewData["Title"] = "Delete"; } -

Delete

-

Are you sure you want to delete this?

Sound synthetizer

@@ -103,15 +101,10 @@ @Html.DisplayFor(model => model.WhiteNoise) - - - - + + + Back to List diff --git a/Marechai/Areas/Admin/Views/SoundSynths/Details.cshtml b/Marechai/Areas/Admin/Views/SoundSynths/Details.cshtml index 596042b9..bc866342 100644 --- a/Marechai/Areas/Admin/Views/SoundSynths/Details.cshtml +++ b/Marechai/Areas/Admin/Views/SoundSynths/Details.cshtml @@ -34,9 +34,7 @@ @{ ViewData["Title"] = "Details"; } -

Details

-

Sound synthetizer


@@ -104,13 +102,10 @@
\ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/SoundSynths/Edit.cshtml b/Marechai/Areas/Admin/Views/SoundSynths/Edit.cshtml index bc2053ba..db1e6884 100644 --- a/Marechai/Areas/Admin/Views/SoundSynths/Edit.cshtml +++ b/Marechai/Areas/Admin/Views/SoundSynths/Edit.cshtml @@ -34,127 +34,89 @@ @{ ViewData["Title"] = "Edit"; } -

Edit

-

Sound synthetizer


-
+
- +
-
-
-
-
-
-
-
-
-
-
diff --git a/Marechai/Areas/Admin/Views/SoundSynths/Index.cshtml b/Marechai/Areas/Admin/Views/SoundSynths/Index.cshtml index 5e83bb8e..ca5b0dfd 100644 --- a/Marechai/Areas/Admin/Views/SoundSynths/Index.cshtml +++ b/Marechai/Areas/Admin/Views/SoundSynths/Index.cshtml @@ -29,18 +29,14 @@ // Copyright © 2003-2020 Natalia Portillo *******************************************************************************/ } -@using Marechai.Areas.Admin.Models @model IEnumerable @{ ViewData["Title"] = "Sound synthetizers (Admin)"; } -

Sound synthetizers

-

- + Create New

@@ -66,7 +62,7 @@ - @foreach(SoundSynthViewModel item in Model) + @foreach (var item in Model) { @@ -85,19 +81,13 @@ @Html.DisplayFor(modelItem => item.Type) - + Details - + Edit - + Delete diff --git a/Marechai/Areas/Admin/Views/StorageByMachines/Create.cshtml b/Marechai/Areas/Admin/Views/StorageByMachines/Create.cshtml index bdccc157..168d1a6c 100644 --- a/Marechai/Areas/Admin/Views/StorageByMachines/Create.cshtml +++ b/Marechai/Areas/Admin/Views/StorageByMachines/Create.cshtml @@ -35,66 +35,46 @@ @{ ViewData["Title"] = "Create"; } -

Create

-

Storage by machine


-
+
-
-
-
-
diff --git a/Marechai/Areas/Admin/Views/StorageByMachines/Delete.cshtml b/Marechai/Areas/Admin/Views/StorageByMachines/Delete.cshtml index 8d5d6e01..875032b1 100644 --- a/Marechai/Areas/Admin/Views/StorageByMachines/Delete.cshtml +++ b/Marechai/Areas/Admin/Views/StorageByMachines/Delete.cshtml @@ -34,9 +34,7 @@ @{ ViewData["Title"] = "Delete"; } -

Delete

-

Are you sure you want to delete this?

Storage by machine

@@ -67,15 +65,10 @@ @Html.DisplayFor(model => model.Machine.Name) - - - - + + + Back to List diff --git a/Marechai/Areas/Admin/Views/StorageByMachines/Details.cshtml b/Marechai/Areas/Admin/Views/StorageByMachines/Details.cshtml index 7ac0f061..5cee3173 100644 --- a/Marechai/Areas/Admin/Views/StorageByMachines/Details.cshtml +++ b/Marechai/Areas/Admin/Views/StorageByMachines/Details.cshtml @@ -34,9 +34,7 @@ @{ ViewData["Title"] = "Details"; } -

Details

-

Storage by machine


@@ -70,4 +68,4 @@ +
\ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/StorageByMachines/Edit.cshtml b/Marechai/Areas/Admin/Views/StorageByMachines/Edit.cshtml index a27f9eba..67070f37 100644 --- a/Marechai/Areas/Admin/Views/StorageByMachines/Edit.cshtml +++ b/Marechai/Areas/Admin/Views/StorageByMachines/Edit.cshtml @@ -35,71 +35,49 @@ @{ ViewData["Title"] = "Edit"; } -

Edit

-

Storage by machine


-
+
-
-
-
-
- + diff --git a/Marechai/Areas/Admin/Views/StorageByMachines/Index.cshtml b/Marechai/Areas/Admin/Views/StorageByMachines/Index.cshtml index 0815c232..e3886539 100644 --- a/Marechai/Areas/Admin/Views/StorageByMachines/Index.cshtml +++ b/Marechai/Areas/Admin/Views/StorageByMachines/Index.cshtml @@ -29,18 +29,14 @@ // Copyright © 2003-2020 Natalia Portillo *******************************************************************************/ } -@using Marechai.Areas.Admin.Models @model IEnumerable @{ ViewData["Title"] = "Storage by machines (Admin)"; } -

Storage by machines

-

- + Create New

@@ -66,7 +62,7 @@ - @foreach(StorageByMachineViewModel item in Model) + @foreach (var item in Model) { @@ -85,19 +81,13 @@ @Html.DisplayFor(modelItem => item.Capacity) - + Details - + Edit - + Delete diff --git a/Marechai/Areas/Admin/Views/StorageByOwnedMachines/Create.cshtml b/Marechai/Areas/Admin/Views/StorageByOwnedMachines/Create.cshtml index 3febe633..8a50c1a4 100644 --- a/Marechai/Areas/Admin/Views/StorageByOwnedMachines/Create.cshtml +++ b/Marechai/Areas/Admin/Views/StorageByOwnedMachines/Create.cshtml @@ -35,66 +35,46 @@ @{ ViewData["Title"] = "Create"; } -

Create

-

Storage by machine


-
+
-
-
-
-
diff --git a/Marechai/Areas/Admin/Views/StorageByOwnedMachines/Delete.cshtml b/Marechai/Areas/Admin/Views/StorageByOwnedMachines/Delete.cshtml index 584d7edb..0eaf82aa 100644 --- a/Marechai/Areas/Admin/Views/StorageByOwnedMachines/Delete.cshtml +++ b/Marechai/Areas/Admin/Views/StorageByOwnedMachines/Delete.cshtml @@ -34,9 +34,7 @@ @{ ViewData["Title"] = "Delete"; } -

Delete

-

Are you sure you want to delete this?

Storage by machine

@@ -67,15 +65,10 @@ @Html.DisplayFor(model => model.Machine) - - - - + + + Back to List diff --git a/Marechai/Areas/Admin/Views/StorageByOwnedMachines/Details.cshtml b/Marechai/Areas/Admin/Views/StorageByOwnedMachines/Details.cshtml index 68f38929..64bcfb19 100644 --- a/Marechai/Areas/Admin/Views/StorageByOwnedMachines/Details.cshtml +++ b/Marechai/Areas/Admin/Views/StorageByOwnedMachines/Details.cshtml @@ -34,9 +34,7 @@ @{ ViewData["Title"] = "Details"; } -

Details

-

Storage by machine


@@ -68,13 +66,10 @@
\ No newline at end of file diff --git a/Marechai/Areas/Admin/Views/StorageByOwnedMachines/Edit.cshtml b/Marechai/Areas/Admin/Views/StorageByOwnedMachines/Edit.cshtml index 51a0e053..fa4f5fea 100644 --- a/Marechai/Areas/Admin/Views/StorageByOwnedMachines/Edit.cshtml +++ b/Marechai/Areas/Admin/Views/StorageByOwnedMachines/Edit.cshtml @@ -35,71 +35,49 @@ @{ ViewData["Title"] = "Edit"; } -

Edit

-

Storage by machine


-
+
-
-
-
-
- + diff --git a/Marechai/Areas/Admin/Views/StorageByOwnedMachines/Index.cshtml b/Marechai/Areas/Admin/Views/StorageByOwnedMachines/Index.cshtml index 0815c232..e3886539 100644 --- a/Marechai/Areas/Admin/Views/StorageByOwnedMachines/Index.cshtml +++ b/Marechai/Areas/Admin/Views/StorageByOwnedMachines/Index.cshtml @@ -29,18 +29,14 @@ // Copyright © 2003-2020 Natalia Portillo *******************************************************************************/ } -@using Marechai.Areas.Admin.Models @model IEnumerable @{ ViewData["Title"] = "Storage by machines (Admin)"; } -

Storage by machines

-

- + Create New

@@ -66,7 +62,7 @@ - @foreach(StorageByMachineViewModel item in Model) + @foreach (var item in Model) { @@ -85,19 +81,13 @@ @Html.DisplayFor(modelItem => item.Capacity) - + Details - + Edit - + Delete diff --git a/Marechai/Areas/Api/Controllers/CompaniesController.cs b/Marechai/Areas/Api/Controllers/CompaniesController.cs index 9e995ae9..644bd223 100644 --- a/Marechai/Areas/Api/Controllers/CompaniesController.cs +++ b/Marechai/Areas/Api/Controllers/CompaniesController.cs @@ -35,33 +35,28 @@ using Microsoft.AspNetCore.Mvc; namespace Marechai.Areas.Api.Controllers { - [Route("api/[controller]")] - [ApiController] + [Route("api/[controller]"), ApiController] public class CompaniesController : ControllerBase { readonly MarechaiContext _context; - public CompaniesController(MarechaiContext context) - { - _context = context; - } + public CompaniesController(MarechaiContext context) => _context = context; // GET: api/Companies [HttpGet] - public IEnumerable GetCompanies() - { - return _context.Companies; - } + public IEnumerable GetCompanies() => _context.Companies; // GET: api/Companies/5 [HttpGet("{id}")] public async Task GetCompany([FromRoute] int id) { - if(!ModelState.IsValid) return BadRequest(ModelState); + if(!ModelState.IsValid) + return BadRequest(ModelState); Company company = await _context.Companies.FindAsync(id); - if(company == null) return NotFound(); + if(company == null) + return NotFound(); return Ok(company); } diff --git a/Marechai/Areas/Api/Controllers/MachinesController.cs b/Marechai/Areas/Api/Controllers/MachinesController.cs index f5074212..190e1e55 100644 --- a/Marechai/Areas/Api/Controllers/MachinesController.cs +++ b/Marechai/Areas/Api/Controllers/MachinesController.cs @@ -35,33 +35,28 @@ using Microsoft.AspNetCore.Mvc; namespace Marechai.Areas.Api.Controllers { - [Route("api/[controller]")] - [ApiController] + [Route("api/[controller]"), ApiController] public class MachinesController : ControllerBase { readonly MarechaiContext _context; - public MachinesController(MarechaiContext context) - { - _context = context; - } + public MachinesController(MarechaiContext context) => _context = context; // GET: api/Machines [HttpGet] - public IEnumerable GetMachines() - { - return _context.Machines; - } + public IEnumerable GetMachines() => _context.Machines; // GET: api/Machines/5 [HttpGet("{id}")] public async Task GetMachine([FromRoute] int id) { - if(!ModelState.IsValid) return BadRequest(ModelState); + if(!ModelState.IsValid) + return BadRequest(ModelState); Machine machine = await _context.Machines.FindAsync(id); - if(machine == null) return NotFound(); + if(machine == null) + return NotFound(); return Ok(machine); } diff --git a/Marechai/Areas/Api/Controllers/NewsController.cs b/Marechai/Areas/Api/Controllers/NewsController.cs index b7dca708..eb372415 100644 --- a/Marechai/Areas/Api/Controllers/NewsController.cs +++ b/Marechai/Areas/Api/Controllers/NewsController.cs @@ -35,33 +35,28 @@ using Microsoft.AspNetCore.Mvc; namespace Marechai.Areas.Api.Controllers { - [Route("api/[controller]")] - [ApiController] + [Route("api/[controller]"), ApiController] public class NewsController : ControllerBase { readonly MarechaiContext _context; - public NewsController(MarechaiContext context) - { - _context = context; - } + public NewsController(MarechaiContext context) => _context = context; // GET: api/News [HttpGet] - public IEnumerable GetNews() - { - return _context.News; - } + public IEnumerable GetNews() => _context.News; // GET: api/News/5 [HttpGet("{id}")] public async Task GetNews([FromRoute] int id) { - if(!ModelState.IsValid) return BadRequest(ModelState); + if(!ModelState.IsValid) + return BadRequest(ModelState); News news = await _context.News.FindAsync(id); - if(news == null) return NotFound(); + if(news == null) + return NotFound(); return Ok(news); } diff --git a/Marechai/Areas/Identity/IdentityHostingStartup.cs b/Marechai/Areas/Identity/IdentityHostingStartup.cs index e1d45987..f48af3db 100644 --- a/Marechai/Areas/Identity/IdentityHostingStartup.cs +++ b/Marechai/Areas/Identity/IdentityHostingStartup.cs @@ -28,8 +28,8 @@ // Copyright © 2003-2020 Natalia Portillo *******************************************************************************/ -using Marechai.Database.Models; using Marechai.Areas.Identity; +using Marechai.Database.Models; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.DependencyInjection; @@ -39,13 +39,9 @@ namespace Marechai.Areas.Identity { public class IdentityHostingStartup : IHostingStartup { - public void Configure(IWebHostBuilder builder) + public void Configure(IWebHostBuilder builder) => builder.ConfigureServices((context, services) => { - builder.ConfigureServices((context, services) => - { - services.AddDefaultIdentity() - .AddEntityFrameworkStores(); - }); - } + services.AddDefaultIdentity().AddEntityFrameworkStores(); + }); } } \ No newline at end of file diff --git a/Marechai/Areas/Identity/Pages/_ValidationScriptsPartial.cshtml b/Marechai/Areas/Identity/Pages/_ValidationScriptsPartial.cshtml index 735f7d62..f8bf23fe 100644 --- a/Marechai/Areas/Identity/Pages/_ValidationScriptsPartial.cshtml +++ b/Marechai/Areas/Identity/Pages/_ValidationScriptsPartial.cshtml @@ -1,5 +1,5 @@ @{ -/****************************************************************************** + /****************************************************************************** // MARECHAI: Master repository of computing history artifacts information // ---------------------------------------------------------------------------- // @@ -34,16 +34,8 @@ - - \ No newline at end of file diff --git a/Marechai/Areas/Identity/Pages/_ViewStart.cshtml b/Marechai/Areas/Identity/Pages/_ViewStart.cshtml index ae482b96..e818fbfe 100644 --- a/Marechai/Areas/Identity/Pages/_ViewStart.cshtml +++ b/Marechai/Areas/Identity/Pages/_ViewStart.cshtml @@ -1,5 +1,5 @@ @{ -/****************************************************************************** + /****************************************************************************** // MARECHAI: Master repository of computing history artifacts information // ---------------------------------------------------------------------------- // diff --git a/Marechai/Controllers/CompanyController.cs b/Marechai/Controllers/CompanyController.cs index e85428ff..0d73835b 100644 --- a/Marechai/Controllers/CompanyController.cs +++ b/Marechai/Controllers/CompanyController.cs @@ -39,7 +39,7 @@ namespace Marechai.Controllers { public class CompanyController : Controller { - readonly MarechaiContext _context; + readonly MarechaiContext _context; readonly IHostingEnvironment hostingEnvironment; public CompanyController(IHostingEnvironment env, MarechaiContext context) @@ -51,18 +51,24 @@ namespace Marechai.Controllers public IActionResult ByLetter(char id) { // ToUpper() - if(id >= 'a' && id <= 'z') id -= (char)32; + if(id >= 'a' && + id <= 'z') + id -= (char)32; + // Check if not letter - if(id < 'A' || id > 'Z') id = '\0'; + if(id < 'A' || + id > 'Z') + id = '\0'; ViewBag.Letter = id; ViewBag.WebRootPath = hostingEnvironment.WebRootPath; - if(id == '\0') return RedirectToAction(nameof(Index)); + if(id == '\0') + return RedirectToAction(nameof(Index)); - return View(_context.Companies.Include(c => c.Logos).Where(c => c.Name.StartsWith(id)).OrderBy(c => c.Name) - .Select(c => new CompanyViewModel + return View(_context.Companies.Include(c => c.Logos).Where(c => c.Name.StartsWith(id)).OrderBy(c => c.Name). + Select(c => new CompanyViewModel { Id = c.Id, LastLogo = c.Logos.OrderByDescending(l => l.Year).FirstOrDefault().Guid, @@ -75,7 +81,8 @@ namespace Marechai.Controllers ViewBag.WebRootPath = hostingEnvironment.WebRootPath; Company company = _context.Companies.FirstOrDefault(c => c.Id == id); - if(company == null) return Index(); + if(company == null) + return Index(); ViewBag.CompanyDescription = company.Description?.Html ?? company.Description?.Text; @@ -86,11 +93,13 @@ namespace Marechai.Controllers { ViewBag.Iso3166 = _context.Iso31661Numeric.FirstOrDefault(i => i.Id == id); - if(ViewBag.Iso3166 is null) RedirectToAction(nameof(Index)); + if(ViewBag.Iso3166 is null) + RedirectToAction(nameof(Index)); ViewBag.WebRootPath = hostingEnvironment.WebRootPath; - return View(_context.Companies.Include(c => c.Logos).Where(c => c.CountryId == id).OrderBy(c => c.Name) - .Select(c => new CompanyViewModel + + return View(_context.Companies.Include(c => c.Logos).Where(c => c.CountryId == id).OrderBy(c => c.Name). + Select(c => new CompanyViewModel { Id = c.Id, LastLogo = c.Logos.OrderByDescending(l => l.Year).FirstOrDefault().Guid, @@ -104,14 +113,7 @@ namespace Marechai.Controllers return View(_context.Companies.Include(c => c.Logos).OrderBy(c => c.Name).Select(c => new CompanyViewModel { - Id = c.Id, - LastLogo = c - .Logos - .OrderByDescending(l => - l.Year) - .FirstOrDefault() - .Guid, - Name = c.Name + Id = c.Id, LastLogo = c.Logos.OrderByDescending(l => l.Year).FirstOrDefault().Guid, Name = c.Name }).ToList()); } } diff --git a/Marechai/Controllers/ComputerController.cs b/Marechai/Controllers/ComputerController.cs index 791940f3..63a3d29e 100644 --- a/Marechai/Controllers/ComputerController.cs +++ b/Marechai/Controllers/ComputerController.cs @@ -38,7 +38,7 @@ namespace Marechai.Controllers { public class ComputerController : Controller { - readonly MarechaiContext _context; + readonly MarechaiContext _context; readonly IHostingEnvironment hostingEnvironment; public ComputerController(IHostingEnvironment env, MarechaiContext context) @@ -50,12 +50,14 @@ namespace Marechai.Controllers public IActionResult Index() { ViewBag.ItemCount = _context.Machines.Count(m => m.Type == MachineType.Computer); - ViewBag.MinYear = _context - .Machines.Where(t => t.Type == MachineType.Computer && + + ViewBag.MinYear = _context. + Machines.Where(t => t.Type == MachineType.Computer && t.Introduced.HasValue && t.Introduced.Value.Year > 1000).Min(t => t.Introduced.Value.Year); - ViewBag.MaxYear = _context - .Machines.Where(t => t.Type == MachineType.Computer && + + ViewBag.MaxYear = _context. + Machines.Where(t => t.Type == MachineType.Computer && t.Introduced.HasValue && t.Introduced.Value.Year > 1000).Max(t => t.Introduced.Value.Year); @@ -65,16 +67,28 @@ namespace Marechai.Controllers public IActionResult ByLetter(char id) { // ToUpper() - if(id >= 'a' && id <= 'z') id -= (char)32; + if(id >= 'a' && + id <= 'z') + id -= (char)32; + // Check if not letter - if(id < 'A' || id > 'Z') id = '\0'; + if(id < 'A' || + id > 'Z') + id = '\0'; ViewBag.Letter = id; - return View(id == '\0' - ? _context.Machines.Where(m => m.Type == MachineType.Computer).ToArray() - : _context.Machines.Where(m => m.Type == MachineType.Computer && m.Name.StartsWith(id)) - .ToArray()); + return View(id == '\0' ? _context.Machines.Where(m => m.Type == MachineType.Computer).ToArray() : _context. + Machines. + Where(m => + m. + Type == + MachineType. + Computer && + m. + Name. + StartsWith(id)). + ToArray()); } public IActionResult ByYear(int id) diff --git a/Marechai/Controllers/ConsoleController.cs b/Marechai/Controllers/ConsoleController.cs index 5efb1ddd..90a997f3 100644 --- a/Marechai/Controllers/ConsoleController.cs +++ b/Marechai/Controllers/ConsoleController.cs @@ -38,7 +38,7 @@ namespace Marechai.Controllers { public class ConsoleController : Controller { - readonly MarechaiContext _context; + readonly MarechaiContext _context; readonly IHostingEnvironment hostingEnvironment; public ConsoleController(IHostingEnvironment env, MarechaiContext context) @@ -50,12 +50,14 @@ namespace Marechai.Controllers public IActionResult Index() { ViewBag.ItemCount = _context.Machines.Count(m => m.Type == MachineType.Console); - ViewBag.MinYear = _context - .Machines.Where(t => t.Type == MachineType.Console && + + ViewBag.MinYear = _context. + Machines.Where(t => t.Type == MachineType.Console && t.Introduced.HasValue && t.Introduced.Value.Year > 1000).Min(t => t.Introduced.Value.Year); - ViewBag.MaxYear = _context - .Machines.Where(t => t.Type == MachineType.Console && + + ViewBag.MaxYear = _context. + Machines.Where(t => t.Type == MachineType.Console && t.Introduced.HasValue && t.Introduced.Value.Year > 1000).Max(t => t.Introduced.Value.Year); @@ -65,16 +67,28 @@ namespace Marechai.Controllers public IActionResult ByLetter(char id) { // ToUpper() - if(id >= 'a' && id <= 'z') id -= (char)32; + if(id >= 'a' && + id <= 'z') + id -= (char)32; + // Check if not letter - if(id < 'A' || id > 'Z') id = '\0'; + if(id < 'A' || + id > 'Z') + id = '\0'; ViewBag.Letter = id; - return View(id == '\0' - ? _context.Machines.Where(m => m.Type == MachineType.Console).ToArray() - : _context.Machines.Where(m => m.Type == MachineType.Console && m.Name.StartsWith(id)) - .ToArray()); + return View(id == '\0' ? _context.Machines.Where(m => m.Type == MachineType.Console).ToArray() : _context. + Machines. + Where(m => + m. + Type == + MachineType. + Console && + m. + Name. + StartsWith(id)). + ToArray()); } public IActionResult ByYear(int id) diff --git a/Marechai/Controllers/HomeController.cs b/Marechai/Controllers/HomeController.cs index 49ee48a6..4312b342 100644 --- a/Marechai/Controllers/HomeController.cs +++ b/Marechai/Controllers/HomeController.cs @@ -41,7 +41,7 @@ namespace Marechai.Controllers { public class HomeController : Controller { - readonly MarechaiContext _context; + readonly MarechaiContext _context; readonly IHostingEnvironment hostingEnvironment; public HomeController(IHostingEnvironment env, MarechaiContext context) @@ -60,47 +60,56 @@ namespace Marechai.Controllers { Machine machine = _context.Machines.Find(@new.AddedId); - if(machine is null) continue; + if(machine is null) + continue; switch(@new.Type) { case NewsType.NewComputerInDb: news.Add(new NewsModel(@new.AddedId, "New computer in database", @new.Date, "Machine", "View", $"{machine.Company.Name} {machine.Name}")); + break; case NewsType.NewConsoleInDb: news.Add(new NewsModel(@new.AddedId, "New console in database", @new.Date, "Machine", "View", $"{machine.Company.Name} {machine.Name}")); + break; case NewsType.NewComputerInCollection: news.Add(new NewsModel(@new.AddedId, "New computer in collection", @new.Date, "Machine", "View", $"{machine.Company.Name} {machine.Name}")); + break; case NewsType.NewConsoleInCollection: news.Add(new NewsModel(@new.AddedId, "New console in collection", @new.Date, "Machine", "View", $"{machine.Company.Name} {machine.Name}")); + break; case NewsType.UpdatedComputerInDb: news.Add(new NewsModel(@new.AddedId, "Updated computer in database", @new.Date, "Machine", "View", $"{machine.Company.Name} {machine.Name}")); + break; case NewsType.UpdatedConsoleInDb: news.Add(new NewsModel(@new.AddedId, "Updated console in database", @new.Date, "Machine", "View", $"{machine.Company.Name} {machine.Name}")); + break; case NewsType.UpdatedComputerInCollection: news.Add(new NewsModel(@new.AddedId, "Updated computer in collection", @new.Date, "Machine", "View", $"{machine.Company.Name} {machine.Name}")); + break; case NewsType.UpdatedConsoleInCollection: news.Add(new NewsModel(@new.AddedId, "Updated console in collection", @new.Date, "Machine", "View", $"{machine.Company.Name} {machine.Name}")); + break; case NewsType.NewMoneyDonation: @@ -118,7 +127,9 @@ namespace Marechai.Controllers public IActionResult Contact() => View(); - public IActionResult Error() => - View(new ErrorViewModel {RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier}); + public IActionResult Error() => View(new ErrorViewModel + { + RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier + }); } } \ No newline at end of file diff --git a/Marechai/Controllers/MachineController.cs b/Marechai/Controllers/MachineController.cs index 864515e5..9e734b80 100644 --- a/Marechai/Controllers/MachineController.cs +++ b/Marechai/Controllers/MachineController.cs @@ -37,7 +37,7 @@ namespace Marechai.Controllers { public class MachineController : Controller { - readonly MarechaiContext _context; + readonly MarechaiContext _context; readonly IHostingEnvironment hostingEnvironment; public MachineController(IHostingEnvironment env, MarechaiContext context) diff --git a/Marechai/Helpers/AddPhoto.cs b/Marechai/Helpers/AddPhoto.cs index 3663fc3c..467d14b7 100644 --- a/Marechai/Helpers/AddPhoto.cs +++ b/Marechai/Helpers/AddPhoto.cs @@ -22,13 +22,14 @@ namespace Marechai.Helpers { Image image = Image.Load(tmpFile); - MachinePhoto photo = new MachinePhoto(); + var photo = new MachinePhoto(); foreach(ImageProperty prop in image.MetaData.Properties) switch(prop.Name) { - case "aux:Lens": + case"aux:Lens": photo.Lens = prop.Value; + break; } @@ -38,33 +39,41 @@ namespace Marechai.Helpers { case ExifTag.Artist: photo.Author = exif.Value as string; + break; case ExifTag.Make: photo.CameraManufacturer = exif.Value as string; + break; case ExifTag.ColorSpace: photo.ColorSpace = (ColorSpace)exif.Value; + break; case ExifTag.UserComment: photo.Comments = Encoding.ASCII.GetString(exif.Value as byte[]); + break; case ExifTag.Contrast: photo.Contrast = (Contrast)exif.Value; + break; case ExifTag.DateTimeDigitized: photo.CreationDate = DateTime.ParseExact(exif.Value.ToString(), "yyyy:MM:dd HH:mm:ss", CultureInfo.InvariantCulture); + break; case ExifTag.DigitalZoomRatio: photo.DigitalZoomRatio = ((Rational)exif.Value).ToDouble(); + break; case ExifTag.ExifVersion: photo.ExifVersion = Encoding.ASCII.GetString(exif.Value as byte[]); + break; case ExifTag.ExposureTime: { - Rational rat = (Rational)exif.Value; + var rat = (Rational)exif.Value; photo.Exposure = rat.Denominator == 1 ? rat.Numerator.ToString() : rat.ToString(); break; @@ -72,80 +81,102 @@ namespace Marechai.Helpers case ExifTag.ExposureMode: photo.ExposureMethod = (ExposureMode)exif.Value; + break; case ExifTag.ExposureProgram: photo.ExposureProgram = (ExposureProgram)exif.Value; + break; case ExifTag.Flash: photo.Flash = (Flash)exif.Value; + break; case ExifTag.FNumber: photo.Focal = ((Rational)exif.Value).ToDouble(); + break; case ExifTag.FocalLength: photo.FocalLength = ((Rational)exif.Value).ToDouble(); + break; case ExifTag.FocalLengthIn35mmFilm: photo.FocalLengthEquivalent = exif.Value as ushort?; + break; case ExifTag.XResolution: photo.HorizontalResolution = ((Rational)exif.Value).ToDouble(); + break; case ExifTag.ISOSpeedRatings: photo.IsoRating = (ushort)exif.Value; + break; case ExifTag.LensModel: photo.Lens = exif.Value as string; + break; case ExifTag.LightSource: photo.LightSource = (LightSource)exif.Value; + break; case ExifTag.MeteringMode: photo.MeteringMode = (MeteringMode)exif.Value; + break; case ExifTag.ResolutionUnit: photo.ResolutionUnit = (ResolutionUnit)exif.Value; + break; case ExifTag.Orientation: photo.Orientation = (Orientation)exif.Value; + break; case ExifTag.Saturation: photo.Saturation = (Saturation)exif.Value; + break; case ExifTag.SceneCaptureType: photo.SceneCaptureType = (SceneCaptureType)exif.Value; + break; case ExifTag.SensingMethod: photo.SensingMethod = (SensingMethod)exif.Value; + break; case ExifTag.Software: photo.SoftwareUsed = exif.Value as string; + break; case ExifTag.SubjectDistanceRange: photo.SubjectDistanceRange = (SubjectDistanceRange)exif.Value; + break; case ExifTag.YResolution: photo.VerticalResolution = ((Rational)exif.Value).ToDouble(); + break; case ExifTag.WhiteBalance: photo.WhiteBalance = (WhiteBalance)exif.Value; + break; default: image.MetaData.ExifProfile.RemoveValue(exif.Tag); + break; } - if(!Directory.Exists(Path.Combine(webRootPath, "assets", "photos"))) + if(!Directory.Exists(Path.Combine(webRootPath, "assets", "photos"))) Directory.CreateDirectory(Path.Combine(webRootPath, "assets", "photos")); - if(!Directory.Exists(Path.Combine(webRootPath, "assets", "photos", "machines"))) + + if(!Directory.Exists(Path.Combine(webRootPath, "assets", "photos", "machines"))) Directory.CreateDirectory(Path.Combine(webRootPath, "assets", "photos", "machines")); - if(!Directory.Exists(Path.Combine(webRootPath, "assets", "photos", "machines", "thumbs"))) + + if(!Directory.Exists(Path.Combine(webRootPath, "assets", "photos", "machines", "thumbs"))) Directory.CreateDirectory(Path.Combine(webRootPath, "assets", "photos", "machines", "thumbs")); string outJpeg = Path.Combine(webRootPath, "assets", "photos", "machines", newId + ".jpg"); - using(FileStream jpegStream = - new FileStream(outJpeg, FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None)) + using(var jpegStream = new FileStream(outJpeg, FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None)) image.SaveAsJpeg(jpegStream); int imgMax = Math.Max(image.Width, image.Height); @@ -154,25 +185,34 @@ namespace Marechai.Helpers image.Dispose(); - SKBitmap skBitmap = SKBitmap.Decode(outJpeg); + var skBitmap = SKBitmap.Decode(outJpeg); - foreach(string format in new[] {"jpg", "webp"}) + foreach(string format in new[] { - if(!Directory.Exists(Path.Combine(webRootPath, "assets/photos/machines/thumbs", format))) + "jpg", "webp" + }) + { + if(!Directory.Exists(Path.Combine(webRootPath, "assets/photos/machines/thumbs", format))) Directory.CreateDirectory(Path.Combine(webRootPath, "assets/photos/machines/thumbs", format)); SKEncodedImageFormat skFormat; + switch(format) { - case "webp": + case"webp": skFormat = SKEncodedImageFormat.Webp; + break; default: skFormat = SKEncodedImageFormat.Jpeg; + break; } - foreach(int multiplier in new[] {1, 2, 3}) + foreach(int multiplier in new[] + { + 1, 2, 3 + }) { if(!Directory.Exists(Path.Combine(webRootPath, "assets/photos/machines/thumbs", format, $"{multiplier}x"))) @@ -182,30 +222,35 @@ namespace Marechai.Helpers string resized = Path.Combine(webRootPath, "assets/photos/machines/thumbs", format, $"{multiplier}x", newId + $".{format}"); - if(File.Exists(resized)) continue; + if(File.Exists(resized)) + continue; float canvasMin = 256 * multiplier; float scale = canvasMin / imgMax; // Do not enlarge images - if(scale > 1) scale = 1; + if(scale > 1) + scale = 1; SKBitmap skResized = skBitmap.Resize(new SKImageInfo((int)(width * scale), (int)(height * scale)), SKFilterQuality.High); - SKImage skImage = SKImage.FromBitmap(skResized); - SKData data = skImage.Encode(skFormat, 100); - FileStream outfs = new FileStream(resized, FileMode.CreateNew); + + var skImage = SKImage.FromBitmap(skResized); + SKData data = skImage.Encode(skFormat, 100); + var outfs = new FileStream(resized, FileMode.CreateNew); data.SaveTo(outfs); outfs.Close(); } } - if(!Directory.Exists(Path.Combine(contentRootPath, "originals", "photos"))) + if(!Directory.Exists(Path.Combine(contentRootPath, "originals", "photos"))) Directory.CreateDirectory(Path.Combine(contentRootPath, "originals", "photos")); - if(!Directory.Exists(Path.Combine(contentRootPath, "originals", "photos"))) + + if(!Directory.Exists(Path.Combine(contentRootPath, "originals", "photos"))) Directory.CreateDirectory(Path.Combine(contentRootPath, "originals", "photos")); - if(!Directory.Exists(Path.Combine(contentRootPath, "originals", "photos", "machines"))) + + if(!Directory.Exists(Path.Combine(contentRootPath, "originals", "photos", "machines"))) Directory.CreateDirectory(Path.Combine(contentRootPath, "originals", "photos", "machines")); File.Move(tmpFile, Path.Combine(contentRootPath, "originals", "photos", "machines", newId + extension)); @@ -216,18 +261,22 @@ namespace Marechai.Helpers public static void ImportPhotos(MarechaiContext context) { if(!Directory.Exists("wwwroot/assets/photos/computers") && - !Directory.Exists("wwwroot/assets/photos/consoles")) return; + !Directory.Exists("wwwroot/assets/photos/consoles")) + return; if(!(context.Users.FirstOrDefault() is ApplicationUser user)) { Console.WriteLine("Cannot import photos without an existing uberadmin, please create it before continuing..."); + return; } License license = context.Licenses.FirstOrDefault(l => l.Name == "Fair use"); + if(license is null) { Console.WriteLine("Cannot import photos without the \"Fair use\" license, please create it before continuing..."); + return; } @@ -239,6 +288,7 @@ namespace Marechai.Helpers if(!int.TryParse(computerIdStr, out int computerId)) { Console.WriteLine("{0} does not indicate a correct computer ID", computerIdStr); + continue; } @@ -247,30 +297,36 @@ namespace Marechai.Helpers if(machine is null) { Console.WriteLine("Cannot find machine with ID {0}.", computerId); + continue; } foreach(string computerPhoto in Directory.EnumerateFiles(computer, "*", SearchOption.TopDirectoryOnly)) { Console.WriteLine("Importing {0}...", computerPhoto); - Guid newId = Guid.NewGuid(); + var newId = Guid.NewGuid(); IImageFormat imageinfo = Image.DetectFormat(computerPhoto); string extension; + switch(imageinfo?.Name) { - case "JPEG": + case"JPEG": extension = ".jpg"; + break; - case "PNG": + case"PNG": extension = ".png"; + break; - case "GIF": + case"GIF": extension = ".gif"; + break; default: Console.WriteLine("Unsupported file format for {0}", computerPhoto); + continue; } @@ -293,6 +349,7 @@ namespace Marechai.Helpers if(!int.TryParse(consoleIdStr, out int consoleId)) { Console.WriteLine("{0} does not indicate a correct console ID", consoleIdStr); + continue; } @@ -301,30 +358,36 @@ namespace Marechai.Helpers if(machine is null) { Console.WriteLine("Cannot find machine with ID {0}.", consoleId + 356); + continue; } foreach(string consolePhoto in Directory.EnumerateFiles(console, "*", SearchOption.TopDirectoryOnly)) { Console.WriteLine("Importing {0}...", consolePhoto); - Guid newId = Guid.NewGuid(); + var newId = Guid.NewGuid(); IImageFormat imageinfo = Image.DetectFormat(consolePhoto); string extension; + switch(imageinfo?.Name) { - case "JPEG": + case"JPEG": extension = ".jpg"; + break; - case "PNG": + case"PNG": extension = ".png"; + break; - case "GIF": + case"GIF": extension = ".gif"; + break; default: Console.WriteLine("Unsupported file format for {0}", consolePhoto); + continue; } diff --git a/Marechai/Helpers/Iso639.cs b/Marechai/Helpers/Iso639.cs index db71c6d7..368d2fa8 100644 --- a/Marechai/Helpers/Iso639.cs +++ b/Marechai/Helpers/Iso639.cs @@ -13,7 +13,8 @@ namespace Marechai.Helpers // Data files can be found in https://iso639-3.sil.org/code_tables/download_tables internal static void Import(MarechaiContext context) { - if(!Directory.Exists("iso639")) return; + if(!Directory.Exists("iso639")) + return; IEnumerable files = Directory.EnumerateFiles("iso639", "iso-639-3_*.tab"); long added = 0; @@ -22,9 +23,10 @@ namespace Marechai.Helpers foreach(string file in files) { Console.WriteLine("Importing ISO-639 codes from {0}", file); - using(FileStream fs = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.None)) + + using(var fs = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.None)) { - using(StreamReader sr = new StreamReader(fs, Encoding.UTF8)) + using(var sr = new StreamReader(fs, Encoding.UTF8)) { string line; string[] pieces; @@ -34,17 +36,24 @@ namespace Marechai.Helpers if(line is null) { Console.WriteLine("Invalid data, not proceeding"); + continue; } pieces = line.Split('\t'); - if(pieces.Length != 8 || pieces[0] != "Id" || pieces[1] != "Part2B" || - pieces[2] != "Part2T" || - pieces[3] != "Part1" || pieces[4] != "Scope" || pieces[5] != "Language_Type" || - pieces[6] != "Ref_Name" || pieces[7] != "Comment") + if(pieces.Length != 8 || + pieces[0] != "Id" || + pieces[1] != "Part2B" || + pieces[2] != "Part2T" || + pieces[3] != "Part1" || + pieces[4] != "Scope" || + pieces[5] != "Language_Type" || + pieces[6] != "Ref_Name" || + pieces[7] != "Comment") { Console.WriteLine("Invalid data, not proceeding"); + continue; } @@ -58,6 +67,7 @@ namespace Marechai.Helpers { Console.WriteLine("Invalid data, continuing with next line"); line = sr.ReadLine(); + continue; } @@ -65,29 +75,29 @@ namespace Marechai.Helpers if(pieces[p] == "") pieces[p] = null; - Marechai.Database.Models.Iso639 lang = context.Iso639.FirstOrDefault(i => i.Id == pieces[0]); + Database.Models.Iso639 lang = context.Iso639.FirstOrDefault(i => i.Id == pieces[0]); if(lang is null) { - context.Iso639.Add(new Marechai.Database.Models.Iso639 + context.Iso639.Add(new Database.Models.Iso639 { - Id = pieces[0], - Part2B = pieces[1], - Part2T = pieces[2], - Part1 = pieces[3], - Scope = pieces[4], - Type = pieces[5], - ReferenceName = pieces[6], - Comment = pieces[7] + Id = pieces[0], Part2B = pieces[1], Part2T = pieces[2], + Part1 = pieces[3], + Scope = pieces[4], Type = pieces[5], ReferenceName = pieces[6], + Comment = pieces[7] }); + line = sr.ReadLine(); added++; + continue; } - if(pieces[1] != lang.Part2B || pieces[2] != lang.Part2T || + if(pieces[1] != lang.Part2B || + pieces[2] != lang.Part2T || pieces[3] != lang.Part1 || - pieces[4] != lang.Scope || pieces[5] != lang.Type || + pieces[4] != lang.Scope || + pieces[5] != lang.Type || pieces[6] != lang.ReferenceName || pieces[7] != lang.Comment) { @@ -108,7 +118,7 @@ namespace Marechai.Helpers } } - Console.WriteLine("{0} language codes added", added); + Console.WriteLine("{0} language codes added", added); Console.WriteLine("{0} language codes modified", modified); } } diff --git a/Marechai/Helpers/SvgRender.cs b/Marechai/Helpers/SvgRender.cs index 837eb4dc..74bf9dde 100644 --- a/Marechai/Helpers/SvgRender.cs +++ b/Marechai/Helpers/SvgRender.cs @@ -40,7 +40,8 @@ namespace Marechai.Helpers { public static void RenderCountries() { - if(!Directory.Exists("wwwroot/assets/flags/countries")) return; + if(!Directory.Exists("wwwroot/assets/flags/countries")) + return; foreach(string file in Directory.GetFiles("wwwroot/assets/flags/countries/", "*.svg", SearchOption.TopDirectoryOnly)) @@ -49,53 +50,63 @@ namespace Marechai.Helpers string flagname = Path.GetFileNameWithoutExtension(file); - foreach(string format in new[] {"png", "webp"}) + foreach(string format in new[] + { + "png", "webp" + }) { if(!Directory.Exists(Path.Combine("wwwroot/assets/flags/countries", format))) - Directory.CreateDirectory(Path.Combine("wwwroot/assets/flags/countries", format)); + Directory.CreateDirectory(Path.Combine("wwwroot/assets/flags/countries", format)); SKEncodedImageFormat skFormat; + switch(format) { - case "webp": + case"webp": skFormat = SKEncodedImageFormat.Webp; + break; default: skFormat = SKEncodedImageFormat.Png; + break; } - foreach(int multiplier in new[] {1, 2, 3}) + foreach(int multiplier in new[] { - if(!Directory.Exists(Path.Combine("wwwroot/assets/flags/countries", format, $"{multiplier}x")) - ) - Directory.CreateDirectory(Path.Combine("wwwroot/assets/flags/countries", format, - $"{multiplier}x")); + 1, 2, 3 + }) + { + if(!Directory.Exists(Path.Combine("wwwroot/assets/flags/countries", format, $"{multiplier}x"))) + Directory.CreateDirectory(Path.Combine("wwwroot/assets/flags/countries", format, + $"{multiplier}x")); string rendered = Path.Combine("wwwroot/assets/flags/countries", format, $"{multiplier}x", flagname + $".{format}"); - if(File.Exists(rendered)) continue; + if(File.Exists(rendered)) + continue; Console.WriteLine("Rendering {0}", rendered); + if(svg == null) { svg = new SKSvg(); svg.Load(file); } - SKRect svgSize = svg.Picture.CullRect; - float svgMax = Math.Max(svgSize.Width, svgSize.Height); - float canvasMin = 32 * multiplier; - float scale = canvasMin / svgMax; - SKMatrix matrix = SKMatrix.MakeScale(scale, scale); - SKBitmap bitmap = new SKBitmap((int)(svgSize.Width * scale), (int)(svgSize.Height * scale)); - SKCanvas canvas = new SKCanvas(bitmap); + SKRect svgSize = svg.Picture.CullRect; + float svgMax = Math.Max(svgSize.Width, svgSize.Height); + float canvasMin = 32 * multiplier; + float scale = canvasMin / svgMax; + var matrix = SKMatrix.MakeScale(scale, scale); + var bitmap = new SKBitmap((int)(svgSize.Width * scale), (int)(svgSize.Height * scale)); + var canvas = new SKCanvas(bitmap); canvas.DrawPicture(svg.Picture, ref matrix); canvas.Flush(); - SKImage image = SKImage.FromBitmap(bitmap); - SKData data = image.Encode(skFormat, 100); - FileStream outfs = new FileStream(rendered, FileMode.CreateNew); + var image = SKImage.FromBitmap(bitmap); + SKData data = image.Encode(skFormat, 100); + var outfs = new FileStream(rendered, FileMode.CreateNew); data.SaveTo(outfs); outfs.Close(); } @@ -105,31 +116,43 @@ namespace Marechai.Helpers public static void ImportCompanyLogos(MarechaiContext context) { - if(!Directory.Exists("wwwroot/assets/incoming")) return; + if(!Directory.Exists("wwwroot/assets/incoming")) + return; foreach(string file in Directory.GetFiles("wwwroot/assets/incoming", "company_*.svg", SearchOption.TopDirectoryOnly)) { string filename = Path.GetFileNameWithoutExtension(file); - if(!filename.StartsWith("company_")) continue; + if(!filename.StartsWith("company_")) + continue; string[] pieces = filename.Split('_'); - if(pieces.Length != 3) continue; + if(pieces.Length != 3) + continue; - Guid guid = Guid.NewGuid(); + var guid = Guid.NewGuid(); - if(!int.TryParse(pieces[1], out int companyId)) continue; + if(!int.TryParse(pieces[1], out int companyId)) + continue; - if(!int.TryParse(pieces[2], out int year)) continue; + if(!int.TryParse(pieces[2], out int year)) + continue; try { - context.CompanyLogos.Add(new CompanyLogo {CompanyId = companyId, Year = year, Guid = guid}); + context.CompanyLogos.Add(new CompanyLogo + { + CompanyId = companyId, Year = year, Guid = guid + }); + context.SaveChanges(); } - catch(Exception) { continue; } + catch(Exception) + { + continue; + } File.Move(file, $"wwwroot/assets/logos/{guid}.svg"); } diff --git a/Marechai/Interop/DetectOS.cs b/Marechai/Interop/DetectOS.cs index c775412b..ba657810 100644 --- a/Marechai/Interop/DetectOS.cs +++ b/Marechai/Interop/DetectOS.cs @@ -47,14 +47,10 @@ namespace DiscImageChef.Interop { public static readonly bool IsMono = Type.GetType("Mono.Runtime") != null; - /// - /// Checks if the underlying runtime runs in 64-bit mode - /// + /// Checks if the underlying runtime runs in 64-bit mode public static readonly bool Is64Bit = IntPtr.Size == 8; - /// - /// Checks if the underlying runtime runs in 32-bit mode - /// + /// Checks if the underlying runtime runs in 32-bit mode public static readonly bool Is32Bit = IntPtr.Size == 4; [DllImport("libc", SetLastError = true)] @@ -63,36 +59,38 @@ namespace DiscImageChef.Interop [DllImport("libc", SetLastError = true, EntryPoint = "sysctlbyname", CharSet = CharSet.Ansi)] static extern int OSX_sysctlbyname(string name, IntPtr oldp, IntPtr oldlenp, IntPtr newp, uint newlen); - /// - /// Gets the real platform ID, not the incomplete .NET framework one - /// + /// Gets the real platform ID, not the incomplete .NET framework one /// Platform ID /// Unhandled exception public static PlatformID GetRealPlatformID() { - if((int)Environment.OSVersion.Platform < 4 || (int)Environment.OSVersion.Platform == 5) - return (PlatformID)(int)Environment.OSVersion.Platform; + if((int)Environment.OSVersion.Platform < 4 || + (int)Environment.OSVersion.Platform == 5) + return(PlatformID)(int)Environment.OSVersion.Platform; int error = uname(out utsname unixname); - if(error != 0) throw new Exception($"Unhandled exception calling uname: {Marshal.GetLastWin32Error()}"); + + if(error != 0) + throw new Exception($"Unhandled exception calling uname: {Marshal.GetLastWin32Error()}"); switch(unixname.sysname) { // TODO: Differentiate Linux, Android, Tizen - case "Linux": + case"Linux": { - #if __ANDROID__ + #if __ANDROID__ return PlatformID.Android; - #else + #else return PlatformID.Linux; - #endif + #endif } - case "Darwin": + case"Darwin": { int osxError; IntPtr pLen = Marshal.AllocHGlobal(sizeof(int)); osxError = OSX_sysctlbyname("hw.machine", IntPtr.Zero, pLen, IntPtr.Zero, 0); + if(osxError != 0) { Marshal.FreeHGlobal(pLen); @@ -103,6 +101,7 @@ namespace DiscImageChef.Interop int length = Marshal.ReadInt32(pLen); IntPtr pStr = Marshal.AllocHGlobal(length); osxError = OSX_sysctlbyname("hw.machine", pStr, pLen, IntPtr.Zero, 0); + if(osxError != 0) { Marshal.FreeHGlobal(pStr); @@ -116,51 +115,51 @@ namespace DiscImageChef.Interop Marshal.FreeHGlobal(pStr); Marshal.FreeHGlobal(pLen); - if(machine != null && (machine.StartsWith("iPad", StringComparison.Ordinal) || - machine.StartsWith("iPod", StringComparison.Ordinal) || - machine.StartsWith("iPhone", StringComparison.Ordinal))) + if(machine != null && + (machine.StartsWith("iPad", StringComparison.Ordinal) || + machine.StartsWith("iPod", StringComparison.Ordinal) || + machine.StartsWith("iPhone", StringComparison.Ordinal))) return PlatformID.iOS; return PlatformID.MacOSX; } - case "GNU": return PlatformID.Hurd; - case "FreeBSD": - case "GNU/kFreeBSD": return PlatformID.FreeBSD; - case "DragonFly": return PlatformID.DragonFly; - case "Haiku": return PlatformID.Haiku; - case "HP-UX": return PlatformID.HPUX; - case "AIX": return PlatformID.AIX; - case "OS400": return PlatformID.OS400; - case "IRIX": - case "IRIX64": return PlatformID.IRIX; - case "Minix": return PlatformID.Minix; - case "NetBSD": return PlatformID.NetBSD; - case "NONSTOP_KERNEL": return PlatformID.NonStop; - case "OpenBSD": return PlatformID.OpenBSD; - case "QNX": return PlatformID.QNX; - case "SINIX-Y": return PlatformID.SINIX; - case "SunOS": return PlatformID.Solaris; - case "OSF1": return PlatformID.Tru64; - case "ULTRIX": return PlatformID.Ultrix; - case "SCO_SV": return PlatformID.OpenServer; - case "UnixWare": return PlatformID.UnixWare; - case "Interix": - case "UWIN-W7": return PlatformID.Win32NT; + case"GNU": return PlatformID.Hurd; + case"FreeBSD": + case"GNU/kFreeBSD": return PlatformID.FreeBSD; + case"DragonFly": return PlatformID.DragonFly; + case"Haiku": return PlatformID.Haiku; + case"HP-UX": return PlatformID.HPUX; + case"AIX": return PlatformID.AIX; + case"OS400": return PlatformID.OS400; + case"IRIX": + case"IRIX64": return PlatformID.IRIX; + case"Minix": return PlatformID.Minix; + case"NetBSD": return PlatformID.NetBSD; + case"NONSTOP_KERNEL": return PlatformID.NonStop; + case"OpenBSD": return PlatformID.OpenBSD; + case"QNX": return PlatformID.QNX; + case"SINIX-Y": return PlatformID.SINIX; + case"SunOS": return PlatformID.Solaris; + case"OSF1": return PlatformID.Tru64; + case"ULTRIX": return PlatformID.Ultrix; + case"SCO_SV": return PlatformID.OpenServer; + case"UnixWare": return PlatformID.UnixWare; + case"Interix": + case"UWIN-W7": return PlatformID.Win32NT; default: { - if(unixname.sysname.StartsWith("CYGWIN_NT", StringComparison.Ordinal) || + if(unixname.sysname.StartsWith("CYGWIN_NT", StringComparison.Ordinal) || unixname.sysname.StartsWith("MINGW32_NT", StringComparison.Ordinal) || - unixname.sysname.StartsWith("MSYS_NT", StringComparison.Ordinal) || - unixname.sysname.StartsWith("UWIN", StringComparison.Ordinal)) return PlatformID.Win32NT; + unixname.sysname.StartsWith("MSYS_NT", StringComparison.Ordinal) || + unixname.sysname.StartsWith("UWIN", StringComparison.Ordinal)) + return PlatformID.Win32NT; return PlatformID.Unknown; } } } - /// - /// Gets a string for the current operating system REAL version (handles Darwin 1.4 and Windows 10 falsifying) - /// + /// Gets a string for the current operating system REAL version (handles Darwin 1.4 and Windows 10 falsifying) /// Current operating system version public static string GetVersion() { @@ -170,21 +169,21 @@ namespace DiscImageChef.Interop { case PlatformID.MacOSX: if(Environment.OSVersion.Version.Major != 1) - return $"10.{Environment.OSVersion.Version.Major - 4}.{Environment.OSVersion.Version.Minor}"; + return$"10.{Environment.OSVersion.Version.Major - 4}.{Environment.OSVersion.Version.Minor}"; switch(Environment.OSVersion.Version.Minor) { - case 3: return "10.0"; - case 4: return "10.1"; + case 3: return"10.0"; + case 4: return"10.1"; } goto default; case PlatformID.Win32NT: // From Windows 8.1 the reported version is simply falsified... - if(Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Major >= 2 || + if((Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Major >= 2) || Environment.OSVersion.Version.Major > 6) - return FileVersionInfo - .GetVersionInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), + return FileVersionInfo. + GetVersionInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "KERNEL32.DLL")).ProductVersion; return environ; @@ -192,9 +191,7 @@ namespace DiscImageChef.Interop } } - /// - /// From a platform ID and version returns a human-readable version - /// + /// From a platform ID and version returns a human-readable version /// Platform ID /// Version number /// Operating system name @@ -202,107 +199,130 @@ namespace DiscImageChef.Interop { switch(id) { - case PlatformID.AIX: return "AIX"; - case PlatformID.Android: return "Android"; - case PlatformID.DragonFly: return "DragonFly BSD"; - case PlatformID.FreeBSD: return "FreeBSD"; - case PlatformID.Haiku: return "Haiku"; - case PlatformID.HPUX: return "HP/UX"; - case PlatformID.Hurd: return "Hurd"; - case PlatformID.iOS: return "iOS"; - case PlatformID.IRIX: return "IRIX"; - case PlatformID.Linux: return "Linux"; + case PlatformID.AIX: return"AIX"; + case PlatformID.Android: return"Android"; + case PlatformID.DragonFly: return"DragonFly BSD"; + case PlatformID.FreeBSD: return"FreeBSD"; + case PlatformID.Haiku: return"Haiku"; + case PlatformID.HPUX: return"HP/UX"; + case PlatformID.Hurd: return"Hurd"; + case PlatformID.iOS: return"iOS"; + case PlatformID.IRIX: return"IRIX"; + case PlatformID.Linux: return"Linux"; case PlatformID.MacOSX: - if(string.IsNullOrEmpty(version)) return "macOS"; + if(string.IsNullOrEmpty(version)) + return"macOS"; string[] pieces = version.Split('.'); - if(pieces.Length < 2 || !int.TryParse(pieces[1], out int minor)) return "macOS"; - if(minor >= 12) return "macOS"; - if(minor >= 8) return "OS X"; + if(pieces.Length < 2 || + !int.TryParse(pieces[1], out int minor)) + return"macOS"; - return "Mac OS X"; + if(minor >= 12) + return"macOS"; - case PlatformID.Minix: return "MINIX"; - case PlatformID.NetBSD: return "NetBSD"; - case PlatformID.NonStop: return "NonStop OS"; - case PlatformID.OpenBSD: return "OpenBSD"; - case PlatformID.OpenServer: return "SCO OpenServer"; - case PlatformID.OS400: return "OS/400"; - case PlatformID.PlayStation3: return "Sony CellOS"; - case PlatformID.PlayStation4: return "Sony Orbis OS"; - case PlatformID.QNX: return "QNX"; - case PlatformID.SINIX: return "SINIX"; - case PlatformID.Solaris: return "Sun Solaris"; - case PlatformID.Tizen: return "Samsung Tizen"; - case PlatformID.Tru64: return "Tru64 UNIX"; - case PlatformID.Ultrix: return "Ultrix"; - case PlatformID.Unix: return "UNIX"; - case PlatformID.UnixWare: return "SCO UnixWare"; - case PlatformID.Wii: return "Nintendo Wii"; - case PlatformID.WiiU: return "Nintendo Wii U"; + if(minor >= 8) + return"OS X"; + + return"Mac OS X"; + + case PlatformID.Minix: return"MINIX"; + case PlatformID.NetBSD: return"NetBSD"; + case PlatformID.NonStop: return"NonStop OS"; + case PlatformID.OpenBSD: return"OpenBSD"; + case PlatformID.OpenServer: return"SCO OpenServer"; + case PlatformID.OS400: return"OS/400"; + case PlatformID.PlayStation3: return"Sony CellOS"; + case PlatformID.PlayStation4: return"Sony Orbis OS"; + case PlatformID.QNX: return"QNX"; + case PlatformID.SINIX: return"SINIX"; + case PlatformID.Solaris: return"Sun Solaris"; + case PlatformID.Tizen: return"Samsung Tizen"; + case PlatformID.Tru64: return"Tru64 UNIX"; + case PlatformID.Ultrix: return"Ultrix"; + case PlatformID.Unix: return"UNIX"; + case PlatformID.UnixWare: return"SCO UnixWare"; + case PlatformID.Wii: return"Nintendo Wii"; + case PlatformID.WiiU: return"Nintendo Wii U"; case PlatformID.Win32NT: - if(string.IsNullOrEmpty(version)) return "Windows NT/2000/XP/Vista/7/10"; + if(string.IsNullOrEmpty(version)) + return"Windows NT/2000/XP/Vista/7/10"; + if(version.StartsWith("3.", StringComparison.Ordinal) || - version.StartsWith("4.", StringComparison.Ordinal)) return "Windows NT"; - if(version.StartsWith("5.0", StringComparison.Ordinal)) return "Windows 2000"; - if(version.StartsWith("5.1", StringComparison.Ordinal)) return "Windows XP"; - if(version.StartsWith("5.2", StringComparison.Ordinal)) return "Windows 2003"; - if(version.StartsWith("6.0", StringComparison.Ordinal)) return "Windows Vista"; - if(version.StartsWith("6.1", StringComparison.Ordinal)) return "Windows 7"; - if(version.StartsWith("6.2", StringComparison.Ordinal)) return "Windows 8"; - if(version.StartsWith("6.3", StringComparison.Ordinal)) return "Windows 8.1"; - if(version.StartsWith("10.0", StringComparison.Ordinal)) return "Windows 10"; + version.StartsWith("4.", StringComparison.Ordinal)) + return"Windows NT"; - return "Windows NT/2000/XP/Vista/7/10"; - case PlatformID.Win32S: return "Windows 3.x with win32s"; + if(version.StartsWith("5.0", StringComparison.Ordinal)) + return"Windows 2000"; + + if(version.StartsWith("5.1", StringComparison.Ordinal)) + return"Windows XP"; + + if(version.StartsWith("5.2", StringComparison.Ordinal)) + return"Windows 2003"; + + if(version.StartsWith("6.0", StringComparison.Ordinal)) + return"Windows Vista"; + + if(version.StartsWith("6.1", StringComparison.Ordinal)) + return"Windows 7"; + + if(version.StartsWith("6.2", StringComparison.Ordinal)) + return"Windows 8"; + + if(version.StartsWith("6.3", StringComparison.Ordinal)) + return"Windows 8.1"; + + if(version.StartsWith("10.0", StringComparison.Ordinal)) + return"Windows 10"; + + return"Windows NT/2000/XP/Vista/7/10"; + case PlatformID.Win32S: return"Windows 3.x with win32s"; case PlatformID.Win32Windows: - if(string.IsNullOrEmpty(version)) return "Windows 9x/Me"; - if(version.StartsWith("4.0", StringComparison.Ordinal)) return "Windows 95"; - if(version.StartsWith("4.10.2222", StringComparison.Ordinal)) return "Windows 98 SE"; - if(version.StartsWith("4.1", StringComparison.Ordinal)) return "Windows 98"; - if(version.StartsWith("4.9", StringComparison.Ordinal)) return "Windows Me"; + if(string.IsNullOrEmpty(version)) + return"Windows 9x/Me"; - return "Windows 9x/Me"; - case PlatformID.WinCE: return "Windows CE/Mobile"; - case PlatformID.WindowsPhone: return "Windows Phone"; - case PlatformID.Xbox: return "Xbox OS"; - case PlatformID.zOS: return "z/OS"; + if(version.StartsWith("4.0", StringComparison.Ordinal)) + return"Windows 95"; + + if(version.StartsWith("4.10.2222", StringComparison.Ordinal)) + return"Windows 98 SE"; + + if(version.StartsWith("4.1", StringComparison.Ordinal)) + return"Windows 98"; + + if(version.StartsWith("4.9", StringComparison.Ordinal)) + return"Windows Me"; + + return"Windows 9x/Me"; + case PlatformID.WinCE: return"Windows CE/Mobile"; + case PlatformID.WindowsPhone: return"Windows Phone"; + case PlatformID.Xbox: return"Xbox OS"; + case PlatformID.zOS: return"z/OS"; default: return id.ToString(); } } - /// - /// POSIX uname structure, size from OSX, big enough to handle extra fields - /// + /// POSIX uname structure, size from OSX, big enough to handle extra fields [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] struct utsname { - /// - /// System name - /// + /// System name [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - public string sysname; - /// - /// Node name - /// + public readonly string sysname; + /// Node name [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - public string nodename; - /// - /// Release level - /// + public readonly string nodename; + /// Release level [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - public string release; - /// - /// Version level - /// + public readonly string release; + /// Version level [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - public string version; - /// - /// Hardware level - /// + public readonly string version; + /// Hardware level [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - public string machine; + public readonly string machine; } } } \ No newline at end of file diff --git a/Marechai/Interop/PlatformID.cs b/Marechai/Interop/PlatformID.cs index 5d1650de..bfd60779 100644 --- a/Marechai/Interop/PlatformID.cs +++ b/Marechai/Interop/PlatformID.cs @@ -38,155 +38,80 @@ namespace DiscImageChef.Interop { - /// - /// Contains an arbitrary list of OSes, even if .NET does not run on them - /// + /// Contains an arbitrary list of OSes, even if .NET does not run on them public enum PlatformID { - /// - /// Win32s - /// + /// Win32s Win32S = 0, - /// - /// Win32 (Windows 9x) - /// + /// Win32 (Windows 9x) Win32Windows = 1, - /// - /// Windows NT - /// + /// Windows NT Win32NT = 2, - /// - /// Windows Mobile - /// + /// Windows Mobile WinCE = 3, - /// - /// UNIX (do not use, too generic) - /// + /// UNIX (do not use, too generic) Unix = 4, - /// - /// Xbox 360 - /// + /// Xbox 360 Xbox = 5, - /// - /// OS X - /// + /// OS X MacOSX = 6, - /// - /// iOS is not OS X - /// + /// iOS is not OS X iOS = 7, - /// - /// Linux - /// + /// Linux Linux = 8, - /// - /// Sun Solaris - /// + /// Sun Solaris Solaris = 9, - /// - /// NetBSD - /// + /// NetBSD NetBSD = 10, - /// - /// OpenBSD - /// + /// OpenBSD OpenBSD = 11, - /// - /// FreeBSD - /// + /// FreeBSD FreeBSD = 12, - /// - /// DragonFly BSD - /// + /// DragonFly BSD DragonFly = 13, - /// - /// Nintendo Wii - /// + /// Nintendo Wii Wii = 14, - /// - /// Nintendo Wii U - /// + /// Nintendo Wii U WiiU = 15, - /// - /// Sony PlayStation 3 - /// + /// Sony PlayStation 3 PlayStation3 = 16, - /// - /// Sony Playstation 4 - /// + /// Sony Playstation 4 PlayStation4 = 17, - /// - /// Google Android - /// + /// Google Android Android = 18, - /// - /// Samsung Tizen - /// + /// Samsung Tizen Tizen = 19, - /// - /// Windows Phone - /// + /// Windows Phone WindowsPhone = 20, - /// - /// GNU/Hurd - /// + /// GNU/Hurd Hurd = 21, - /// - /// Haiku - /// + /// Haiku Haiku = 22, - /// - /// HP-UX - /// + /// HP-UX HPUX = 23, - /// - /// AIX - /// + /// AIX AIX = 24, - /// - /// OS/400 - /// + /// OS/400 OS400 = 25, - /// - /// IRIX - /// + /// IRIX IRIX = 26, - /// - /// Minix - /// + /// Minix Minix = 27, - /// - /// NonStop - /// + /// NonStop NonStop = 28, - /// - /// QNX - /// + /// QNX QNX = 29, - /// - /// SINIX - /// + /// SINIX SINIX = 30, - /// - /// Tru64 UNIX - /// + /// Tru64 UNIX Tru64 = 31, - /// - /// Ultrix - /// + /// Ultrix Ultrix = 32, - /// - /// SCO OpenServer / SCO UNIX - /// + /// SCO OpenServer / SCO UNIX OpenServer = 33, - /// - /// SCO UnixWare - /// + /// SCO UnixWare UnixWare = 34, - /// - /// IBM z/OS - /// - zOS = 35, - Unknown = -1 + /// IBM z/OS + zOS = 35, Unknown = -1 } } \ No newline at end of file diff --git a/Marechai/Interop/Version.cs b/Marechai/Interop/Version.cs index 1a8c7480..30effb1c 100644 --- a/Marechai/Interop/Version.cs +++ b/Marechai/Interop/Version.cs @@ -44,22 +44,23 @@ namespace DiscImageChef.Interop { public static class Version { - /// - /// Gets version string - /// + /// Gets version string /// Version - public static string GetVersion() - { - return typeof(Version).Assembly.GetName().Version.ToString(); - } + public static string GetVersion() => typeof(Version).Assembly.GetName().Version.ToString(); public static string GetNetCoreVersion() { Assembly assembly = typeof(GCSettings).Assembly; - string[] assemblyPath = - assembly.CodeBase.Split(new[] {'/', '\\'}, StringSplitOptions.RemoveEmptyEntries); + + string[] assemblyPath = assembly.CodeBase.Split(new[] + { + '/', '\\' + }, StringSplitOptions.RemoveEmptyEntries); + int netCoreAppIndex = Array.IndexOf(assemblyPath, "Microsoft.NETCore.App"); - if(netCoreAppIndex > 0 && netCoreAppIndex < assemblyPath.Length - 2) + + if(netCoreAppIndex > 0 && + netCoreAppIndex < assemblyPath.Length - 2) return assemblyPath[netCoreAppIndex + 1]; return null; @@ -67,11 +68,14 @@ namespace DiscImageChef.Interop public static string GetMonoVersion() { - if(!DetectOS.IsMono) return null; + if(!DetectOS.IsMono) + return null; - MethodInfo monoDisplayName = Type.GetType("Mono.Runtime") - ?.GetMethod("GetDisplayName", BindingFlags.NonPublic | BindingFlags.Static); - if(monoDisplayName != null) return (string)monoDisplayName.Invoke(null, null); + MethodInfo monoDisplayName = Type.GetType("Mono.Runtime")?. + GetMethod("GetDisplayName", BindingFlags.NonPublic | BindingFlags.Static); + + if(monoDisplayName != null) + return(string)monoDisplayName.Invoke(null, null); return null; } diff --git a/Marechai/Marechai.csproj b/Marechai/Marechai.csproj index a3ede154..acce679d 100644 --- a/Marechai/Marechai.csproj +++ b/Marechai/Marechai.csproj @@ -2,7 +2,7 @@ netcoreapp2.2 - 3.0.99.891 + 3.0.99.893 Canary Islands Computer Museum Copyright © 2003-2020 Natalia Portillo Canary Islands Computer Museum Website diff --git a/Marechai/Models/NewsModel.cs b/Marechai/Models/NewsModel.cs index ab409afc..a32e0753 100644 --- a/Marechai/Models/NewsModel.cs +++ b/Marechai/Models/NewsModel.cs @@ -4,21 +4,22 @@ namespace Marechai.Models { public class NewsModel { - public readonly int AffectedId; - public readonly string Text; + public readonly string Action; + public readonly int AffectedId; + public readonly string Controller; + public readonly string ItemName; + public readonly string Text; public readonly DateTime Timestamp; - public readonly string Controller; - public readonly string Action; - public readonly string ItemName; - public NewsModel(int affectedId, string text, DateTime timestamp, string controller, string action, string itemName) + public NewsModel(int affectedId, string text, DateTime timestamp, string controller, string action, + string itemName) { AffectedId = affectedId; - Text = text; - Timestamp = timestamp; + Text = text; + Timestamp = timestamp; Controller = controller; - Action = action; - ItemName = itemName; + Action = action; + ItemName = itemName; } } } \ No newline at end of file diff --git a/Marechai/Program.cs b/Marechai/Program.cs index 605766f6..4ec20f74 100644 --- a/Marechai/Program.cs +++ b/Marechai/Program.cs @@ -30,9 +30,9 @@ using System; using System.Linq; +using DiscImageChef.Interop; using Marechai.Database; using Marechai.Database.Models; -using DiscImageChef.Interop; using Marechai.Helpers; using Markdig; using Microsoft.AspNetCore; @@ -82,8 +82,8 @@ namespace Marechai "\u001b[32m XMMMW: .:xKNMMMMMMN0d, lMMMMMd \u001b[31m" + @" _______\/////////___\///////////_________\/////////___\///______________\///__" + "\n\u001b[0m" + - "\u001b[32m :MMMMMK; cWMNkl:;;;:lxKMXc .0MMMMMO \u001b[37;1m MARECHAI\u001b[0m\n" + - "\u001b[32m ..KMMMMMMNo,. ,OMMMMMMW:,. \u001b[37;1m Master repository of computing history artifacts information\u001b[0m\n" + + "\u001b[32m :MMMMMK; cWMNkl:;;;:lxKMXc .0MMMMMO \u001b[37;1m MARECHAI\u001b[0m\n" + + "\u001b[32m ..KMMMMMMNo,. ,OMMMMMMW:,. \u001b[37;1m Master repository of computing history artifacts information\u001b[0m\n" + "\u001b[32m .;d0NMMMMMMMMMMMMMMW0d:' .;lOWMMMMMMMMMMMMMXkl. \u001b[37;1m Version \u001b[0m\u001b[33m{0}\u001b[37;1m-\u001b[0m\u001b[31m{1}\u001b[0m\n" + "\u001b[32m :KMMMMMMMMMMMMMMMMMMMMMMMMc WMMMMMMMMMMMMMMMMMMMMMMWk'\u001b[0m\n" + "\u001b[32m ;NMMMMWX0kkkkO0XMMMMMMMMMMM0' dNMMMMMMMMMMW0xl:;,;:oOWMMX; \u001b[37;1m Running under \u001b[35;1m{2}\u001b[37;1m, \u001b[35m{3}-bit\u001b[37;1m in \u001b[35m{4}-bit\u001b[37;1m mode.\u001b[0m\n" + @@ -103,12 +103,12 @@ namespace Marechai "\u001b[32m .......,cd0WMMNk: c0MMMMMWKkolc:clodc'\u001b[0m\n" + "\u001b[32m .';loddol:'. ':oxkkOkkxoc,.\u001b[0m\n" + "\u001b[0m\n", Version.GetVersion(), - #if DEBUG + #if DEBUG "DEBUG" - #else + #else "RELEASE" - #endif - , DetectOS.GetPlatformName(DetectOS.GetRealPlatformID()), + #endif + , DetectOS.GetPlatformName(DetectOS.GetRealPlatformID()), Environment.Is64BitOperatingSystem ? 64 : 32, Environment.Is64BitProcess ? 64 : 32, DetectOS.IsMono ? "Mono" : ".NET Core", DetectOS.IsMono ? Version.GetMonoVersion() : Version.GetNetCoreVersion()); @@ -127,6 +127,7 @@ namespace Marechai Console.WriteLine("\u001b[31;1mRendering new country flags...\u001b[0m"); SvgRender.RenderCountries(); DateTime end = DateTime.Now; + Console.WriteLine("\u001b[31;1mTook \u001b[32;1m{0} seconds\u001b[31;1m...\u001b[0m", (end - start).TotalSeconds); @@ -135,6 +136,7 @@ namespace Marechai using(IServiceScope scope = host.Services.CreateScope()) { IServiceProvider services = scope.ServiceProvider; + try { start = DateTime.Now; @@ -142,6 +144,7 @@ namespace Marechai MarechaiContext context = services.GetRequiredService(); context.Database.Migrate(); end = DateTime.Now; + Console.WriteLine("\u001b[31;1mTook \u001b[32;1m{0} seconds\u001b[31;1m...\u001b[0m", (end - start).TotalSeconds); @@ -149,6 +152,7 @@ namespace Marechai Console.WriteLine("\u001b[31;1mImporting company logos...\u001b[0m"); SvgRender.ImportCompanyLogos(context); end = DateTime.Now; + Console.WriteLine("\u001b[31;1mTook \u001b[32;1m{0} seconds\u001b[31;1m...\u001b[0m", (end - start).TotalSeconds); @@ -166,47 +170,58 @@ namespace Marechai context.SaveChanges(); end = DateTime.Now; + Console.WriteLine("\u001b[31;1mTook \u001b[32;1m{0} seconds\u001b[31;1m...\u001b[0m", (end - start).TotalSeconds); start = DateTime.Now; Console.WriteLine("\u001b[31;1mImporting photos...\u001b[0m"); - try { Photos.ImportPhotos(context); } + try + { + Photos.ImportPhotos(context); + } catch(Exception e) { Console.WriteLine("Exception {0} importing photos, saving changes and continuing...", e); + throw; } context.SaveChanges(); end = DateTime.Now; + Console.WriteLine("\u001b[31;1mTook \u001b[32;1m{0} seconds\u001b[31;1m...\u001b[0m", (end - start).TotalSeconds); start = DateTime.Now; Console.WriteLine("\u001b[31;1mImporting ISO-639 codes...\u001b[0m"); - try { Iso639.Import(context); } + try + { + Iso639.Import(context); + } catch(Exception e) { Console.WriteLine("Exception {0} importing ISO-639 codes, saving changes and continuing...", e); + throw; } context.SaveChanges(); end = DateTime.Now; + Console.WriteLine("\u001b[31;1mTook \u001b[32;1m{0} seconds\u001b[31;1m...\u001b[0m", (end - start).TotalSeconds); } catch(Exception ex) { Console.WriteLine("\u001b[31;1mCould not open database...\u001b[0m"); - #if DEBUG + #if DEBUG Console.WriteLine("\u001b[31;1mException: {0}\u001b[0m", ex.Message); - #endif + #endif return; } } diff --git a/Marechai/Startup.cs b/Marechai/Startup.cs index 05d8938b..45f8189a 100644 --- a/Marechai/Startup.cs +++ b/Marechai/Startup.cs @@ -41,10 +41,7 @@ namespace Marechai // DO NOT MAKE STATIC public class Startup { - public Startup(IConfiguration configuration) - { - Configuration = configuration; - } + public Startup(IConfiguration configuration) => Configuration = configuration; IConfiguration Configuration { get; } @@ -57,10 +54,10 @@ namespace Marechai options.CheckConsentNeeded = context => true; options.MinimumSameSitePolicy = SameSiteMode.None; }); - #warning To protect potentially sensitive information in your connection string, you should move it out of source code. See http://go.microsoft.com/fwlink/?LinkId=723263 for guidance on storing connection strings. - services.AddDbContext(options => options - .UseLazyLoadingProxies() - .UseMySql("server=localhost;port=3306;user=marechai;password=marechaipass;database=marechai;TreatTinyAsBoolean=false")); + #warning To protect potentially sensitive information in your connection string, you should move it out of source code. See http: //go.microsoft.com/fwlink/?LinkId=723263 for guidance on storing connection strings. + services.AddDbContext(options => options. + UseLazyLoadingProxies(). + UseMySql("server=localhost;port=3306;user=marechai;password=marechaipass;database=marechai;TreatTinyAsBoolean=false")); services.AddMvc(); } @@ -68,8 +65,10 @@ namespace Marechai // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env) { - if(env.IsDevelopment()) app.UseDeveloperExceptionPage(); - else app.UseExceptionHandler("/Home/Error"); + if(env.IsDevelopment()) + app.UseDeveloperExceptionPage(); + else + app.UseExceptionHandler("/Home/Error"); app.UseStaticFiles(); app.UseAuthentication(); @@ -77,8 +76,8 @@ namespace Marechai app.UseMvc(routes => { - routes.MapRoute("areas", "{area:exists}/{controller=Home}/{action=Index}/{id?}") - .MapRoute("default", "{controller=Home}/{action=Index}/{id?}"); + routes.MapRoute("areas", "{area:exists}/{controller=Home}/{action=Index}/{id?}"). + MapRoute("default", "{controller=Home}/{action=Index}/{id?}"); }); } } diff --git a/Marechai/Views/Company/ByCountry.cshtml b/Marechai/Views/Company/ByCountry.cshtml index 0036e59d..db59e3ff 100644 --- a/Marechai/Views/Company/ByCountry.cshtml +++ b/Marechai/Views/Company/ByCountry.cshtml @@ -33,57 +33,44 @@ } @using System.IO @model IEnumerable -

- @if(ViewBag.Iso3166 != null) + @if (ViewBag.Iso3166 != null) { Companies founded in @ViewBag.Iso3166.Name - if(File.Exists(System.IO.Path.Combine(ViewBag.WebRootPath, "assets/flags/countries", ViewBag.Iso3166.Id + ".svg"))) + if (File.Exists(System.IO.Path.Combine(ViewBag.WebRootPath, "assets/flags/countries", ViewBag.Iso3166.Id + ".svg"))) { - - + + /assets/flags/countries/png/1x/@(ViewBag.Iso3166.Id).webp 3x" src="/assets/flags/countries/png/1x@(ViewBag.Iso3166.Id).png" ) alt="" height="32" /> }
} - @if(Model.Any()) + @if (Model.Any()) {

- @Model.Count() companies found in the database.
- @foreach(CompanyViewModel company in Model) + @Model.Count() companies found in the database. +
+ @foreach (var company in Model) { - - @if(company.LastLogo != null && File.Exists(System.IO.Path.Combine(ViewBag.WebRootPath, "assets/logos", company.LastLogo + ".svg"))) + + @if (company.LastLogo != null && + File.Exists(System.IO.Path.Combine(ViewBag.WebRootPath, "assets/logos", company.LastLogo + ".svg"))) { - - + + /assets/logos/thumbs/png/3x/@(company.LastLogo).png 3x" src="/assets/logos/thumbs/png/1x@(company.LastLogo).png" ) alt="" height="auto" width="auto" style="max-height: 32px; max-width: 128px" /> } @company.Name diff --git a/Marechai/Views/Company/ByLetter.cshtml b/Marechai/Views/Company/ByLetter.cshtml index 1ef2f785..16525837 100644 --- a/Marechai/Views/Company/ByLetter.cshtml +++ b/Marechai/Views/Company/ByLetter.cshtml @@ -33,41 +33,33 @@ } @using System.IO @model IEnumerable -

Search results:

- @if(ViewBag.Letter != '\0') + @if (ViewBag.Letter != '\0') { @ViewBag.Letter
} - @if(Model.Any()) + @if (Model.Any()) {

- @Model.Count() companies found in the database.
- @foreach(CompanyViewModel company in Model) + @Model.Count() companies found in the database. +
+ @foreach (var company in Model) { -
- @if(company.LastLogo != null && File.Exists(System.IO.Path.Combine(ViewBag.WebRootPath, "assets/logos", company.LastLogo + ".svg"))) + + @if (company.LastLogo != null && + File.Exists(System.IO.Path.Combine(ViewBag.WebRootPath, "assets/logos", company.LastLogo + ".svg"))) { - - + + /assets/logos/thumbs/png/3x/@(company.LastLogo).png 3x" src="/assets/logos/thumbs/png/1x@(company.LastLogo).png" ) alt="" height="auto" width="auto" style="max-height: 32px; max-width: 128px" /> } @company.Name diff --git a/Marechai/Views/Company/Index.cshtml b/Marechai/Views/Company/Index.cshtml index 1d878cb6..02b7b5b2 100644 --- a/Marechai/Views/Company/Index.cshtml +++ b/Marechai/Views/Company/Index.cshtml @@ -33,34 +33,26 @@ } @using System.IO @model IEnumerable -

- @if(Model.Any()) + @if (Model.Any()) {

- @Model.Count() companies found in the database.
- @foreach(CompanyViewModel company in Model) + @Model.Count() companies found in the database. +
+ @foreach (var company in Model) { -
- @if(company.LastLogo != null && File.Exists(System.IO.Path.Combine(ViewBag.WebRootPath, "assets/logos", company.LastLogo + ".svg"))) + + @if (company.LastLogo != null && + File.Exists(System.IO.Path.Combine(ViewBag.WebRootPath, "assets/logos", company.LastLogo + ".svg"))) { - - + + /assets/logos/thumbs/png/3x/@(company.LastLogo).png 3x" src="/assets/logos/thumbs/png/1x@(company.LastLogo).png" ) alt="" height="auto" width="auto" style="max-height: 32px; max-width: 128px" /> } @company.Name diff --git a/Marechai/Views/Company/View.cshtml b/Marechai/Views/Company/View.cshtml index 795cdda8..5813b198 100644 --- a/Marechai/Views/Company/View.cshtml +++ b/Marechai/Views/Company/View.cshtml @@ -33,67 +33,51 @@ } @using System.IO @using Marechai.Database -@using Marechai.Database.Models @model Marechai.Database.Models.Company -@if(Model != null) +@if (Model != null) {

- @if(Model.LastLogo != null && File.Exists(System.IO.Path.Combine(ViewBag.WebRootPath, "assets/logos", Model.LastLogo.Guid + ".svg"))) + @if (Model.LastLogo != null && + File.Exists(System.IO.Path.Combine(ViewBag.WebRootPath, "assets/logos", Model.LastLogo.Guid + ".svg"))) { - - + + /assets/logos/png/3x/@(Model.LastLogo.Guid).png 3x" src="/assets/logos/png/1x@(Model.LastLogo.Guid).png" ) alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" /> }

@{ - string carrouselActive = "active"; + var carrouselActive = "active"; } - @if(Model.Logos != null && Model.Logos.Count > 1) + @if (Model.Logos != null && + Model.Logos.Count > 1) {
- } -
- - - - - @if(Model.Founded.HasValue) - { - - - - - } - - - + @if (Model.Founded.HasValue) + { + + + + + } + + + - - - - @switch(Model.Status) - { - case CompanyStatus.Unknown: - - break; - case CompanyStatus.Active: - - break; - case CompanyStatus.Sold: - if(Model.Sold != DateTime.MinValue) + /assets/flags/countries/png/1x/@(Model.Country.Id).webp 3x" src="/assets/flags/countries/png/1x@(Model.Country.Id).png" ) alt="" height="32" /> + + } + @Model.Country.Name + + + + + + @switch (Model.Status) { - if(Model.SoldTo != null) - { - - } - else - { - - } + case CompanyStatus.Unknown: + + break; + case CompanyStatus.Active: + + break; + case CompanyStatus.Sold: + if (Model.Sold != DateTime.MinValue) + { + if (Model.SoldTo != null) + { + + } + else + { + + } + } + else + { + if (Model.SoldTo != null) + { + + } + else + { + + } + } + break; + case CompanyStatus.Merged: + if (Model.Sold != DateTime.MinValue) + { + if (Model.SoldTo != null) + { + + } + else + { + + } + } + else + { + if (Model.SoldTo != null) + { + + } + else + { + + } + } + break; + case CompanyStatus.Bankrupt: + if (Model.Sold != DateTime.MinValue) + { + + } + else + { + + } + break; + case CompanyStatus.Defunct: + if (Model.Sold != DateTime.MinValue) + { + + } + else + { + + } + break; + case CompanyStatus.Renamed: + if (Model.Sold != DateTime.MinValue) + { + if (Model.SoldTo != null) + { + + } + else + { + + } + } + else + { + if (Model.SoldTo != null) + { + + } + else + { + + } + } + break; + default: + throw new ArgumentOutOfRangeException(); } - else - { - if(Model.SoldTo != null) + + + + + @Model.City
} - else - { - - } - } - break; - case CompanyStatus.Merged: - if(Model.Sold != DateTime.MinValue) - { - if(Model.SoldTo != null) - { - - } - else - { - - } - } - else - { - if(Model.SoldTo != null) - { - - } - else - { - - } - } - break; - case CompanyStatus.Bankrupt: - if(Model.Sold != DateTime.MinValue) - { - - } - else - { - - } - break; - case CompanyStatus.Defunct: - if(Model.Sold != DateTime.MinValue) - { - - } - else - { - - } - break; - case CompanyStatus.Renamed: - if(Model.Sold != DateTime.MinValue) - { - if(Model.SoldTo != null) - { - - } - else - { - - } - } - else - { - if(Model.SoldTo != null) - { - - } - else - { - - } - } - break; - default: - throw new ArgumentOutOfRangeException(); - } - - - - + + @if (!string.IsNullOrEmpty(Model.Website) || + !string.IsNullOrEmpty(Model.Twitter) || + !string.IsNullOrEmpty(Model.Facebook)) { - @Model.City
+ + + + } - @Model.PostalCode @Model.Province - - @if(!string.IsNullOrEmpty(Model.Website) || !string.IsNullOrEmpty(Model.Twitter) || !string.IsNullOrEmpty(Model.Facebook)) - { - - - - - } -
- @Model.Name -
Founded@Model.Founded.Value.ToLongDateString().
Country - - @if(File.Exists(System.IO.Path.Combine(ViewBag.WebRootPath, "assets/flags/countries", Model.Country.Id + ".svg"))) - { - - - + @Model.Name + +
Founded@Model.Founded.Value.ToLongDateString().
Country + + @if (File.Exists(System.IO.Path.Combine(ViewBag.WebRootPath, "assets/flags/countries", Model.Country.Id + ".svg"))) + { + + + - - - } - @Model.Country.Name - -
StatusCurrent company status is unknown.Company is active.
Status - Company was sold to - - @Model.SoldTo.Name on @Model.Sold.Value.ToLongDateString(). - Company was sold on @Model.Sold.Value.ToLongDateString() to an unknown company.Current company status is unknown.Company is active. + Company was sold to + + @Model.SoldTo.Name on @Model.Sold.Value.ToLongDateString(). + Company was sold on @Model.Sold.Value.ToLongDateString() to an unknown company. + Company was sold to + + @Model.SoldTo.Name on an unknown date. + Company was sold to an unknown company on an unknown date. + Company was merged on @Model.Sold.Value.ToLongDateString() to form + + @Model.SoldTo.Name. + Company was merge on @Model.Sold.Value.ToLongDateString() to form an unknown company. + Company was merged on an unknown date to form + + @Model.SoldTo.Name. + Company was merged to form an unknown company on an unknown date.Company declared bankruptcy on @Model.Sold.Value.ToLongDateString().Company declared bankruptcy on an unknown date.Company ceased operations on @Model.Sold.Value.ToLongDateString().Company ceased operations on an unknown date. + Company was renamed to + + @Model.SoldTo.Name on @Model.Sold.Value.ToLongDateString(). + Company was renamed on @Model.Sold.Value.ToLongDateString() to an unknown name. + Company was renamed to + + @Model.SoldTo.Name on an unknown date. + Company was renamed to an unknown name on an unknown date.
Address + @Model.Address
+ @if (Model.City != Model.Province) { -
- Company was sold to - - @Model.SoldTo.Name on an unknown date. - Company was sold to an unknown company on an unknown date. - Company was merged on @Model.Sold.Value.ToLongDateString() to form - - @Model.SoldTo.Name. - Company was merge on @Model.Sold.Value.ToLongDateString() to form an unknown company. - Company was merged on an unknown date to form - - @Model.SoldTo.Name. - Company was merged to form an unknown company on an unknown date.Company declared bankruptcy on @Model.Sold.Value.ToLongDateString().Company declared bankruptcy on an unknown date.Company ceased operations on @Model.Sold.Value.ToLongDateString().Company ceased operations on an unknown date. - Company was renamed to - - @Model.SoldTo.Name on @Model.Sold.Value.ToLongDateString(). - Company was renamed on @Model.Sold.Value.ToLongDateString() to an unknown name. - Company was renamed to - - @Model.SoldTo.Name on an unknown date. - Company was renamed to an unknown name on an unknown date.
Address - @Model.Address
- @if(Model.City != Model.Province) + @Model.PostalCode @Model.Province
Links + @if (!string.IsNullOrEmpty(Model.Website)) + { + Website +
+ } + @if (!string.IsNullOrEmpty(Model.Twitter)) + { + Twitter +
+ } + @if (!string.IsNullOrEmpty(Model.Facebook)) + { + Facebook +
+ } +
Links - @if(!string.IsNullOrEmpty(Model.Website)) - { - Website -
- } - @if(!string.IsNullOrEmpty(Model.Twitter)) - { - Twitter -
- } - @if(!string.IsNullOrEmpty(Model.Facebook)) - { - Facebook -
- } -
+
- -
+
- @if(Model.Machines.Any(t => t.Type == MachineType.Computer)) + @if (Model.Machines.Any(t => t.Type == MachineType.Computer)) { -
+
-
-
-
+
- @foreach(Machine computer in Model.Machines.Where(t => t.Type == MachineType.Computer)) + @foreach (var computer in Model.Machines.Where(t => t.Type == MachineType.Computer)) { - + @computer.Name
} @@ -379,8 +324,7 @@ } else { -
+
} - @if(Model.Machines.Any(t => t.Type == MachineType.Console)) + @if (Model.Machines.Any(t => t.Type == MachineType.Console)) { -
+
-
-
-
+
- @foreach(Machine console in Model.Machines.Where(t => t.Type == MachineType.Console)) + @foreach (var console in Model.Machines.Where(t => t.Type == MachineType.Console)) { - + @console.Name
} @@ -421,8 +354,7 @@ } else { -
+
- - @if(ViewBag.CompanyDescription != null) + @if (ViewBag.CompanyDescription != null) {
@Html.Raw(ViewBag.CompanyDescription) diff --git a/Marechai/Views/Computer/ByLetter.cshtml b/Marechai/Views/Computer/ByLetter.cshtml index 74e3cee6..805db1c9 100644 --- a/Marechai/Views/Computer/ByLetter.cshtml +++ b/Marechai/Views/Computer/ByLetter.cshtml @@ -31,26 +31,23 @@ ViewData["Title"] = "Computers"; } -@using Machine = Marechai.Database.Models.Machine @model Marechai.Database.Models.Machine[] -

Search results:

- @if(ViewBag.Letter != '\0') + @if (ViewBag.Letter != '\0') { @ViewBag.Letter
} - @if(Model.Any()) + @if (Model.Any()) {

- @Model.Count() computers found in the database.
- @foreach(Machine computer in Model) + @Model.Count() computers found in the database. +
+ @foreach (var computer in Model) { - + @computer.Company.Name @computer.Name
} diff --git a/Marechai/Views/Computer/ByYear.cshtml b/Marechai/Views/Computer/ByYear.cshtml index 1158be6d..32981c2d 100644 --- a/Marechai/Views/Computer/ByYear.cshtml +++ b/Marechai/Views/Computer/ByYear.cshtml @@ -31,22 +31,19 @@ ViewData["Title"] = "Computers"; } -@using Machine = Marechai.Database.Models.Machine @model Marechai.Database.Models.Machine[] -

Search results:

- @ViewBag.Year
- - @if(Model.Any()) + @ViewBag.Year +
+ @if (Model.Any()) {

- @Model.Count() computers found in the database.
- @foreach(Machine computer in Model) + @Model.Count() computers found in the database. +
+ @foreach (var computer in Model) { - + @computer.Company.Name @computer.Name
} diff --git a/Marechai/Views/Computer/Index.cshtml b/Marechai/Views/Computer/Index.cshtml index fe7ae6d3..d32ad7ed 100644 --- a/Marechai/Views/Computer/Index.cshtml +++ b/Marechai/Views/Computer/Index.cshtml @@ -31,311 +31,206 @@ ViewData["Title"] = "Computers"; } -

- Here you can consult our database.
- In this database you can find technical information as well as computers history, catalogued by companies, alfabetically and by release date.
+ Here you can consult our database. +
+ In this database you can find technical information as well as computers history, catalogued by companies, alfabetically and by release date. +
@ViewBag.ItemCount computers actually catalogued in the database.

-



Search by companies
- + Q - + W - + E - + R - + T - + Y - + U - + I - + O - + P
- + A - + S - + D - + F - + G - + H - + J - + K - + L
- + Z - + X - + C - + V - + B - + N - + M
- + All companies

Alfabetically search
- + Q - + W - + E - + R - + T - + Y - + U - + I - + O - + P
- + A - + S - + D - + F - + G - + H - + J - + K - + L
- + Z - + X - + C - + V - + B - + N - + M
- + All computers

Search by year
- @{ int counter = 0; } - @for(int i = ViewBag.MinYear; i <= ViewBag.MaxYear; i++) + @{ var counter = 0; } + @for (int i = ViewBag.MinYear; i <= ViewBag.MaxYear; i++) { { counter++; } - + @i - if(counter % 8 == 0) {
} + if (counter % 8 == 0) + { +
+ } }

\ No newline at end of file diff --git a/Marechai/Views/Console/ByLetter.cshtml b/Marechai/Views/Console/ByLetter.cshtml index 52aaaffe..b88baa30 100644 --- a/Marechai/Views/Console/ByLetter.cshtml +++ b/Marechai/Views/Console/ByLetter.cshtml @@ -31,26 +31,23 @@ ViewData["Title"] = "Consoles"; } -@using Machine = Marechai.Database.Models.Machine @model Marechai.Database.Models.Machine[] -

Search results:

- @if(ViewBag.Letter != '\0') + @if (ViewBag.Letter != '\0') { @ViewBag.Letter
} - @if(Model.Any()) + @if (Model.Any()) {

- @Model.Count() computers found in the database.
- @foreach(Machine console in Model) + @Model.Count() computers found in the database. +
+ @foreach (var console in Model) { - + @console.Company.Name @console.Name
} diff --git a/Marechai/Views/Console/ByYear.cshtml b/Marechai/Views/Console/ByYear.cshtml index d3b0e179..589fa792 100644 --- a/Marechai/Views/Console/ByYear.cshtml +++ b/Marechai/Views/Console/ByYear.cshtml @@ -31,22 +31,19 @@ ViewData["Title"] = "Computers"; } -@using Machine = Marechai.Database.Models.Machine @model Marechai.Database.Models.Machine[] -

Search results:

- @ViewBag.Year
- - @if(Model.Any()) + @ViewBag.Year +
+ @if (Model.Any()) {

- @Model.Count() videoconsoles found in the database.
- @foreach(Machine console in Model) + @Model.Count() videoconsoles found in the database. +
+ @foreach (var console in Model) { - + @console.Company.Name @console.Name
} diff --git a/Marechai/Views/Console/Index.cshtml b/Marechai/Views/Console/Index.cshtml index 50dd0f5c..e512d9cd 100644 --- a/Marechai/Views/Console/Index.cshtml +++ b/Marechai/Views/Console/Index.cshtml @@ -31,311 +31,206 @@ ViewData["Title"] = "Videoconsoles"; } -

- Here you can consult our database.
- In this database you can find technical information as well as videoconsoles history, catalogued by companies, alfabetically and by release date.
+ Here you can consult our database. +
+ In this database you can find technical information as well as videoconsoles history, catalogued by companies, alfabetically and by release date. +
@ViewBag.ItemCount videoconsoles actually catalogued in the database.

-



Search by companies
- + Q - + W - + E - + R - + T - + Y - + U - + I - + O - + P
- + A - + S - + D - + F - + G - + H - + J - + K - + L
- + Z - + X - + C - + V - + B - + N - + M
- + All companies

Alfabetically search
- + Q - + W - + E - + R - + T - + Y - + U - + I - + O - + P
- + A - + S - + D - + F - + G - + H - + J - + K - + L
- + Z - + X - + C - + V - + B - + N - + M
- + All consoles

Search by year
- @{ int counter = 0; } - @for(int i = ViewBag.MinYear; i <= ViewBag.MaxYear; i++) + @{ var counter = 0; } + @for (int i = ViewBag.MinYear; i <= ViewBag.MaxYear; i++) { { counter++; } - + @i - if(counter % 8 == 0) {
} + if (counter % 8 == 0) + { +
+ } }

\ No newline at end of file diff --git a/Marechai/Views/Home/About.cshtml b/Marechai/Views/Home/About.cshtml index 33f42155..f97aa4c3 100644 --- a/Marechai/Views/Home/About.cshtml +++ b/Marechai/Views/Home/About.cshtml @@ -32,36 +32,39 @@ ViewData["Title"] = "About"; }

@ViewData["Title"]

-

Who are we

We are a non-profit organization with the goal of conserve and restore old computers, video-consoles and arcade machines as well as to expose these machines in an office disposed for that purpose with information about computing history.

-

Where are we

Actually we are located on Gran Canary island, on Las Palmas of G.C. city, in the search of a office where start machines exhibition and restoring activities.

-

Exactly what we pretend

We pretend to conserve the computing history, as well as make it accessible to public in general, show the evolution and advance of a technology that concretely became part of any activity in our lifes..

-

How to help

- Any collector is welcome to become part of tha association as well as to let his/her collection to public exhibition.
- Another form of helping is translating the page to other languages as well as colaborating in it maintainment and improvement.
+ Any collector is welcome to become part of tha association as well as to let his/her collection to public exhibition. +
+ Another form of helping is translating the page to other languages as well as colaborating in it maintainment and improvement. +
We also agree material dontions, such as machines (consoles, computers, arcade machines, monitors, peripherals, etc) and economic donation. Money donations will be exclusively dedicated to getting an exhibition office, as well as getting new machines and parts for restoring damaged machines. Repeated machines are considered trading (change and/or sell) objects to obtain new machines.

-

Copyrights

- © 2003-2020 Natalia Portillo, all rights reserved.
- The names are property of their respective authors.
- Photos are property of their respective authors.
+ © 2003-2020 Natalia Portillo, all rights reserved. +
+ The names are property of their respective authors. +
+ Photos are property of their respective authors. +
Rest of content if property of Natalia Portillo except other indication.

-

Greetings to translators

- Natalia Portillo (English)
- Martín Lafuente (Galician)
- Cèlia Mussons (Catalan)
- Carlos Serrano (Italian)
+ Natalia Portillo (English) +
+ Martín Lafuente (Galician) +
+ Cèlia Mussons (Catalan) +
+ Carlos Serrano (Italian) +
Jocelyn Mayer (French)

\ No newline at end of file diff --git a/Marechai/Views/Home/Contact.cshtml b/Marechai/Views/Home/Contact.cshtml index e0665dd6..6383d084 100644 --- a/Marechai/Views/Home/Contact.cshtml +++ b/Marechai/Views/Home/Contact.cshtml @@ -32,10 +32,10 @@ ViewData["Title"] = "Contact"; }

@ViewData["Title"]

-
Support: - + museum@claunia.com -
+ +
\ No newline at end of file diff --git a/Marechai/Views/Home/Index.cshtml b/Marechai/Views/Home/Index.cshtml index f1d1af3b..c77f3520 100644 --- a/Marechai/Views/Home/Index.cshtml +++ b/Marechai/Views/Home/Index.cshtml @@ -31,16 +31,11 @@ ViewData["Title"] = "Home Page"; } -@using System.IO -@using News = Marechai.Database.Models.News @model List -

News

- -@foreach(NewsModel news in Model) +@foreach (var news in Model) { - +
- - - - + + + +
@news.Timestamp @@ -51,16 +46,14 @@ @news.Text
@* TODO: Image *@ - - @news.ItemName - -
@* TODO: Image *@ + + @news.ItemName + +

} \ No newline at end of file diff --git a/Marechai/Views/Machine/View.cshtml b/Marechai/Views/Machine/View.cshtml index a58674d2..35002676 100644 --- a/Marechai/Views/Machine/View.cshtml +++ b/Marechai/Views/Machine/View.cshtml @@ -33,85 +33,69 @@ } @using System.IO @using Marechai.Database -@using Marechai.Database.Models @model Marechai.Database.Models.Machine

- @if(Model.Company.LastLogo != null && File.Exists(System.IO.Path.Combine(ViewBag.WebRootPath, "assets/logos", Model.Company.LastLogo.Guid + ".svg"))) + @if (Model.Company.LastLogo != null && + File.Exists(System.IO.Path.Combine(ViewBag.WebRootPath, "assets/logos", Model.Company.LastLogo.Guid + ".svg"))) { - - + + /assets/logos/png/3x/@(Model.Company.LastLogo.Guid).png 3x" src="/assets/logos/png/1x/@(Model.Company.LastLogo.Guid).png" ) alt="" height="auto" width="auto" style="max-height: 256px; max-width: 256px" /> }

+@{ var counter = 0; } -@{ int counter = 0; } - -@if(Model.Introduced.HasValue && Model.Introduced.Value.Year == 1000) +@if (Model.Introduced.HasValue && + Model.Introduced.Value.Year == 1000) {
PROTOTYPE
} - - + @Model.Company.Name @Model.Name -@if(Model.Introduced.HasValue && Model.Introduced.Value.Year != 1000) +@if (Model.Introduced.HasValue && + Model.Introduced.Value.Year != 1000) { - } -@if(Model.Family != null) +@if (Model.Family != null) { - } -@if(Model.Model != null) +@if (Model.Model != null) { - } -@if(Model.Processors.Count > 0) +@if (Model.Processors.Count > 0) {
+
Introduction date
- + @Model.Introduced.Value.ToLongDateString()
+
Family
- + @Model.Family.Name
+
Model
@@ -121,7 +105,7 @@
@@ -132,25 +116,26 @@ @{ counter = 0; } - @foreach(ProcessorsByMachine processorByMachine in Model.Processors) + @foreach (var processorByMachine in Model.Processors) {
- @if(processorByMachine.Speed > 0) { @(processorByMachine.Processor.GprSize > 0 ? $"{processorByMachine.Processor.Name} @ {processorByMachine.Speed}Mhz ({processorByMachine.Processor.GprSize} bits)" : $"{processorByMachine.Processor.Name} @ {processorByMachine.Speed}Mhz") } + @if (processorByMachine.Speed > 0) + { + @(processorByMachine.Processor.GprSize > 0 ? $"{processorByMachine.Processor.Name} @ {processorByMachine.Speed}Mhz ({processorByMachine.Processor.GprSize} bits)" : $"{processorByMachine.Processor.Name} @ {processorByMachine.Speed}Mhz") + } else - { @($"{processorByMachine.Processor.Name}") } - -
+
- @if(processorByMachine.Processor.ModelCode != null && processorByMachine.Processor.ModelCode != processorByMachine.Processor.Name) + @if (processorByMachine.Processor.ModelCode != null && + processorByMachine.Processor.ModelCode != processorByMachine.Processor.Name) { @@ -160,63 +145,76 @@ - @if(processorByMachine.Processor.Introduced != DateTime.MinValue) + @if (processorByMachine.Processor.Introduced != DateTime.MinValue) { } - @if(processorByMachine.Processor.InstructionSet != null) + @if (processorByMachine.Processor.InstructionSet != null) { } - @if(processorByMachine.Processor.Speed > 0) + @if (processorByMachine.Processor.Speed > 0) { } - @if(processorByMachine.Processor.Gprs > 0 || processorByMachine.Processor.Fprs > 0 || processorByMachine.Processor.SimdRegisters > 0) + @if (processorByMachine.Processor.Gprs > 0 || + processorByMachine.Processor.Fprs > 0 || + processorByMachine.Processor.SimdRegisters > 0) {
Model
Manufacturer - + @processorByMachine.Processor.Company.Name
Introduction date @($"{processorByMachine.Processor.Introduced:yyyy}")
Instruction set @processorByMachine.Processor.InstructionSet.Name
Nominal speed @processorByMachine.Processor.Speed MHz
Registers - @if(processorByMachine.Processor.Gprs > 0) + @if (processorByMachine.Processor.Gprs > 0) { } - @if(processorByMachine.Processor.Fprs > 0) + @if (processorByMachine.Processor.Fprs > 0) { } - @if(processorByMachine.Processor.SimdRegisters > 0) + @if (processorByMachine.Processor.SimdRegisters > 0) { } @@ -224,14 +222,14 @@ } - @if(processorByMachine.Processor.Cores > 1) + @if (processorByMachine.Processor.Cores > 1) { } - @if(processorByMachine.Processor.Cores > 1) + @if (processorByMachine.Processor.Cores > 1) { } - @if(processorByMachine.Processor.DataBus > 0 || processorByMachine.Processor.AddrBus > 0) + @if (processorByMachine.Processor.DataBus > 0 || + processorByMachine.Processor.AddrBus > 0) {
@processorByMachine.Processor.Gprs general purpose registers of @processorByMachine.Processor.GprSize bits - @if(processorByMachine.Processor.FprSize > 0 && processorByMachine.Processor.Fprs == 0) { @($", that can be used as floating point registers of {processorByMachine.Processor.FprSize}") } - @if(processorByMachine.Processor.SimdSize > 0 && processorByMachine.Processor.SimdRegisters == 0) { @($", that can be used as SIMD registers of {processorByMachine.Processor.FprSize}") } + @if (processorByMachine.Processor.FprSize > 0 && + processorByMachine.Processor.Fprs == 0) + { + @($", that can be used as floating point registers of {processorByMachine.Processor.FprSize}") + } + @if (processorByMachine.Processor.SimdSize > 0 && + processorByMachine.Processor.SimdRegisters == 0) + { + @($", that can be used as SIMD registers of {processorByMachine.Processor.FprSize}") + }
@processorByMachine.Processor.Fprs floating-point registers of @processorByMachine.Processor.FprSize bits - @if(processorByMachine.Processor.SimdSize > 0 && processorByMachine.Processor.SimdRegisters == 0) { @($", that can be used as SIMD registers of {processorByMachine.Processor.FprSize}") } + @if (processorByMachine.Processor.SimdSize > 0 && + processorByMachine.Processor.SimdRegisters == 0) + { + @($", that can be used as SIMD registers of {processorByMachine.Processor.FprSize}") + }
- @processorByMachine.Processor.SimdRegisters SIMDregisters of @processorByMachine.Processor.SimdSize bits + @processorByMachine.Processor.SimdRegisters + SIMDregisters of @processorByMachine.Processor.SimdSize bits
Multi-core @processorByMachine.Processor.Cores cores
@@ -239,17 +237,21 @@ @processorByMachine.Processor.ThreadsPerCore threads - @if(processorByMachine.Processor.Cores > 1) { @(" per core") } + @if (processorByMachine.Processor.Cores > 1) + { + @(" per core") + }
Bus - @if(processorByMachine.Processor.DataBus > 0) + @if (processorByMachine.Processor.DataBus > 0) { } - @if(processorByMachine.Processor.AddrBus > 0) + @if (processorByMachine.Processor.AddrBus > 0) { } - @if(processorByMachine.Processor.L1Instruction > 0 || processorByMachine.Processor.L1Data > 0 || processorByMachine.Processor.L2 > 0 || processorByMachine.Processor.L2 > 0) + @if (processorByMachine.Processor.L1Instruction > 0 || + processorByMachine.Processor.L1Data > 0 || + processorByMachine.Processor.L2 > 0 || + processorByMachine.Processor.L2 > 0) {
@@ -257,7 +259,7 @@
@@ -270,13 +272,16 @@
Cache - @if(processorByMachine.Processor.L1Instruction > 0) + @if (processorByMachine.Processor.L1Instruction > 0) { } - @if(processorByMachine.Processor.L1Data > 0) + @if (processorByMachine.Processor.L1Data > 0) { } - @if(processorByMachine.Processor.L2 > 0) + @if (processorByMachine.Processor.L2 > 0) { } - @if(processorByMachine.Processor.L3 > 0) + @if (processorByMachine.Processor.L3 > 0) { } - @if(processorByMachine.Processor.Package != null) + @if (processorByMachine.Processor.Package != null) { } - @if(processorByMachine.Processor.Process != null || processorByMachine.Processor.ProcessNm > 0) + @if (processorByMachine.Processor.Process != null || + processorByMachine.Processor.ProcessNm > 0) { } - @if(processorByMachine.Processor.DieSize > 0) + @if (processorByMachine.Processor.DieSize > 0) { } - @if(processorByMachine.Processor.Transistors > 0) + @if (processorByMachine.Processor.Transistors > 0) { @@ -354,7 +366,6 @@ - counter++; @@ -363,7 +374,8 @@ } -@if(Model.Memory != null && Model.Memory.Count > 0) +@if (Model.Memory != null && + Model.Memory.Count > 0) {
@@ -284,7 +289,7 @@
@@ -292,7 +297,7 @@
@@ -300,7 +305,7 @@
@@ -312,38 +317,45 @@
Package @processorByMachine.Processor.Package
Manufacturing process - @if(processorByMachine.Processor.Process != null && processorByMachine.Processor.ProcessNm > 0) + @if (processorByMachine.Processor.Process != null && + processorByMachine.Processor.ProcessNm > 0) { @processorByMachine.Processor.Process @("@") @(processorByMachine.Processor.ProcessNm > 100 ? $"{processorByMachine.Processor.ProcessNm / 100}µm" : $"{processorByMachine.Processor.ProcessNm}nm") } - else if(processorByMachine.Processor.ProcessNm > 0) { @(processorByMachine.Processor.ProcessNm > 100 ? $"{processorByMachine.Processor.ProcessNm / 100}µm" : $"{processorByMachine.Processor.ProcessNm}nm") } + else if (processorByMachine.Processor.ProcessNm > 0) + { + @(processorByMachine.Processor.ProcessNm > 100 ? $"{processorByMachine.Processor.ProcessNm / 100}µm" : $"{processorByMachine.Processor.ProcessNm}nm") + } else - { @processorByMachine.Processor.Process } + { + @processorByMachine.Processor.Process + }
Die size @processorByMachine.Processor.DieSize mm²
Transistors
@@ -373,23 +385,51 @@ - @foreach(MemoryByMachine memory in Model.Memory) + @foreach (var memory in Model.Memory) { string memValue; - if(memory.Size > 1073741824) { memValue = $"{memory.Size / 1073741824} GiB"; } - else if(memory.Size > 1048576) { memValue = $"{memory.Size / 1048576} MiB"; } - else if(memory.Size > 1024) { memValue = $"{memory.Size / 1024} KiB"; } - else if(memory.Size > 0) { memValue = $"{memory.Size} bytes"; } + if (memory.Size > 1073741824) + { + memValue = $"{memory.Size / 1073741824} GiB"; + } + else if (memory.Size > 1048576) + { + memValue = $"{memory.Size / 1048576} MiB"; + } + else if (memory.Size > 1024) + { + memValue = $"{memory.Size / 1024} KiB"; + } + else if (memory.Size > 0) + { + memValue = $"{memory.Size} bytes"; + } else - { memValue = "Unknown size"; } + { + memValue = "Unknown size"; + } string speedValue; - if(memory.Speed > 1000000000) { speedValue = $"{memory.Speed / 1000000000} GHz"; } - else if(memory.Speed > 1000000) { speedValue = $"{memory.Speed / 1000000} MHz"; } - else if(memory.Speed > 1000) { speedValue = $"{memory.Speed / 1000} KHz"; } - else if(memory.Speed > 0) { speedValue = $"{memory.Speed} Hz"; } + if (memory.Speed > 1000000000) + { + speedValue = $"{memory.Speed / 1000000000} GHz"; + } + else if (memory.Speed > 1000000) + { + speedValue = $"{memory.Speed / 1000000} MHz"; + } + else if (memory.Speed > 1000) + { + speedValue = $"{memory.Speed / 1000} KHz"; + } + else if (memory.Speed > 0) + { + speedValue = $"{memory.Speed} Hz"; + } else - { speedValue = "unknown speed"; } + { + speedValue = "unknown speed"; + } @@ -399,7 +439,7 @@ } -@if(Model.Gpus.Count > 0) +@if (Model.Gpus.Count > 0) {
@memValue of @memory.Usage memory (@memory.Type at @speedValue)
@@ -410,23 +450,19 @@ @{ counter = 0; } - @foreach(GpusByMachine gpuByMachine in Model.Gpus) + @foreach (var gpuByMachine in Model.Gpus) { - if(gpuByMachine.Gpu.Id == -2) + if (gpuByMachine.Gpu.Id == -2) { @@ -435,18 +471,14 @@ {
Framebuffer - -
+
- This computer directly draws pixels from software to a memory region that's converted to video output by a DAC or similar without using any specific graphics processing unit. + This computer directly draws pixels from software to a memory region that's converted to video output by a + DAC or similar without using any specific graphics processing unit.
@($"{gpuByMachine.Gpu.Name}") - -
+
- @if(gpuByMachine.Gpu.ModelCode != null && gpuByMachine.Gpu.ModelCode != gpuByMachine.Gpu.Name) + @if (gpuByMachine.Gpu.ModelCode != null && + gpuByMachine.Gpu.ModelCode != gpuByMachine.Gpu.Name) { @@ -456,51 +488,56 @@ - @if(gpuByMachine.Gpu.Introduced != DateTime.MinValue) + @if (gpuByMachine.Gpu.Introduced != DateTime.MinValue) { } - @if(gpuByMachine.Gpu.Package != null) + @if (gpuByMachine.Gpu.Package != null) { } - @if(gpuByMachine.Gpu.Process != null || gpuByMachine.Gpu.ProcessNm > 0) + @if (gpuByMachine.Gpu.Process != null || + gpuByMachine.Gpu.ProcessNm > 0) { } - @if(gpuByMachine.Gpu.DieSize > 0) + @if (gpuByMachine.Gpu.DieSize > 0) { } - @if(gpuByMachine.Gpu.Transistors > 0) + @if (gpuByMachine.Gpu.Transistors > 0) { @@ -518,7 +555,7 @@ } -@if(Model.Sound.Count > 0) +@if (Model.Sound.Count > 0) {
Model
Manufacturer - + @gpuByMachine.Gpu.Company.Name
Introduction date @($"{gpuByMachine.Gpu.Introduced:yyyy}")
Package @gpuByMachine.Gpu.Package
Manufacturing process - @if(gpuByMachine.Gpu.Process != null && gpuByMachine.Gpu.ProcessNm > 0) + @if (gpuByMachine.Gpu.Process != null && + gpuByMachine.Gpu.ProcessNm > 0) { @gpuByMachine.Gpu.Process @("@") @(gpuByMachine.Gpu.ProcessNm > 100 ? $"{gpuByMachine.Gpu.ProcessNm / 100}µm" : $"{gpuByMachine.Gpu.ProcessNm}nm") } - else if(gpuByMachine.Gpu.ProcessNm > 0) { @(gpuByMachine.Gpu.ProcessNm > 100 ? $"{gpuByMachine.Gpu.ProcessNm / 100}µm" : $"{gpuByMachine.Gpu.ProcessNm}nm") } + else if (gpuByMachine.Gpu.ProcessNm > 0) + { + @(gpuByMachine.Gpu.ProcessNm > 100 ? $"{gpuByMachine.Gpu.ProcessNm / 100}µm" : $"{gpuByMachine.Gpu.ProcessNm}nm") + } else - { @gpuByMachine.Gpu.Process } + { + @gpuByMachine.Gpu.Process + }
Die size @gpuByMachine.Gpu.DieSize mm²
Transistors
@@ -529,24 +566,20 @@ @{ counter = 0; } - @foreach(SoundByMachine soundByMachine in Model.Sound) + @foreach (var soundByMachine in Model.Sound) { - @if(soundByMachine.SoundSynth.Id == -2) + @if (soundByMachine.SoundSynth.Id == -2) { @@ -555,62 +588,58 @@ {
Software - -
+
- This computer directly sends data to a DAC or similar connected to the audio output. + This computer directly sends data to a + DAC or similar connected to the audio output.
@($"{soundByMachine.SoundSynth.Name}") - -
+
- @if(soundByMachine.SoundSynth.ModelCode != null && soundByMachine.SoundSynth.ModelCode != soundByMachine.SoundSynth.Name) + @if (soundByMachine.SoundSynth.ModelCode != null && + soundByMachine.SoundSynth.ModelCode != soundByMachine.SoundSynth.Name) { } - @if(soundByMachine.SoundSynth.Company != null) + @if (soundByMachine.SoundSynth.Company != null) { } - @if(soundByMachine.SoundSynth.Introduced != DateTime.MinValue) + @if (soundByMachine.SoundSynth.Introduced != DateTime.MinValue) { } - @if(soundByMachine.SoundSynth.Voices != 0 || soundByMachine.SoundSynth.SquareWave != 0 || soundByMachine.SoundSynth.WhiteNoise != 0) + @if (soundByMachine.SoundSynth.Voices != 0 || + soundByMachine.SoundSynth.SquareWave != 0 || + soundByMachine.SoundSynth.WhiteNoise != 0) {
Model @soundByMachine.SoundSynth.ModelCode
Manufacturer - + @soundByMachine.SoundSynth.Company.Name
Introduction date @($"{soundByMachine.SoundSynth.Introduced:yyyy}")
Generators - @if(soundByMachine.SoundSynth.Voices != 0) + @if (soundByMachine.SoundSynth.Voices != 0) { } - @if(soundByMachine.SoundSynth.SquareWave != 0) + @if (soundByMachine.SoundSynth.SquareWave != 0) { } - @if(soundByMachine.SoundSynth.WhiteNoise != 0) + @if (soundByMachine.SoundSynth.WhiteNoise != 0) { @@ -620,19 +649,21 @@ } - @if(soundByMachine.SoundSynth.Depth != 0 || soundByMachine.SoundSynth.Frequency > 0) + @if (soundByMachine.SoundSynth.Depth != 0 || + soundByMachine.SoundSynth.Frequency > 0) {
@soundByMachine.SoundSynth.Voices voices
@soundByMachine.SoundSynth.SquareWave square wave
@soundByMachine.SoundSynth.WhiteNoise white noise
Sample rate - @if(soundByMachine.SoundSynth.Depth != 0 && soundByMachine.SoundSynth.Frequency > 0) + @if (soundByMachine.SoundSynth.Depth != 0 && + soundByMachine.SoundSynth.Frequency > 0) { } - else if(soundByMachine.SoundSynth.Depth != 0) + else if (soundByMachine.SoundSynth.Depth != 0) { @@ -648,7 +679,7 @@ } - @if(soundByMachine.SoundSynth.Type != 0) + @if (soundByMachine.SoundSynth.Type != 0) { @@ -669,7 +700,7 @@ } -@if(Model.Storage.Count > 0) +@if (Model.Storage.Count > 0) {
@soundByMachine.SoundSynth.Depth bits at @(soundByMachine.SoundSynth.Frequency > 1000 ? $"{soundByMachine.SoundSynth.Frequency / 1000}KHz" : $"{soundByMachine.SoundSynth.Frequency}Hz")
@soundByMachine.SoundSynth.Depth bits
Synthetizer type
@@ -679,34 +710,51 @@ - @foreach(StorageByMachine storage in Model.Storage) + @foreach (var storage in Model.Storage) { string capString = null; - if(storage.Capacity != 0) + if (storage.Capacity != 0) { - if(storage.Type == StorageType.CompactCassette) { capString = $"{storage.Capacity} bps"; } + if (storage.Type == StorageType.CompactCassette) + { + capString = $"{storage.Capacity} bps"; + } else { - if(storage.Capacity > 1073741824) { capString = $"{storage.Capacity / 1073741824} GiB"; } - else if(storage.Capacity > 1048576) { capString = $"{storage.Capacity / 1048576} MiB"; } - else if(storage.Capacity > 1024) { capString = $"{storage.Capacity / 1024} KiB"; } - else if(storage.Capacity > 0) { capString = $"{storage.Capacity} bytes"; } + if (storage.Capacity > 1073741824) + { + capString = $"{storage.Capacity / 1073741824} GiB"; + } + else if (storage.Capacity > 1048576) + { + capString = $"{storage.Capacity / 1048576} MiB"; + } + else if (storage.Capacity > 1024) + { + capString = $"{storage.Capacity / 1024} KiB"; + } + else if (storage.Capacity > 0) + { + capString = $"{storage.Capacity} bytes"; + } else - { capString = null; } + { + capString = null; + } } } - @if(storage.Interface != StorageInterface.Unknown) + @if (storage.Interface != StorageInterface.Unknown) { - if(storage.Type == StorageType.Empty) + if (storage.Type == StorageType.Empty) { } else { - if(capString != null) + if (capString != null) { } @@ -718,7 +766,7 @@ } else { - if(capString != null) + if (capString != null) { } @@ -734,9 +782,7 @@ }
Available @storage.Interface interface.@storage.Type connected thru a @storage.Interface interface with a nominal capacity of @capString@storage.Type with a nominal capacity of @capString
- -@if(File.Exists(System.IO.Path.Combine(ViewBag.WebRootPath, "assets/photos/computers", Model.Id + ".jpg"))) +@if (File.Exists(System.IO.Path.Combine(ViewBag.WebRootPath, "assets/photos/computers", Model.Id + ".jpg"))) { - + } \ No newline at end of file diff --git a/Marechai/Views/Shared/Error.cshtml b/Marechai/Views/Shared/Error.cshtml index caf4ab61..777a93fb 100644 --- a/Marechai/Views/Shared/Error.cshtml +++ b/Marechai/Views/Shared/Error.cshtml @@ -33,21 +33,22 @@ @{ ViewData["Title"] = "Error"; } - -

Error.

-

An error occurred while processing your request.

- -@if(Model.ShowRequestId) +

Error.

+

An error occurred while processing your request.

+@if (Model.ShowRequestId) {

- Request ID: @Model.RequestId + Request ID: + @Model.RequestId

} -

Development Mode

- Swapping to Development environment will display more detailed information about the error that occurred. + Swapping to + Development environment will display more detailed information about the error that occurred.

- Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application. + Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the + ASPNETCORE_ENVIRONMENT environment variable to + Development, and restarting the application.

\ No newline at end of file diff --git a/Marechai/Views/Shared/_CookieConsentPartial.cshtml b/Marechai/Views/Shared/_CookieConsentPartial.cshtml index 902525f1..5b8ac20d 100644 --- a/Marechai/Views/Shared/_CookieConsentPartial.cshtml +++ b/Marechai/Views/Shared/_CookieConsentPartial.cshtml @@ -1,6 +1,6 @@ @using Microsoft.AspNetCore.Http.Features @{ -/****************************************************************************** + /****************************************************************************** // MARECHAI: Master repository of computing history artifacts information // ---------------------------------------------------------------------------- // @@ -39,23 +39,25 @@ @if (showBanner) { -