diff --git a/.editorconfig b/.editorconfig index 8b506dab..a8635948 100644 --- a/.editorconfig +++ b/.editorconfig @@ -221,7 +221,7 @@ space_after_last_attribute=false space_before_self_closing=true attribute_style=on_single_line attribute_indent=align_by_first_attribute -sort_attributes=true +sort_attributes=false sort_class_selectors=true max_blank_lines_between_tags=0 linebreak_before_all_elements=true @@ -629,4 +629,11 @@ indent_type_constraints=true # Javascript and Typescript [*.{js,js.map,ts}] quote_style=doublequoted -termination_style=ensure_semicolon \ No newline at end of file +termination_style=ensure_semicolon + +[*.razor] +razor_always_use_end_of_line_brace_style=false +blank_lines_around_razor_sections=true +blank_lines_around_razor_helpers=true +blank_lines_around_razor_functions=true +sort_attributes=false \ No newline at end of file diff --git a/Marechai.Database/Models/MarechaiContext.cs b/Marechai.Database/Models/MarechaiContext.cs index bc6ff891..a0c94268 100644 --- a/Marechai.Database/Models/MarechaiContext.cs +++ b/Marechai.Database/Models/MarechaiContext.cs @@ -38,8 +38,7 @@ namespace Marechai.Database.Models public class MarechaiContext : IdentityDbContext { readonly ValueConverter hexToBytesConverter = - new ValueConverter(v => HexStringToBytesConverter.StringToHex(v), - v => HexStringToBytesConverter.HexToString(v)); + new(v => HexStringToBytesConverter.StringToHex(v), v => HexStringToBytesConverter.HexToString(v)); public MarechaiContext() {} @@ -142,13 +141,17 @@ namespace Marechai.Database.Models IConfigurationBuilder builder = new ConfigurationBuilder().AddJsonFile("appsettings.json"); IConfigurationRoot configuration = builder.Build(); - optionsBuilder.UseMySql(configuration.GetConnectionString("DefaultConnection"), new MariaDbServerVersion(new Version(10, 5, 0)), b=> b.UseMicrosoftJson()).UseLazyLoadingProxies(); + + optionsBuilder. + UseMySql(configuration.GetConnectionString("DefaultConnection"), + new MariaDbServerVersion(new Version(10, 5, 0)), b => b.UseMicrosoftJson()). + UseLazyLoadingProxies(); } public async Task SaveChangesWithUserAsync(string userId) { ChangeTracker.DetectChanges(); - List audits = new List(); + List audits = new(); foreach(EntityEntry entry in ChangeTracker.Entries()) { @@ -161,10 +164,10 @@ namespace Marechai.Database.Models audit.UserId = userId; audit.Table = entry.Metadata.GetTableName(); - Dictionary keys = new Dictionary(); - Dictionary olds = new Dictionary(); - Dictionary news = new Dictionary(); - List columns = new List(); + Dictionary keys = new(); + Dictionary olds = new(); + Dictionary news = new(); + List columns = new(); foreach(PropertyEntry property in entry.Properties) { diff --git a/Marechai.Database/Operations/Update.cs b/Marechai.Database/Operations/Update.cs index 7eab93d6..98901296 100644 --- a/Marechai.Database/Operations/Update.cs +++ b/Marechai.Database/Operations/Update.cs @@ -365,7 +365,7 @@ namespace Marechai.Database Console.WriteLine("Getting all items from `console_company`"); - Dictionary consoleCompanies = new Dictionary(); + Dictionary consoleCompanies = new(); dbCmd = dbCon.CreateCommand(); IDbDataAdapter dataAdapter = dbCore.GetNewDataAdapter(); dbCmd.CommandText = "SELECT * from console_company"; @@ -376,7 +376,7 @@ namespace Marechai.Database foreach(DataRow dataRow in dataSet.Tables[0].Rows) consoleCompanies.Add(int.Parse(dataRow["id"].ToString()), dataRow["company"].ToString()); - Dictionary conversionEquivalents = new Dictionary(); + Dictionary conversionEquivalents = new(); IDbTransaction trans; Console.WriteLine("Converting all items from `console_company` to `companies`"); @@ -417,7 +417,7 @@ namespace Marechai.Database } Console.WriteLine("Getting all items from `consoles`"); - Dictionary consoleIdAndCompanyId = new Dictionary(); + Dictionary consoleIdAndCompanyId = new(); dbCmd = dbCon.CreateCommand(); dataAdapter = dbCore.GetNewDataAdapter(); dbCmd.CommandText = "SELECT id,company from consoles"; @@ -1309,7 +1309,7 @@ namespace Marechai.Database Console.WriteLine("Getting all items from `music_synths`"); - Dictionary musicSynths = new Dictionary(); + Dictionary musicSynths = new(); dbCmd = dbCon.CreateCommand(); IDbDataAdapter dataAdapter = dbCore.GetNewDataAdapter(); dbCmd.CommandText = "SELECT * from music_synths"; @@ -1320,7 +1320,7 @@ namespace Marechai.Database foreach(DataRow dataRow in dataSet.Tables[0].Rows) musicSynths.Add(int.Parse(dataRow["id"].ToString()), dataRow["name"].ToString()); - Dictionary conversionEquivalents = new Dictionary(); + Dictionary conversionEquivalents = new(); Console.WriteLine("Converting all items from `music_synths` to `sound_synths`"); @@ -1359,7 +1359,7 @@ namespace Marechai.Database } Console.WriteLine("Getting all items from `consoles`"); - Dictionary consoleIdAndMusicSynthId = new Dictionary(); + Dictionary consoleIdAndMusicSynthId = new(); dbCmd = dbCon.CreateCommand(); dataAdapter = dbCore.GetNewDataAdapter(); dbCmd.CommandText = "SELECT id,music_synth from consoles"; @@ -1391,7 +1391,7 @@ namespace Marechai.Database trans.Commit(); Console.WriteLine("Getting all items from `computers`"); - Dictionary computerIdAndMusicSynthId = new Dictionary(); + Dictionary computerIdAndMusicSynthId = new(); dbCmd = dbCon.CreateCommand(); dataAdapter = dbCore.GetNewDataAdapter(); dbCmd.CommandText = "SELECT id,music_synth from computers"; diff --git a/Marechai.Database/Seeders/DocumentRoles.cs b/Marechai.Database/Seeders/DocumentRoles.cs index 5a65478f..15f25c6f 100644 --- a/Marechai.Database/Seeders/DocumentRoles.cs +++ b/Marechai.Database/Seeders/DocumentRoles.cs @@ -37,7 +37,7 @@ namespace Marechai.Database.Seeders public static void Seed(MarechaiContext context) { List existingRoles = context.DocumentRoles.ToList(); - List newDocumentRoles = new List(); + List newDocumentRoles = new(); int updatedDocumentRolesCount = 0; foreach(DocumentRole role in new[] diff --git a/Marechai.Database/Seeders/Iso4217.cs b/Marechai.Database/Seeders/Iso4217.cs index 2acf5a76..5c30947a 100644 --- a/Marechai.Database/Seeders/Iso4217.cs +++ b/Marechai.Database/Seeders/Iso4217.cs @@ -91,7 +91,7 @@ namespace Marechai.Database.Seeders } Dictionary existingCodes = context.Iso4217.ToDictionary(c => c.Code); - Dictionary newCodes = new Dictionary(); + Dictionary newCodes = new(); long modified = 0; diff --git a/Marechai.Database/Seeders/Iso639.cs b/Marechai.Database/Seeders/Iso639.cs index 7728c36e..3acab8e5 100644 --- a/Marechai.Database/Seeders/Iso639.cs +++ b/Marechai.Database/Seeders/Iso639.cs @@ -43,7 +43,7 @@ namespace Marechai.Database.Seeders IEnumerable files = Directory.EnumerateFiles("iso639", "iso-639-3_*.tab"); long modified = 0; - List codes = new List(); + List codes = new(); foreach(string file in files) { @@ -121,7 +121,7 @@ namespace Marechai.Database.Seeders } List existingCodes = context.Iso639.ToList(); - List newCodes = new List(); + List newCodes = new(); foreach(Models.Iso639 code in codes) { diff --git a/Marechai.Database/Seeders/License.cs b/Marechai.Database/Seeders/License.cs index 10968bb6..64644f8d 100644 --- a/Marechai.Database/Seeders/License.cs +++ b/Marechai.Database/Seeders/License.cs @@ -36,7 +36,7 @@ namespace Marechai.Database.Seeders public static void Seed(MarechaiContext context) { List existingLicenses = context.Licenses.ToList(); - List newLicenses = new List(); + List newLicenses = new(); int updatedLicencesCount = 0; foreach(Models.License license in new[] diff --git a/Marechai/App.razor b/Marechai/App.razor index 9633684a..747dc3a1 100644 --- a/Marechai/App.razor +++ b/Marechai/App.razor @@ -1,5 +1,5 @@ @{ -/****************************************************************************** + /****************************************************************************** // MARECHAI: Master repository of computing history artifacts information // ---------------------------------------------------------------------------- // @@ -27,7 +27,7 @@ - + diff --git a/Marechai/Areas/Identity/Pages/Account/ConfirmEmailChange.cshtml b/Marechai/Areas/Identity/Pages/Account/ConfirmEmailChange.cshtml index 1fdc107a..186c61a8 100644 --- a/Marechai/Areas/Identity/Pages/Account/ConfirmEmailChange.cshtml +++ b/Marechai/Areas/Identity/Pages/Account/ConfirmEmailChange.cshtml @@ -4,4 +4,4 @@ ViewData["Title"] = "Confirm email change"; }

