diff --git a/Hcs.Broker/Api/Payload/Bills/ImportPaymentDocumentDataPayload.cs b/Hcs.Broker/Api/Payload/Bills/ImportPaymentDocumentDataPayload.cs
index 24ec34b..dc693dc 100644
--- a/Hcs.Broker/Api/Payload/Bills/ImportPaymentDocumentDataPayload.cs
+++ b/Hcs.Broker/Api/Payload/Bills/ImportPaymentDocumentDataPayload.cs
@@ -1,5 +1,4 @@
-using Hcs.Broker.Api.Registry;
-using Hcs.Broker.Api.Type;
+using Hcs.Broker.Api.Type;
namespace Hcs.Broker.Api.Payload.Bills
{
diff --git a/Hcs.Broker/Api/Payload/DeviceMetering/ExportMeteringDeviceHistoryPayload.cs b/Hcs.Broker/Api/Payload/DeviceMetering/ExportMeteringDeviceHistoryPayload.cs
index 5448349..571efc1 100644
--- a/Hcs.Broker/Api/Payload/DeviceMetering/ExportMeteringDeviceHistoryPayload.cs
+++ b/Hcs.Broker/Api/Payload/DeviceMetering/ExportMeteringDeviceHistoryPayload.cs
@@ -1,6 +1,4 @@
-using Hcs.Broker.Api.Registry;
-
-namespace Hcs.Broker.Api.Payload.DeviceMetering
+namespace Hcs.Broker.Api.Payload.DeviceMetering
{
// http://open-gkh.ru/DeviceMetering/exportMeteringDeviceHistoryRequest.html
public class ExportMeteringDeviceHistoryPayload
diff --git a/Hcs.Broker/Api/Payload/HouseManagement/ImportContractDataPayload.cs b/Hcs.Broker/Api/Payload/HouseManagement/ImportContractDataPayload.cs
index 836ab13..8cf479b 100644
--- a/Hcs.Broker/Api/Payload/HouseManagement/ImportContractDataPayload.cs
+++ b/Hcs.Broker/Api/Payload/HouseManagement/ImportContractDataPayload.cs
@@ -1,5 +1,4 @@
-using Hcs.Broker.Api.Registry;
-using Hcs.Service.Async.HouseManagement;
+using Hcs.Service.Async.HouseManagement;
namespace Hcs.Broker.Api.Payload.HouseManagement
{
diff --git a/Hcs.Broker/Api/Payload/HouseManagement/ImportLivingHouseUODataPayload.cs b/Hcs.Broker/Api/Payload/HouseManagement/ImportLivingHouseUODataPayload.cs
index 89ae01a..72b4a8a 100644
--- a/Hcs.Broker/Api/Payload/HouseManagement/ImportLivingHouseUODataPayload.cs
+++ b/Hcs.Broker/Api/Payload/HouseManagement/ImportLivingHouseUODataPayload.cs
@@ -1,5 +1,4 @@
-using Hcs.Broker.Api.Registry;
-using Hcs.Service.Async.HouseManagement;
+using Hcs.Service.Async.HouseManagement;
namespace Hcs.Broker.Api.Payload.HouseManagement
{
diff --git a/Hcs.Broker/Api/Registry/RegistryElement.cs b/Hcs.Broker/Api/Payload/RegistryElement.cs
similarity index 81%
rename from Hcs.Broker/Api/Registry/RegistryElement.cs
rename to Hcs.Broker/Api/Payload/RegistryElement.cs
index eee17d7..c66f5ac 100644
--- a/Hcs.Broker/Api/Registry/RegistryElement.cs
+++ b/Hcs.Broker/Api/Payload/RegistryElement.cs
@@ -1,4 +1,4 @@
-namespace Hcs.Broker.Api.Registry
+namespace Hcs.Broker.Api.Payload
{
public class RegistryElement(string code, string guid)
{
diff --git a/Hcs.Broker/Api/Registry/Registry16.cs b/Hcs.Broker/Api/Registry/Registry16.cs
deleted file mode 100644
index 03b33e8..0000000
--- a/Hcs.Broker/Api/Registry/Registry16.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-namespace Hcs.Broker.Api.Registry
-{
- ///
- /// НСИ "Межповерочный интервал" (реестровый номер 16).
- /// Взято из https://dom.gosuslugi.ru/opendataapi/nsi-16/v1.
- ///
- public static class Registry16
- {
- ///
- /// 4 года
- ///
- public static RegistryElement Element4 => new(
- "4",
- "e5e3288d-2994-41f7-8e44-f329b09ab77f");
- }
-}
diff --git a/Hcs.Broker/Api/Registry/Registry2.cs b/Hcs.Broker/Api/Registry/Registry2.cs
deleted file mode 100644
index 2a27fcd..0000000
--- a/Hcs.Broker/Api/Registry/Registry2.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-namespace Hcs.Broker.Api.Registry
-{
- ///
- /// НСИ "Коммунальный ресурс" (реестровый номер 2).
- /// Взято из https://dom.gosuslugi.ru/opendataapi/nsi-2/v1.
- ///
- public static class Registry2
- {
- ///
- /// Тепловая энергия
- ///
- public static RegistryElement Element5 => new(
- "5",
- "44af905f-09c3-4cc3-b749-70048a53d8cf");
- }
-}
diff --git a/Hcs.Broker/Api/Registry/Registry239.cs b/Hcs.Broker/Api/Registry/Registry239.cs
deleted file mode 100644
index 2956bef..0000000
--- a/Hcs.Broker/Api/Registry/Registry239.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-namespace Hcs.Broker.Api.Registry
-{
- ///
- /// НСИ "Тарифицируемый ресурс" (реестровый номер 239).
- /// Взято из https://dom.gosuslugi.ru/opendataapi/nsi-239/v1.
- ///
- public static class Registry239
- {
- ///
- /// Тепловая энергия
- ///
- public static RegistryElement Element4 => new(
- "4",
- "eec6e4b8-76c8-4fce-99b7-c95718edad19");
- }
-}
diff --git a/Hcs.Broker/Api/Registry/Registry24.cs b/Hcs.Broker/Api/Registry/Registry24.cs
deleted file mode 100644
index 6240cdb..0000000
--- a/Hcs.Broker/Api/Registry/Registry24.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-namespace Hcs.Broker.Api.Registry
-{
- ///
- /// НСИ "Состояние дома" (реестровый номер 24).
- /// Взято из https://dom.gosuslugi.ru/opendataapi/nsi-24/v1.
- ///
- public static class Registry24
- {
- ///
- /// Аварийный
- ///
- public static RegistryElement Element1 => new(
- "1",
- "cbe05853-a91b-43cc-a2cb-06cdfa97d492");
-
- ///
- /// Исправный
- ///
- public static RegistryElement Element2 => new(
- "2",
- "2d3ae73e-6c72-4740-9122-9c632d1893a7");
-
- ///
- /// Ветхий
- ///
- public static RegistryElement Element3 => new(
- "3",
- "bf083ae4-e4ec-4ace-b190-4d009e5cd1a1");
-
- ///
- /// Не выбран
- ///
- public static RegistryElement Element4 => new(
- "4",
- "4ee07c0b-82d6-41f4-a8c5-2cff784bbd9c");
- }
-}
diff --git a/Hcs.Broker/Api/Registry/Registry27.cs b/Hcs.Broker/Api/Registry/Registry27.cs
deleted file mode 100644
index fcbcd5b..0000000
--- a/Hcs.Broker/Api/Registry/Registry27.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-namespace Hcs.Broker.Api.Registry
-{
- ///
- /// НСИ "Тип прибора учета" (реестровый номер 27).
- /// Взято из https://dom.gosuslugi.ru/opendataapi/nsi-27/v1.
- ///
- public static class Registry27
- {
- ///
- /// Индивидуальный
- ///
- public static RegistryElement Element1 => new(
- "1",
- "3a9687b5-caed-4ec6-8a08-f4d3d012f2c7");
- }
-}
diff --git a/Hcs.Broker/Api/Registry/Registry276.cs b/Hcs.Broker/Api/Registry/Registry276.cs
deleted file mode 100644
index 5ad4184..0000000
--- a/Hcs.Broker/Api/Registry/Registry276.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-namespace Hcs.Broker.Api.Registry
-{
- ///
- /// НСИ "Показатели качества коммунальных ресурсов" (реестровый номер 276).
- /// Взято из https://dom.gosuslugi.ru/opendataapi/nsi-276/v1.
- ///
- public static class Registry276
- {
- ///
- /// Величина тепловой нагрузки
- ///
- public static RegistryElement Element4 => new(
- "4",
- "51dd6edc-83fe-4810-8b62-4dc85a75e9a3");
-
- ///
- /// Диапазон давления теплоносителя в подающем трубопроводе
- ///
- public static RegistryElement Element10 => new(
- "10",
- "a5a17c90-cc4b-4f32-a22b-6e06cd42a68c");
- }
-}
diff --git a/Hcs.Broker/Api/Registry/Registry3.cs b/Hcs.Broker/Api/Registry/Registry3.cs
deleted file mode 100644
index 1956911..0000000
--- a/Hcs.Broker/Api/Registry/Registry3.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-namespace Hcs.Broker.Api.Registry
-{
- ///
- /// НСИ "Вид коммунальной услуги" (реестровый номер 3).
- /// Взято из https://dom.gosuslugi.ru/opendataapi/nsi-3/v1.
- ///
- public static class Registry3
- {
- ///
- /// Отопление
- ///
- public static RegistryElement Element6 => new(
- "6",
- "74925764-ddf3-4b4b-b18d-85994187c13a");
- }
-}
diff --git a/Hcs.Broker/Api/Registry/Registry32.cs b/Hcs.Broker/Api/Registry/Registry32.cs
deleted file mode 100644
index e54117e..0000000
--- a/Hcs.Broker/Api/Registry/Registry32.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-namespace Hcs.Broker.Api.Registry
-{
- ///
- /// НСИ "Часовые зоны по Olson" (реестровый номер 32).
- /// Взято из https://dom.gosuslugi.ru/opendataapi/nsi-32/v1.
- ///
- public static class Registry32
- {
- ///
- /// Иркутск
- ///
- public static RegistryElement Element11 => new(
- "11",
- "244ae392-0b96-46f2-80ea-4dac32e7326a");
- }
-}
diff --git a/Hcs.Broker/Api/Registry/Registry338.cs b/Hcs.Broker/Api/Registry/Registry338.cs
deleted file mode 100644
index 667b192..0000000
--- a/Hcs.Broker/Api/Registry/Registry338.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-namespace Hcs.Broker.Api.Registry
-{
- ///
- /// НСИ "Стадия жизненного цикла" (реестровый номер 338).
- /// Взято из https://dom.gosuslugi.ru/opendataapi/nsi-338/v1.
- ///
- public static class Registry338
- {
- ///
- /// Эксплуатация
- ///
- public static RegistryElement Element1 => new(
- "1",
- "29b18683-5195-4ef4-83fc-71bf45597d46");
-
- ///
- /// Реконструкция
- ///
- public static RegistryElement Element2 => new(
- "2",
- "75764145-f181-47e5-bff1-1306a46eb20e");
-
- ///
- /// Капитальный ремонт с отселением
- ///
- public static RegistryElement Element3 => new(
- "3",
- "dee170df-db42-4cd6-9e5e-b62be91b3663");
-
- ///
- /// Капитальный ремонт без отселения
- ///
- public static RegistryElement Element4 => new(
- "4",
- "91dc91e2-6883-4c84-b711-53f57f28dbe2");
-
- ///
- /// Снос
- ///
- public static RegistryElement Element5 => new(
- "5",
- "cc358aa9-10b3-4d6a-bbec-c5f6b14950f6");
-
- ///
- /// Не эксплуатируется, расселен
- ///
- public static RegistryElement Element6 => new(
- "6",
- "4bed3d7e-6015-428e-b4b4-7b7aec171c0d");
-
- ///
- /// Выведен из эксплуатации
- ///
- public static RegistryElement Element7 => new(
- "7",
- "f3edc065-c1a1-4110-96fa-03313ae7a039");
- }
-}
diff --git a/Hcs.Broker/Api/Registry/Registry51.cs b/Hcs.Broker/Api/Registry/Registry51.cs
deleted file mode 100644
index 56a5723..0000000
--- a/Hcs.Broker/Api/Registry/Registry51.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-namespace Hcs.Broker.Api.Registry
-{
- ///
- /// НСИ "Вид коммунальной услуги" (реестровый номер 51)
- ///
- public static class Registry51
- {
- ///
- /// Отопление
- ///
- public static RegistryElement Element6_1 => new(
- "6.1",
- "14ad13a3-45ce-408b-b641-6fc59554f803");
- }
-}
diff --git a/Hcs.Broker/Api/Registry/Registry58.cs b/Hcs.Broker/Api/Registry/Registry58.cs
deleted file mode 100644
index 3a78ad3..0000000
--- a/Hcs.Broker/Api/Registry/Registry58.cs
+++ /dev/null
@@ -1,79 +0,0 @@
-namespace Hcs.Broker.Api.Registry
-{
- ///
- /// НСИ "Основание заключения договора" (реестровый номер 58).
- /// Взято из https://dom.gosuslugi.ru/opendataapi/nsi-58/v1.
- ///
- public static class Registry58
- {
- ///
- /// Решение собрания собственников
- ///
- public static RegistryElement Element1 => new(
- "1",
- "110d48b2-32a9-4a44-939c-b784d9794621");
-
- ///
- /// Открытый конкурс
- ///
- public static RegistryElement Element2 => new(
- "2",
- "a9dc59c3-d53f-42eb-ba98-cf8c74d88d36");
-
- ///
- /// Договор управления
- ///
- public static RegistryElement Element3 => new(
- "3",
- "11efe618-79f8-4f53-bfd6-11620e8e9e1e");
-
- ///
- /// Устав
- ///
- public static RegistryElement Element4 => new(
- "4",
- "a2eb920c-8163-4958-812a-ad153a5dfde6");
-
- ///
- /// Решение правления
- ///
- public static RegistryElement Element5 => new(
- "5",
- "58639715-2708-4b8e-a5e6-7cae4ddbf03b");
-
- ///
- /// Решение органа управления застройщика
- ///
- public static RegistryElement Element6 => new(
- "6",
- "9b606ef5-7701-4a12-a837-d81b50939160");
-
- ///
- /// Заявление потребителя
- ///
- public static RegistryElement Element7 => new(
- "7",
- "93cd9d85-91b8-4bf9-ae48-c5f1e691949f");
-
- ///
- /// Нормативный правовой акт
- ///
- public static RegistryElement Element8 => new(
- "8",
- "8b8ee37b-fa79-40cc-b98d-0e51f0c38d03");
-
- ///
- /// Разрешение на ввод в эксплуатацию
- ///
- public static RegistryElement Element9 => new(
- "9",
- "16331000-d96e-4a33-a6c7-3cb9eacf4927");
-
- ///
- /// Устав
- ///
- public static RegistryElement Element10 => new(
- "10",
- "555638ae-a207-46fa-99bd-88bdb297c45a");
- }
-}
diff --git a/Hcs.WebApp/Components/Pages/Management/Users.razor b/Hcs.WebApp/Components/Pages/Management/Users.razor
index 95d8032..f2c978f 100644
--- a/Hcs.WebApp/Components/Pages/Management/Users.razor
+++ b/Hcs.WebApp/Components/Pages/Management/Users.razor
@@ -1,11 +1,11 @@
@page "/management/users"
+@using System.IdentityModel.Claims
@using Hcs.WebApp.Components.Dialogs
@using Hcs.WebApp.Services
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Identity
@using Microsoft.EntityFrameworkCore
-@using System.IdentityModel.Claims
@attribute [Authorize]
diff --git a/Hcs.WebApp/Components/_Imports.razor b/Hcs.WebApp/Components/_Imports.razor
index a43542d..a7b667c 100644
--- a/Hcs.WebApp/Components/_Imports.razor
+++ b/Hcs.WebApp/Components/_Imports.razor
@@ -4,7 +4,8 @@
@using Hcs.WebApp.Components
@using Hcs.WebApp.Components.Layout
@using Hcs.WebApp.Components.Shared
-@using Hcs.WebApp.Data
+@using Hcs.WebApp.Data.Hcs
+@using Hcs.WebApp.Data.Identity
@using Microsoft.AspNetCore.Components.Authorization
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Components.Routing
diff --git a/Hcs.WebApp/Controllers/IdentityController.cs b/Hcs.WebApp/Controllers/IdentityController.cs
index b05e809..606e746 100644
--- a/Hcs.WebApp/Controllers/IdentityController.cs
+++ b/Hcs.WebApp/Controllers/IdentityController.cs
@@ -1,4 +1,4 @@
-using Hcs.WebApp.Data;
+using Hcs.WebApp.Data.Identity;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
diff --git a/Hcs.WebApp/Data/Hcs/HcsDbContext.cs b/Hcs.WebApp/Data/Hcs/HcsDbContext.cs
new file mode 100644
index 0000000..148b90a
--- /dev/null
+++ b/Hcs.WebApp/Data/Hcs/HcsDbContext.cs
@@ -0,0 +1,12 @@
+using Microsoft.AspNetCore.Identity;
+using Microsoft.EntityFrameworkCore;
+
+namespace Hcs.WebApp.Data.Hcs
+{
+ public class HcsDbContext(DbContextOptions options) : DbContext(options)
+ {
+ public DbSet Registries { get; set; }
+
+ public DbSet Elements { get; set; }
+ }
+}
diff --git a/Hcs.WebApp/Data/Hcs/Migrations/20251022073558_CreateHcsSchema.Designer.cs b/Hcs.WebApp/Data/Hcs/Migrations/20251022073558_CreateHcsSchema.Designer.cs
new file mode 100644
index 0000000..092737e
--- /dev/null
+++ b/Hcs.WebApp/Data/Hcs/Migrations/20251022073558_CreateHcsSchema.Designer.cs
@@ -0,0 +1,82 @@
+//
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+namespace Hcs.WebApp.Data.Hcs.Migrations
+{
+ [DbContext(typeof(HcsDbContext))]
+ [Migration("20251022073558_CreateHcsSchema")]
+ partial class CreateHcsSchema
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "9.0.9")
+ .HasAnnotation("Relational:MaxIdentifierLength", 128);
+
+ SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
+
+ modelBuilder.Entity("Hcs.WebApp.Data.Hcs.Registry", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("Number")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("Registries");
+ });
+
+ modelBuilder.Entity("Hcs.WebApp.Data.Hcs.RegistryElement", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("Code")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("GUID")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("RegistryId")
+ .IsRequired()
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("Xml")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("RegistryId");
+
+ b.ToTable("Elements");
+ });
+
+ modelBuilder.Entity("Hcs.WebApp.Data.Hcs.RegistryElement", b =>
+ {
+ b.HasOne("Hcs.WebApp.Data.Hcs.Registry", "Registry")
+ .WithMany("Elements")
+ .HasForeignKey("RegistryId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Registry");
+ });
+
+ modelBuilder.Entity("Hcs.WebApp.Data.Hcs.Registry", b =>
+ {
+ b.Navigation("Elements");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/Hcs.WebApp/Data/Hcs/Migrations/20251022073558_CreateHcsSchema.cs b/Hcs.WebApp/Data/Hcs/Migrations/20251022073558_CreateHcsSchema.cs
new file mode 100644
index 0000000..b18b3d5
--- /dev/null
+++ b/Hcs.WebApp/Data/Hcs/Migrations/20251022073558_CreateHcsSchema.cs
@@ -0,0 +1,61 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+namespace Hcs.WebApp.Data.Hcs.Migrations
+{
+ ///
+ public partial class CreateHcsSchema : Migration
+ {
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.CreateTable(
+ name: "Registries",
+ columns: table => new
+ {
+ Id = table.Column(type: "nvarchar(450)", nullable: false),
+ Number = table.Column(type: "int", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Registries", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Elements",
+ columns: table => new
+ {
+ Id = table.Column(type: "nvarchar(450)", nullable: false),
+ RegistryId = table.Column(type: "nvarchar(450)", nullable: false),
+ Code = table.Column(type: "nvarchar(max)", nullable: false),
+ GUID = table.Column(type: "nvarchar(max)", nullable: false),
+ Xml = table.Column(type: "nvarchar(max)", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Elements", x => x.Id);
+ table.ForeignKey(
+ name: "FK_Elements_Registries_RegistryId",
+ column: x => x.RegistryId,
+ principalTable: "Registries",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Elements_RegistryId",
+ table: "Elements",
+ column: "RegistryId");
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropTable(
+ name: "Elements");
+
+ migrationBuilder.DropTable(
+ name: "Registries");
+ }
+ }
+}
diff --git a/Hcs.WebApp/Data/Hcs/Migrations/HcsDbContextModelSnapshot.cs b/Hcs.WebApp/Data/Hcs/Migrations/HcsDbContextModelSnapshot.cs
new file mode 100644
index 0000000..9ee9958
--- /dev/null
+++ b/Hcs.WebApp/Data/Hcs/Migrations/HcsDbContextModelSnapshot.cs
@@ -0,0 +1,79 @@
+//
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+
+#nullable disable
+namespace Hcs.WebApp.Data.Hcs.Migrations
+{
+ [DbContext(typeof(HcsDbContext))]
+ partial class HcsDbContextModelSnapshot : ModelSnapshot
+ {
+ protected override void BuildModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "9.0.9")
+ .HasAnnotation("Relational:MaxIdentifierLength", 128);
+
+ SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
+
+ modelBuilder.Entity("Hcs.WebApp.Data.Hcs.Registry", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("Number")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("Registries");
+ });
+
+ modelBuilder.Entity("Hcs.WebApp.Data.Hcs.RegistryElement", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("Code")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("GUID")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("RegistryId")
+ .IsRequired()
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("Xml")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("RegistryId");
+
+ b.ToTable("Elements");
+ });
+
+ modelBuilder.Entity("Hcs.WebApp.Data.Hcs.RegistryElement", b =>
+ {
+ b.HasOne("Hcs.WebApp.Data.Hcs.Registry", "Registry")
+ .WithMany("Elements")
+ .HasForeignKey("RegistryId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Registry");
+ });
+
+ modelBuilder.Entity("Hcs.WebApp.Data.Hcs.Registry", b =>
+ {
+ b.Navigation("Elements");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/Hcs.WebApp/Data/Hcs/Registry.cs b/Hcs.WebApp/Data/Hcs/Registry.cs
new file mode 100644
index 0000000..330931c
--- /dev/null
+++ b/Hcs.WebApp/Data/Hcs/Registry.cs
@@ -0,0 +1,11 @@
+namespace Hcs.WebApp.Data.Hcs
+{
+ public class Registry
+ {
+ public string Id { get; set; }
+
+ public int Number { get; set; }
+
+ public virtual ICollection Elements { get; set; } = [];
+ }
+}
diff --git a/Hcs.WebApp/Data/Hcs/RegistryElement.cs b/Hcs.WebApp/Data/Hcs/RegistryElement.cs
new file mode 100644
index 0000000..cb9bd65
--- /dev/null
+++ b/Hcs.WebApp/Data/Hcs/RegistryElement.cs
@@ -0,0 +1,17 @@
+namespace Hcs.WebApp.Data.Hcs
+{
+ public class RegistryElement
+ {
+ public string Id { get; set; }
+
+ public string RegistryId { get; set; }
+
+ public virtual Registry Registry { get; set; } = null!;
+
+ public string Code { get; set; }
+
+ public string GUID { get; set; }
+
+ public virtual string Xml { get; set; }
+ }
+}
diff --git a/Hcs.WebApp/Data/AppIdentityDbContext.cs b/Hcs.WebApp/Data/Identity/AppIdentityDbContext.cs
similarity index 99%
rename from Hcs.WebApp/Data/AppIdentityDbContext.cs
rename to Hcs.WebApp/Data/Identity/AppIdentityDbContext.cs
index cda9ca3..126d287 100644
--- a/Hcs.WebApp/Data/AppIdentityDbContext.cs
+++ b/Hcs.WebApp/Data/Identity/AppIdentityDbContext.cs
@@ -3,7 +3,7 @@ using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
-namespace Hcs.WebApp.Data
+namespace Hcs.WebApp.Data.Identity
{
public class AppIdentityDbContext(DbContextOptions options) : IdentityDbContext(options)
{
diff --git a/Hcs.WebApp/Data/AppRole.cs b/Hcs.WebApp/Data/Identity/AppRole.cs
similarity index 90%
rename from Hcs.WebApp/Data/AppRole.cs
rename to Hcs.WebApp/Data/Identity/AppRole.cs
index 83e098a..ee5d88e 100644
--- a/Hcs.WebApp/Data/AppRole.cs
+++ b/Hcs.WebApp/Data/Identity/AppRole.cs
@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Identity;
-namespace Hcs.WebApp.Data
+namespace Hcs.WebApp.Data.Identity
{
public class AppRole : IdentityRole
{
diff --git a/Hcs.WebApp/Data/AppUser.cs b/Hcs.WebApp/Data/Identity/AppUser.cs
similarity index 86%
rename from Hcs.WebApp/Data/AppUser.cs
rename to Hcs.WebApp/Data/Identity/AppUser.cs
index 478e545..7af235f 100644
--- a/Hcs.WebApp/Data/AppUser.cs
+++ b/Hcs.WebApp/Data/Identity/AppUser.cs
@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Identity;
-namespace Hcs.WebApp.Data
+namespace Hcs.WebApp.Data.Identity
{
public class AppUser : IdentityUser
{
diff --git a/Hcs.WebApp/Data/AppUserWithRole.cs b/Hcs.WebApp/Data/Identity/AppUserWithRole.cs
similarity index 77%
rename from Hcs.WebApp/Data/AppUserWithRole.cs
rename to Hcs.WebApp/Data/Identity/AppUserWithRole.cs
index 185392e..9e957e9 100644
--- a/Hcs.WebApp/Data/AppUserWithRole.cs
+++ b/Hcs.WebApp/Data/Identity/AppUserWithRole.cs
@@ -1,4 +1,4 @@
-namespace Hcs.WebApp.Data
+namespace Hcs.WebApp.Data.Identity
{
public class AppUserWithRole
{
diff --git a/Hcs.WebApp/Data/Migrations/00000000000000_CreateIdentitySchema.Designer.cs b/Hcs.WebApp/Data/Identity/Migrations/00000000000000_CreateIdentitySchema.Designer.cs
similarity index 99%
rename from Hcs.WebApp/Data/Migrations/00000000000000_CreateIdentitySchema.Designer.cs
rename to Hcs.WebApp/Data/Identity/Migrations/00000000000000_CreateIdentitySchema.Designer.cs
index 8bfd051..926701e 100644
--- a/Hcs.WebApp/Data/Migrations/00000000000000_CreateIdentitySchema.Designer.cs
+++ b/Hcs.WebApp/Data/Identity/Migrations/00000000000000_CreateIdentitySchema.Designer.cs
@@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
-namespace Hcs.WebApp.Data.Migrations
+namespace Hcs.WebApp.Data.Identity.Migrations
{
[DbContext(typeof(AppIdentityDbContext))]
[Migration("00000000000000_CreateIdentitySchema")]
diff --git a/Hcs.WebApp/Data/Migrations/00000000000000_CreateIdentitySchema.cs b/Hcs.WebApp/Data/Identity/Migrations/00000000000000_CreateIdentitySchema.cs
similarity index 99%
rename from Hcs.WebApp/Data/Migrations/00000000000000_CreateIdentitySchema.cs
rename to Hcs.WebApp/Data/Identity/Migrations/00000000000000_CreateIdentitySchema.cs
index 052ba4a..e3501f4 100644
--- a/Hcs.WebApp/Data/Migrations/00000000000000_CreateIdentitySchema.cs
+++ b/Hcs.WebApp/Data/Identity/Migrations/00000000000000_CreateIdentitySchema.cs
@@ -1,7 +1,7 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
-namespace Hcs.WebApp.Data.Migrations
+namespace Hcs.WebApp.Data.Identity.Migrations
{
///
public partial class CreateIdentitySchema : Migration
diff --git a/Hcs.WebApp/Data/Migrations/20251019083804_AddRolePriority.Designer.cs b/Hcs.WebApp/Data/Identity/Migrations/20251019083804_AddRolePriority.Designer.cs
similarity index 99%
rename from Hcs.WebApp/Data/Migrations/20251019083804_AddRolePriority.Designer.cs
rename to Hcs.WebApp/Data/Identity/Migrations/20251019083804_AddRolePriority.Designer.cs
index 1b15159..161cfaa 100644
--- a/Hcs.WebApp/Data/Migrations/20251019083804_AddRolePriority.Designer.cs
+++ b/Hcs.WebApp/Data/Identity/Migrations/20251019083804_AddRolePriority.Designer.cs
@@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
-namespace Hcs.WebApp.Data.Migrations
+namespace Hcs.WebApp.Data.Identity.Migrations
{
[DbContext(typeof(AppIdentityDbContext))]
[Migration("20251019083804_AddRolePriority")]
diff --git a/Hcs.WebApp/Data/Migrations/20251019083804_AddRolePriority.cs b/Hcs.WebApp/Data/Identity/Migrations/20251019083804_AddRolePriority.cs
similarity index 94%
rename from Hcs.WebApp/Data/Migrations/20251019083804_AddRolePriority.cs
rename to Hcs.WebApp/Data/Identity/Migrations/20251019083804_AddRolePriority.cs
index 00b2a67..6bf243e 100644
--- a/Hcs.WebApp/Data/Migrations/20251019083804_AddRolePriority.cs
+++ b/Hcs.WebApp/Data/Identity/Migrations/20251019083804_AddRolePriority.cs
@@ -1,7 +1,7 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
-namespace Hcs.WebApp.Data.Migrations
+namespace Hcs.WebApp.Data.Identity.Migrations
{
///
public partial class AddRolePriority : Migration
diff --git a/Hcs.WebApp/Data/Migrations/AppIdentityDbContextModelSnapshot.cs b/Hcs.WebApp/Data/Identity/Migrations/AppIdentityDbContextModelSnapshot.cs
similarity index 99%
rename from Hcs.WebApp/Data/Migrations/AppIdentityDbContextModelSnapshot.cs
rename to Hcs.WebApp/Data/Identity/Migrations/AppIdentityDbContextModelSnapshot.cs
index 0926a33..32cbb31 100644
--- a/Hcs.WebApp/Data/Migrations/AppIdentityDbContextModelSnapshot.cs
+++ b/Hcs.WebApp/Data/Identity/Migrations/AppIdentityDbContextModelSnapshot.cs
@@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
#nullable disable
-namespace Hcs.WebApp.Data.Migrations
+namespace Hcs.WebApp.Data.Identity.Migrations
{
[DbContext(typeof(AppIdentityDbContext))]
public partial class AppIdentityDbContextModelSnapshot : ModelSnapshot
diff --git a/Hcs.WebApp/Program.cs b/Hcs.WebApp/Program.cs
index 7cb9324..9b030f2 100644
--- a/Hcs.WebApp/Program.cs
+++ b/Hcs.WebApp/Program.cs
@@ -1,6 +1,7 @@
using Hcs.WebApp.Components;
using Hcs.WebApp.Components.Shared;
-using Hcs.WebApp.Data;
+using Hcs.WebApp.Data.Hcs;
+using Hcs.WebApp.Data.Identity;
using Hcs.WebApp.Services;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Identity;
@@ -22,8 +23,8 @@ builder.Services.AddHeaderPropagation(x => x.Headers.Add("Cookie"));
builder.Services.AddAuthentication();
builder.Services.AddAuthorization();
-var connectionString = builder.Configuration.GetConnectionString("IdentityConnection") ?? throw new InvalidOperationException(" 'IdentityConnection'");
-builder.Services.AddDbContextFactory(options => options.UseSqlServer(connectionString));
+var identityConnection = builder.Configuration.GetConnectionString("IdentityConnection") ?? throw new InvalidOperationException(" 'IdentityConnection'");
+builder.Services.AddDbContextFactory(options => options.UseSqlServer(identityConnection));
builder.Services
.AddIdentity(options =>
@@ -38,6 +39,17 @@ builder.Services
.AddEntityFrameworkStores()
.AddDefaultTokenProviders();
+if (builder.Environment.IsDevelopment())
+{
+ var hcsProdConnection = builder.Configuration.GetConnectionString("HcsSit2Connection") ?? throw new InvalidOperationException(" 'HcsSit2Connection'");
+ builder.Services.AddDbContextFactory(options => options.UseSqlServer(hcsProdConnection));
+}
+else
+{
+ var hcsProdConnection = builder.Configuration.GetConnectionString("HcsProdConnection") ?? throw new InvalidOperationException(" 'HcsProdConnection'");
+ builder.Services.AddDbContextFactory(options => options.UseSqlServer(hcsProdConnection));
+}
+
#if USE_MOCK
builder.Services.AddTransient();
#else
diff --git a/Hcs.WebApp/Services/UsersService.cs b/Hcs.WebApp/Services/UsersService.cs
index 2d08674..ac79d15 100644
--- a/Hcs.WebApp/Services/UsersService.cs
+++ b/Hcs.WebApp/Services/UsersService.cs
@@ -1,4 +1,4 @@
-using Hcs.WebApp.Data;
+using Hcs.WebApp.Data.Identity;
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
diff --git a/Hcs.WebApp/appsettings.Development.json b/Hcs.WebApp/appsettings.Development.json
index 1f13e91..d04f195 100644
--- a/Hcs.WebApp/appsettings.Development.json
+++ b/Hcs.WebApp/appsettings.Development.json
@@ -13,6 +13,8 @@
"CertificateSerialNumber": "0636D2330032B3C38A4A26D765C787C248"
},
"ConnectionStrings": {
- "AuthConnection": "Server=localhost\\SQLEXPRESS;Database=hcs_web_app_identity;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=Yes"
+ "AuthConnection": "Server=localhost\\SQLEXPRESS;Database=hcs_web_app_identity;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=Yes",
+ "HcsProdConnection": "Server=localhost\\SQLEXPRESS;Database=hcs_web_app_prod;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=Yes",
+ "HcsSit2Connection": "Server=localhost\\SQLEXPRESS;Database=hcs_web_app_sit2;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=Yes"
}
}
diff --git a/Hcs.WebApp/appsettings.json b/Hcs.WebApp/appsettings.json
index ff571cc..a8e4e62 100644
--- a/Hcs.WebApp/appsettings.json
+++ b/Hcs.WebApp/appsettings.json
@@ -13,6 +13,8 @@
"CertificateSerialNumber": "0636D2330032B3C38A4A26D765C787C248"
},
"ConnectionStrings": {
- "IdentityConnection": "Server=localhost\\SQLEXPRESS;Database=hcs_web_app_identity;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=Yes"
+ "IdentityConnection": "Server=localhost\\SQLEXPRESS;Database=hcs_web_app_identity;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=Yes",
+ "HcsProdConnection": "Server=localhost\\SQLEXPRESS;Database=hcs_web_app_prod;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=Yes",
+ "HcsSit2Connection": "Server=localhost\\SQLEXPRESS;Database=hcs_web_app_sit2;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=Yes"
}
}