@ViewData["Title"]

- \ No newline at end of file + \ No newline at end of file diff --git a/Marechai/Areas/Identity/Pages/Account/LogOut.cshtml b/Marechai/Areas/Identity/Pages/Account/LogOut.cshtml index e38c0e86..c535764a 100644 --- a/Marechai/Areas/Identity/Pages/Account/LogOut.cshtml +++ b/Marechai/Areas/Identity/Pages/Account/LogOut.cshtml @@ -7,7 +7,7 @@ public async Task OnPost() { - if (SignInManager.IsSignedIn(User)) + if(SignInManager.IsSignedIn(User)) { await SignInManager.SignOutAsync(); } diff --git a/Marechai/Areas/Identity/Pages/Account/Login.cshtml b/Marechai/Areas/Identity/Pages/Account/Login.cshtml index f716b4ee..5ad17629 100644 --- a/Marechai/Areas/Identity/Pages/Account/Login.cshtml +++ b/Marechai/Areas/Identity/Pages/Account/Login.cshtml @@ -52,7 +52,7 @@

Use another service to log in.


@{ - if ((Model.ExternalLogins?.Count ?? 0) == 0) + if((Model.ExternalLogins?.Count ?? 0) == 0) {

@@ -64,17 +64,17 @@ } else { -

+

- @foreach (var provider in Model.ExternalLogins) + @foreach(var provider in Model.ExternalLogins) { - + }

- } +} }
diff --git a/Marechai/Areas/Identity/Pages/Account/LoginWith2fa.cshtml b/Marechai/Areas/Identity/Pages/Account/LoginWith2fa.cshtml index 3407a47d..b2acddca 100644 --- a/Marechai/Areas/Identity/Pages/Account/LoginWith2fa.cshtml +++ b/Marechai/Areas/Identity/Pages/Account/LoginWith2fa.cshtml @@ -8,12 +8,12 @@

Your login is protected with an authenticator app. Enter your authenticator code below.

-
+
- +
@@ -32,7 +32,7 @@

Don't have access to your authenticator device? You can - log in with a recovery code. + log in with a recovery code.

@section Scripts { diff --git a/Marechai/Areas/Identity/Pages/Account/LoginWithRecoveryCode.cshtml b/Marechai/Areas/Identity/Pages/Account/LoginWithRecoveryCode.cshtml index 88e9cbf0..b6090f05 100644 --- a/Marechai/Areas/Identity/Pages/Account/LoginWithRecoveryCode.cshtml +++ b/Marechai/Areas/Identity/Pages/Account/LoginWithRecoveryCode.cshtml @@ -15,7 +15,7 @@
- +
diff --git a/Marechai/Areas/Identity/Pages/Account/Manage/ChangePassword.cshtml b/Marechai/Areas/Identity/Pages/Account/Manage/ChangePassword.cshtml index e5a268b5..c799b83b 100644 --- a/Marechai/Areas/Identity/Pages/Account/Manage/ChangePassword.cshtml +++ b/Marechai/Areas/Identity/Pages/Account/Manage/ChangePassword.cshtml @@ -5,7 +5,7 @@ ViewData["ActivePage"] = ManageNavPages.ChangePassword; }

@ViewData["Title"]

- +
diff --git a/Marechai/Areas/Identity/Pages/Account/Manage/DeletePersonalData.cshtml b/Marechai/Areas/Identity/Pages/Account/Manage/DeletePersonalData.cshtml index 6aa3c747..88473bf5 100644 --- a/Marechai/Areas/Identity/Pages/Account/Manage/DeletePersonalData.cshtml +++ b/Marechai/Areas/Identity/Pages/Account/Manage/DeletePersonalData.cshtml @@ -13,7 +13,7 @@
- @if (Model.RequirePassword) + @if(Model.RequirePassword) {
diff --git a/Marechai/Areas/Identity/Pages/Account/Manage/Disable2fa.cshtml b/Marechai/Areas/Identity/Pages/Account/Manage/Disable2fa.cshtml index 42dae504..c41bd904 100644 --- a/Marechai/Areas/Identity/Pages/Account/Manage/Disable2fa.cshtml +++ b/Marechai/Areas/Identity/Pages/Account/Manage/Disable2fa.cshtml @@ -4,7 +4,7 @@ ViewData["Title"] = "Disable two-factor authentication (2FA)"; ViewData["ActivePage"] = ManageNavPages.TwoFactorAuthentication; } - +

@ViewData["Title"]