diff --git a/Migrations/20221110211959_ModelsInitial.Designer.cs b/Migrations/20221110211959_ModelsInitial.Designer.cs deleted file mode 100644 index 91fa5e5..0000000 --- a/Migrations/20221110211959_ModelsInitial.Designer.cs +++ /dev/null @@ -1,364 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using labdb.Models; - -#nullable disable - -namespace labdb.Migrations -{ - [DbContext(typeof(AppDbContext))] - [Migration("20221110211959_ModelsInitial")] - partial class ModelsInitial - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "postgis"); - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("labdb.Models.City", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CountryId") - .HasColumnType("uuid") - .HasColumnName("country_id"); - - b.Property("EnglishName") - .HasColumnType("text") - .HasColumnName("english_name"); - - b.Property("Location") - .IsRequired() - .HasColumnType("geometry") - .HasColumnName("location"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("pk_city"); - - b.HasIndex("CountryId") - .HasDatabaseName("ix_city_country_id"); - - b.HasIndex(new[] { "EnglishName" }, "english_name") - .IsUnique() - .HasDatabaseName("ix_city_english_name"); - - b.HasIndex(new[] { "EnglishName" }, "english_name_trgm") - .HasDatabaseName("ix_city_english_name1"); - - NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex(new[] { "EnglishName" }, "english_name_trgm"), "gin"); - NpgsqlIndexBuilderExtensions.HasOperators(b.HasIndex(new[] { "EnglishName" }, "english_name_trgm"), new[] { "gin_trgm_ops" }); - - b.HasIndex(new[] { "Name" }, "name") - .IsUnique() - .HasDatabaseName("ix_city_name"); - - b.HasIndex(new[] { "Name" }, "name_trgm") - .HasDatabaseName("ix_city_name1"); - - NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex(new[] { "Name" }, "name_trgm"), "gin"); - NpgsqlIndexBuilderExtensions.HasOperators(b.HasIndex(new[] { "Name" }, "name_trgm"), new[] { "gin_trgm_ops" }); - - b.ToTable("city", (string)null); - }); - - modelBuilder.Entity("labdb.Models.Country", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("pk_country"); - - b.HasIndex(new[] { "Name" }, "name") - .IsUnique() - .HasDatabaseName("ix_country_name"); - - b.HasIndex(new[] { "Name" }, "name_trgm") - .HasDatabaseName("ix_country_name1"); - - NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex(new[] { "Name" }, "name_trgm"), "gin"); - NpgsqlIndexBuilderExtensions.HasOperators(b.HasIndex(new[] { "Name" }, "name_trgm"), new[] { "gin_trgm_ops" }); - - b.ToTable("country", (string)null); - }); - - modelBuilder.Entity("labdb.Models.Lab", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AddressCity") - .HasColumnType("text") - .HasColumnName("address_city"); - - b.Property("AddressLine1") - .HasColumnType("text") - .HasColumnName("address_line1"); - - b.Property("AddressLine2") - .HasColumnType("text") - .HasColumnName("address_line2"); - - b.Property("AddressPostcode") - .HasColumnType("text") - .HasColumnName("address_postcode"); - - b.Property("BasicFee") - .HasColumnType("numeric") - .HasColumnName("basic_fee"); - - b.Property("CountryId") - .HasColumnType("uuid") - .HasColumnName("country_id"); - - b.Property("DrawFee") - .HasColumnType("numeric") - .HasColumnName("draw_fee"); - - b.Property("Email") - .HasColumnType("text") - .HasColumnName("email"); - - b.Property("Location") - .HasColumnType("geometry") - .HasColumnName("location"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text") - .HasColumnName("name"); - - b.Property("Notes") - .HasColumnType("text") - .HasColumnName("notes"); - - b.Property("Phone") - .HasColumnType("text") - .HasColumnName("phone"); - - b.Property("RequiresAppointment") - .HasColumnType("boolean") - .HasColumnName("requires_appointment"); - - b.Property("SelfDraw") - .HasColumnType("boolean") - .HasColumnName("self_draw"); - - b.Property("Website") - .HasColumnType("text") - .HasColumnName("website"); - - b.HasKey("Id") - .HasName("pk_lab"); - - b.HasIndex("AddressCity") - .HasDatabaseName("ix_lab_address_city"); - - b.HasIndex("AddressPostcode") - .HasDatabaseName("ix_lab_address_postcode"); - - b.HasIndex("BasicFee") - .HasDatabaseName("ix_lab_basic_fee"); - - b.HasIndex("CountryId") - .HasDatabaseName("ix_lab_country_id"); - - b.HasIndex("DrawFee") - .HasDatabaseName("ix_lab_draw_fee"); - - b.HasIndex("RequiresAppointment") - .HasDatabaseName("ix_lab_requires_appointment"); - - b.HasIndex("SelfDraw") - .HasDatabaseName("ix_lab_self_draw"); - - b.HasIndex(new[] { "Name" }, "name") - .HasDatabaseName("ix_lab_name"); - - b.HasIndex(new[] { "Name" }, "name_trgm") - .HasDatabaseName("ix_lab_name"); - - NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex(new[] { "Name" }, "name_trgm"), "gin"); - NpgsqlIndexBuilderExtensions.HasOperators(b.HasIndex(new[] { "Name" }, "name_trgm"), new[] { "gin_trgm_ops" }); - - b.ToTable("lab", (string)null); - }); - - modelBuilder.Entity("labdb.Models.LabTest", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("BloodVolume") - .HasColumnType("numeric") - .HasColumnName("blood_volume"); - - b.Property("LabId") - .HasColumnType("uuid") - .HasColumnName("lab_id"); - - b.Property("Notes") - .HasColumnType("text") - .HasColumnName("notes"); - - b.Property("Price") - .HasColumnType("numeric") - .HasColumnName("price"); - - b.Property("ServiceDirectoryLink") - .HasColumnType("text") - .HasColumnName("service_directory_link"); - - b.Property("TestId") - .HasColumnType("uuid") - .HasColumnName("test_id"); - - b.Property("TestMethod") - .HasColumnType("text") - .HasColumnName("test_method"); - - b.HasKey("Id") - .HasName("pk_lab_test"); - - b.HasIndex("BloodVolume") - .HasDatabaseName("ix_lab_test_blood_volume"); - - b.HasIndex("LabId") - .HasDatabaseName("ix_lab_test_lab_id"); - - b.HasIndex("Price") - .HasDatabaseName("ix_lab_test_price"); - - b.HasIndex("TestId") - .HasDatabaseName("ix_lab_test_test_id"); - - b.HasIndex("TestMethod") - .HasDatabaseName("ix_lab_test_test_method"); - - b.ToTable("lab_test", (string)null); - }); - - modelBuilder.Entity("labdb.Models.Test", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Abbreviation") - .HasColumnType("text") - .HasColumnName("abbreviation"); - - b.Property("Description") - .HasColumnType("text") - .HasColumnName("description"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text") - .HasColumnName("name"); - - b.Property("PubchemLink") - .HasColumnType("text") - .HasColumnName("pubchem_link"); - - b.HasKey("Id") - .HasName("pk_test"); - - b.HasIndex(new[] { "Abbreviation" }, "abbreviation") - .IsUnique() - .HasDatabaseName("ix_test_abbreviation"); - - b.HasIndex(new[] { "Abbreviation" }, "abbreviation_trgm") - .HasDatabaseName("ix_test_abbreviation1"); - - NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex(new[] { "Abbreviation" }, "abbreviation_trgm"), "gin"); - NpgsqlIndexBuilderExtensions.HasOperators(b.HasIndex(new[] { "Abbreviation" }, "abbreviation_trgm"), new[] { "gin_trgm_ops" }); - - b.HasIndex(new[] { "Name" }, "name") - .IsUnique() - .HasDatabaseName("ix_test_name"); - - b.HasIndex(new[] { "Name" }, "name_trgm") - .HasDatabaseName("ix_test_name1"); - - NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex(new[] { "Name" }, "name_trgm"), "gin"); - NpgsqlIndexBuilderExtensions.HasOperators(b.HasIndex(new[] { "Name" }, "name_trgm"), new[] { "gin_trgm_ops" }); - - b.ToTable("test", (string)null); - }); - - modelBuilder.Entity("labdb.Models.City", b => - { - b.HasOne("labdb.Models.Country", "Country") - .WithMany() - .HasForeignKey("CountryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_city_country_country_temp_id"); - - b.Navigation("Country"); - }); - - modelBuilder.Entity("labdb.Models.Lab", b => - { - b.HasOne("labdb.Models.Country", "Country") - .WithMany() - .HasForeignKey("CountryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_lab_country_country_id1"); - - b.Navigation("Country"); - }); - - modelBuilder.Entity("labdb.Models.LabTest", b => - { - b.HasOne("labdb.Models.Lab", "Lab") - .WithMany() - .HasForeignKey("LabId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_lab_test_lab_lab_id1"); - - b.HasOne("labdb.Models.Test", "Test") - .WithMany() - .HasForeignKey("TestId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_lab_test_test_test_temp_id"); - - b.Navigation("Lab"); - - b.Navigation("Test"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Migrations/20221110211959_ModelsInitial.cs b/Migrations/20221110211959_ModelsInitial.cs deleted file mode 100644 index dbfda4e..0000000 --- a/Migrations/20221110211959_ModelsInitial.cs +++ /dev/null @@ -1,283 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; -using NetTopologySuite.Geometries; - -#nullable disable - -namespace labdb.Migrations -{ - /// - public partial class ModelsInitial : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterDatabase() - .Annotation("Npgsql:PostgresExtension:postgis", ",,"); - - migrationBuilder.CreateTable( - name: "country", - columns: table => new - { - id = table.Column(type: "uuid", nullable: false), - name = table.Column(type: "text", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("pk_country", x => x.id); - }); - - migrationBuilder.CreateTable( - name: "test", - columns: table => new - { - id = table.Column(type: "uuid", nullable: false), - name = table.Column(type: "text", nullable: false), - abbreviation = table.Column(type: "text", nullable: true), - description = table.Column(type: "text", nullable: true), - pubchemlink = table.Column(name: "pubchem_link", type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("pk_test", x => x.id); - }); - - migrationBuilder.CreateTable( - name: "city", - columns: table => new - { - id = table.Column(type: "uuid", nullable: false), - name = table.Column(type: "text", nullable: false), - englishname = table.Column(name: "english_name", type: "text", nullable: true), - countryid = table.Column(name: "country_id", type: "uuid", nullable: false), - location = table.Column(type: "geography(POINT,4326)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("pk_city", x => x.id); - table.ForeignKey( - name: "fk_city_country_country_temp_id", - column: x => x.countryid, - principalTable: "country", - principalColumn: "id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "lab", - columns: table => new - { - id = table.Column(type: "uuid", nullable: false), - name = table.Column(type: "text", nullable: false), - website = table.Column(type: "text", nullable: true), - phone = table.Column(type: "text", nullable: true), - email = table.Column(type: "text", nullable: true), - addressline1 = table.Column(name: "address_line1", type: "text", nullable: true), - addressline2 = table.Column(name: "address_line2", type: "text", nullable: true), - addresspostcode = table.Column(name: "address_postcode", type: "text", nullable: true), - addresscity = table.Column(name: "address_city", type: "text", nullable: true), - countryid = table.Column(name: "country_id", type: "uuid", nullable: false), - location = table.Column(type: "geography(POINT,4326)", nullable: true), - requiresappointment = table.Column(name: "requires_appointment", type: "boolean", nullable: false), - selfdraw = table.Column(name: "self_draw", type: "boolean", nullable: false), - basicfee = table.Column(name: "basic_fee", type: "numeric", nullable: false), - drawfee = table.Column(name: "draw_fee", type: "numeric", nullable: false), - notes = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("pk_lab", x => x.id); - table.ForeignKey( - name: "fk_lab_country_country_id1", - column: x => x.countryid, - principalTable: "country", - principalColumn: "id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "lab_test", - columns: table => new - { - id = table.Column(type: "uuid", nullable: false), - labid = table.Column(name: "lab_id", type: "uuid", nullable: false), - testid = table.Column(name: "test_id", type: "uuid", nullable: false), - price = table.Column(type: "numeric", nullable: false), - servicedirectorylink = table.Column(name: "service_directory_link", type: "text", nullable: true), - bloodvolume = table.Column(name: "blood_volume", type: "numeric", nullable: false), - testmethod = table.Column(name: "test_method", type: "text", nullable: true), - notes = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("pk_lab_test", x => x.id); - table.ForeignKey( - name: "fk_lab_test_lab_lab_id1", - column: x => x.labid, - principalTable: "lab", - principalColumn: "id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "fk_lab_test_test_test_temp_id", - column: x => x.testid, - principalTable: "test", - principalColumn: "id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "ix_city_country_id", - table: "city", - column: "country_id"); - - migrationBuilder.CreateIndex( - name: "ix_city_english_name", - table: "city", - column: "english_name", - unique: true); - - migrationBuilder.CreateIndex( - name: "ix_city_english_name1", - table: "city", - column: "english_name") - .Annotation("Npgsql:IndexMethod", "gin") - .Annotation("Npgsql:IndexOperators", new[] { "gin_trgm_ops" }); - - migrationBuilder.CreateIndex( - name: "ix_city_name", - table: "city", - column: "name", - unique: true); - - migrationBuilder.CreateIndex( - name: "ix_city_name1", - table: "city", - column: "name") - .Annotation("Npgsql:IndexMethod", "gin") - .Annotation("Npgsql:IndexOperators", new[] { "gin_trgm_ops" }); - - migrationBuilder.CreateIndex( - name: "ix_country_name", - table: "country", - column: "name", - unique: true); - - migrationBuilder.CreateIndex( - name: "ix_country_name1", - table: "country", - column: "name") - .Annotation("Npgsql:IndexMethod", "gin") - .Annotation("Npgsql:IndexOperators", new[] { "gin_trgm_ops" }); - - migrationBuilder.CreateIndex( - name: "ix_lab_address_city", - table: "lab", - column: "address_city"); - - migrationBuilder.CreateIndex( - name: "ix_lab_address_postcode", - table: "lab", - column: "address_postcode"); - - migrationBuilder.CreateIndex( - name: "ix_lab_basic_fee", - table: "lab", - column: "basic_fee"); - - migrationBuilder.CreateIndex( - name: "ix_lab_country_id", - table: "lab", - column: "country_id"); - - migrationBuilder.CreateIndex( - name: "ix_lab_draw_fee", - table: "lab", - column: "draw_fee"); - - migrationBuilder.CreateIndex( - name: "ix_lab_name", - table: "lab", - column: "name"); - - migrationBuilder.CreateIndex( - name: "ix_lab_requires_appointment", - table: "lab", - column: "requires_appointment"); - - migrationBuilder.CreateIndex( - name: "ix_lab_self_draw", - table: "lab", - column: "self_draw"); - - migrationBuilder.CreateIndex( - name: "ix_lab_test_blood_volume", - table: "lab_test", - column: "blood_volume"); - - migrationBuilder.CreateIndex( - name: "ix_lab_test_lab_id", - table: "lab_test", - column: "lab_id"); - - migrationBuilder.CreateIndex( - name: "ix_lab_test_price", - table: "lab_test", - column: "price"); - - migrationBuilder.CreateIndex( - name: "ix_lab_test_test_id", - table: "lab_test", - column: "test_id"); - - migrationBuilder.CreateIndex( - name: "ix_lab_test_test_method", - table: "lab_test", - column: "test_method"); - - migrationBuilder.CreateIndex( - name: "ix_test_abbreviation", - table: "test", - column: "abbreviation", - unique: true); - - migrationBuilder.CreateIndex( - name: "ix_test_abbreviation1", - table: "test", - column: "abbreviation") - .Annotation("Npgsql:IndexMethod", "gin") - .Annotation("Npgsql:IndexOperators", new[] { "gin_trgm_ops" }); - - migrationBuilder.CreateIndex( - name: "ix_test_name", - table: "test", - column: "name", - unique: true); - - migrationBuilder.CreateIndex( - name: "ix_test_name1", - table: "test", - column: "name") - .Annotation("Npgsql:IndexMethod", "gin") - .Annotation("Npgsql:IndexOperators", new[] { "gin_trgm_ops" }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "city"); - - migrationBuilder.DropTable( - name: "lab_test"); - - migrationBuilder.DropTable( - name: "lab"); - - migrationBuilder.DropTable( - name: "test"); - - migrationBuilder.DropTable( - name: "country"); - } - } -} diff --git a/Migrations/AppDbContextModelSnapshot.cs b/Migrations/AppDbContextModelSnapshot.cs deleted file mode 100644 index ac08571..0000000 --- a/Migrations/AppDbContextModelSnapshot.cs +++ /dev/null @@ -1,361 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NetTopologySuite.Geometries; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using labdb.Models; - -#nullable disable - -namespace labdb.Migrations -{ - [DbContext(typeof(AppDbContext))] - partial class AppDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "postgis"); - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("labdb.Models.City", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CountryId") - .HasColumnType("uuid") - .HasColumnName("country_id"); - - b.Property("EnglishName") - .HasColumnType("text") - .HasColumnName("english_name"); - - b.Property("Location") - .IsRequired() - .HasColumnType("geometry") - .HasColumnName("location"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("pk_city"); - - b.HasIndex("CountryId") - .HasDatabaseName("ix_city_country_id"); - - b.HasIndex(new[] { "EnglishName" }, "english_name") - .IsUnique() - .HasDatabaseName("ix_city_english_name"); - - b.HasIndex(new[] { "EnglishName" }, "english_name_trgm") - .HasDatabaseName("ix_city_english_name1"); - - NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex(new[] { "EnglishName" }, "english_name_trgm"), "gin"); - NpgsqlIndexBuilderExtensions.HasOperators(b.HasIndex(new[] { "EnglishName" }, "english_name_trgm"), new[] { "gin_trgm_ops" }); - - b.HasIndex(new[] { "Name" }, "name") - .IsUnique() - .HasDatabaseName("ix_city_name"); - - b.HasIndex(new[] { "Name" }, "name_trgm") - .HasDatabaseName("ix_city_name1"); - - NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex(new[] { "Name" }, "name_trgm"), "gin"); - NpgsqlIndexBuilderExtensions.HasOperators(b.HasIndex(new[] { "Name" }, "name_trgm"), new[] { "gin_trgm_ops" }); - - b.ToTable("city", (string)null); - }); - - modelBuilder.Entity("labdb.Models.Country", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("pk_country"); - - b.HasIndex(new[] { "Name" }, "name") - .IsUnique() - .HasDatabaseName("ix_country_name"); - - b.HasIndex(new[] { "Name" }, "name_trgm") - .HasDatabaseName("ix_country_name1"); - - NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex(new[] { "Name" }, "name_trgm"), "gin"); - NpgsqlIndexBuilderExtensions.HasOperators(b.HasIndex(new[] { "Name" }, "name_trgm"), new[] { "gin_trgm_ops" }); - - b.ToTable("country", (string)null); - }); - - modelBuilder.Entity("labdb.Models.Lab", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AddressCity") - .HasColumnType("text") - .HasColumnName("address_city"); - - b.Property("AddressLine1") - .HasColumnType("text") - .HasColumnName("address_line1"); - - b.Property("AddressLine2") - .HasColumnType("text") - .HasColumnName("address_line2"); - - b.Property("AddressPostcode") - .HasColumnType("text") - .HasColumnName("address_postcode"); - - b.Property("BasicFee") - .HasColumnType("numeric") - .HasColumnName("basic_fee"); - - b.Property("CountryId") - .HasColumnType("uuid") - .HasColumnName("country_id"); - - b.Property("DrawFee") - .HasColumnType("numeric") - .HasColumnName("draw_fee"); - - b.Property("Email") - .HasColumnType("text") - .HasColumnName("email"); - - b.Property("Location") - .HasColumnType("geometry") - .HasColumnName("location"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text") - .HasColumnName("name"); - - b.Property("Notes") - .HasColumnType("text") - .HasColumnName("notes"); - - b.Property("Phone") - .HasColumnType("text") - .HasColumnName("phone"); - - b.Property("RequiresAppointment") - .HasColumnType("boolean") - .HasColumnName("requires_appointment"); - - b.Property("SelfDraw") - .HasColumnType("boolean") - .HasColumnName("self_draw"); - - b.Property("Website") - .HasColumnType("text") - .HasColumnName("website"); - - b.HasKey("Id") - .HasName("pk_lab"); - - b.HasIndex("AddressCity") - .HasDatabaseName("ix_lab_address_city"); - - b.HasIndex("AddressPostcode") - .HasDatabaseName("ix_lab_address_postcode"); - - b.HasIndex("BasicFee") - .HasDatabaseName("ix_lab_basic_fee"); - - b.HasIndex("CountryId") - .HasDatabaseName("ix_lab_country_id"); - - b.HasIndex("DrawFee") - .HasDatabaseName("ix_lab_draw_fee"); - - b.HasIndex("RequiresAppointment") - .HasDatabaseName("ix_lab_requires_appointment"); - - b.HasIndex("SelfDraw") - .HasDatabaseName("ix_lab_self_draw"); - - b.HasIndex(new[] { "Name" }, "name") - .HasDatabaseName("ix_lab_name"); - - b.HasIndex(new[] { "Name" }, "name_trgm") - .HasDatabaseName("ix_lab_name"); - - NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex(new[] { "Name" }, "name_trgm"), "gin"); - NpgsqlIndexBuilderExtensions.HasOperators(b.HasIndex(new[] { "Name" }, "name_trgm"), new[] { "gin_trgm_ops" }); - - b.ToTable("lab", (string)null); - }); - - modelBuilder.Entity("labdb.Models.LabTest", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("BloodVolume") - .HasColumnType("numeric") - .HasColumnName("blood_volume"); - - b.Property("LabId") - .HasColumnType("uuid") - .HasColumnName("lab_id"); - - b.Property("Notes") - .HasColumnType("text") - .HasColumnName("notes"); - - b.Property("Price") - .HasColumnType("numeric") - .HasColumnName("price"); - - b.Property("ServiceDirectoryLink") - .HasColumnType("text") - .HasColumnName("service_directory_link"); - - b.Property("TestId") - .HasColumnType("uuid") - .HasColumnName("test_id"); - - b.Property("TestMethod") - .HasColumnType("text") - .HasColumnName("test_method"); - - b.HasKey("Id") - .HasName("pk_lab_test"); - - b.HasIndex("BloodVolume") - .HasDatabaseName("ix_lab_test_blood_volume"); - - b.HasIndex("LabId") - .HasDatabaseName("ix_lab_test_lab_id"); - - b.HasIndex("Price") - .HasDatabaseName("ix_lab_test_price"); - - b.HasIndex("TestId") - .HasDatabaseName("ix_lab_test_test_id"); - - b.HasIndex("TestMethod") - .HasDatabaseName("ix_lab_test_test_method"); - - b.ToTable("lab_test", (string)null); - }); - - modelBuilder.Entity("labdb.Models.Test", b => - { - b.Property("Id") - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Abbreviation") - .HasColumnType("text") - .HasColumnName("abbreviation"); - - b.Property("Description") - .HasColumnType("text") - .HasColumnName("description"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text") - .HasColumnName("name"); - - b.Property("PubchemLink") - .HasColumnType("text") - .HasColumnName("pubchem_link"); - - b.HasKey("Id") - .HasName("pk_test"); - - b.HasIndex(new[] { "Abbreviation" }, "abbreviation") - .IsUnique() - .HasDatabaseName("ix_test_abbreviation"); - - b.HasIndex(new[] { "Abbreviation" }, "abbreviation_trgm") - .HasDatabaseName("ix_test_abbreviation1"); - - NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex(new[] { "Abbreviation" }, "abbreviation_trgm"), "gin"); - NpgsqlIndexBuilderExtensions.HasOperators(b.HasIndex(new[] { "Abbreviation" }, "abbreviation_trgm"), new[] { "gin_trgm_ops" }); - - b.HasIndex(new[] { "Name" }, "name") - .IsUnique() - .HasDatabaseName("ix_test_name"); - - b.HasIndex(new[] { "Name" }, "name_trgm") - .HasDatabaseName("ix_test_name1"); - - NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex(new[] { "Name" }, "name_trgm"), "gin"); - NpgsqlIndexBuilderExtensions.HasOperators(b.HasIndex(new[] { "Name" }, "name_trgm"), new[] { "gin_trgm_ops" }); - - b.ToTable("test", (string)null); - }); - - modelBuilder.Entity("labdb.Models.City", b => - { - b.HasOne("labdb.Models.Country", "Country") - .WithMany() - .HasForeignKey("CountryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_city_country_country_temp_id"); - - b.Navigation("Country"); - }); - - modelBuilder.Entity("labdb.Models.Lab", b => - { - b.HasOne("labdb.Models.Country", "Country") - .WithMany() - .HasForeignKey("CountryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_lab_country_country_id1"); - - b.Navigation("Country"); - }); - - modelBuilder.Entity("labdb.Models.LabTest", b => - { - b.HasOne("labdb.Models.Lab", "Lab") - .WithMany() - .HasForeignKey("LabId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_lab_test_lab_lab_id1"); - - b.HasOne("labdb.Models.Test", "Test") - .WithMany() - .HasForeignKey("TestId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_lab_test_test_test_temp_id"); - - b.Navigation("Lab"); - - b.Navigation("Test"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Models/City.cs b/Models/City.cs index 1588b2f..d9636e8 100644 --- a/Models/City.cs +++ b/Models/City.cs @@ -13,7 +13,6 @@ public class City : EntityBase public CountryId CountryId { get; set; } = null!; public Country Country { get; set; } = null!; public Point Location { get; set; } = null!; - } public class CityConfiguration : EntityBaseConfiguration diff --git a/Models/Country.cs b/Models/Country.cs index c3401dd..abcb227 100644 --- a/Models/Country.cs +++ b/Models/Country.cs @@ -1,3 +1,4 @@ +using System.ComponentModel; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; @@ -7,7 +8,14 @@ public record CountryId : EntityIdBase; public class Country : EntityBase { - public string Name { get; set; } = null!; + public string Name { get; init; } = null!; + public string EnglishName { get; init; } = null!; + + public string Code { get; init; } = null!; + + public List Cities { get; set; } = new(); + + public List Labs { get; set; } = new(); } public class CountryConfiguration : EntityBaseConfiguration @@ -16,7 +24,12 @@ public class CountryConfiguration : EntityBaseConfiguration { base.Configure(builder); - builder.HasIndex(x => x.Name,"name").IsUnique(); + builder.HasIndex(x => x.Name, "name").IsUnique(); builder.HasIndex(x => x.Name, "name_trgm").HasMethod("gin").HasOperators("gin_trgm_ops"); + + builder.HasData( + new Country { Name = "Deutschland", EnglishName = "Germany", Code = "DE" }, + new Country { Name = "TEST", EnglishName = "TEST COUNTRY", Code = "TEST" } + ); } } \ No newline at end of file diff --git a/Models/EntityIdBase.cs b/Models/EntityIdBase.cs index 0ec7781..a17e009 100644 --- a/Models/EntityIdBase.cs +++ b/Models/EntityIdBase.cs @@ -1,4 +1,6 @@ +using System.ComponentModel; using System.Diagnostics.CodeAnalysis; +using System.Globalization; using System.Reflection; using System.Text.Json; using System.Text.Json.Serialization; @@ -18,24 +20,24 @@ public abstract record EntityIdBase : EntityIdBase { return new TId { Value = Guid.Parse(guid) }; } - + public static bool TryParse(string guid, [NotNullWhen(true)] out TId? value) { value = null; - + if (!Guid.TryParse(guid, out var result)) { return false; } - + value = new TId { Value = result }; - + return true; } - + public static TId FromGuid(Guid id) { return new TId { Value = id }; @@ -79,11 +81,11 @@ public static class EntityIdJsonConverterExtensions { var types = assembly.GetTypes() .Where(t => t.IsClass && !t.IsAbstract && t.IsSubclassOf(typeof(EntityIdBase))); - + foreach (var type in types) { var converterType = typeof(EntityIdJsonConverter<>).MakeGenericType(type); - var converter = (JsonConverter) Activator.CreateInstance(converterType)!; + var converter = (JsonConverter)Activator.CreateInstance(converterType)!; options.Converters.Add(converter); } } diff --git a/Models/Lab.cs b/Models/Lab.cs index e674cdd..675a2c7 100644 --- a/Models/Lab.cs +++ b/Models/Lab.cs @@ -1,3 +1,4 @@ +using System.ComponentModel.DataAnnotations; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; using NetTopologySuite.Geometries; @@ -8,7 +9,7 @@ public record LabId : EntityIdBase; public class Lab : EntityBase { - public string Name { get; set; } = null!; + public string Name { get; set; } = ""; public string? Website { get; set; } public string? Phone { get; set; } public string? Email { get; set; } @@ -16,8 +17,10 @@ public class Lab : EntityBase public string? AddressLine1 { get; set; } public string? AddressLine2 { get; set; } + public string? AddressPostcode { get; set; } public string? AddressCity { get; set; } + public CountryId CountryId { get; set; } = null!; public Country Country { get; set; } = null!; public Point? Location { get; set; } @@ -27,6 +30,8 @@ public class Lab : EntityBase public decimal BasicFee { get; set; } public decimal DrawFee { get; set; } public string? Notes { get; set; } + + public List TestOffers { get; set; } = new(); } public class LabConfiguration : EntityBaseConfiguration @@ -38,7 +43,6 @@ public class LabConfiguration : EntityBaseConfiguration builder.HasIndex(x => x.Name, "name"); builder.HasIndex(x => x.Name, "name_trgm").HasMethod("gin").HasOperators("gin_trgm_ops"); builder.HasIndex(x => x.AddressPostcode); - builder.HasIndex(x => x.AddressCity); builder.HasIndex(x => x.RequiresAppointment); builder.HasIndex(x => x.SelfDraw); builder.HasIndex(x => x.BasicFee); diff --git a/Models/Test.cs b/Models/Test.cs index 4dd0431..aa4c88c 100644 --- a/Models/Test.cs +++ b/Models/Test.cs @@ -1,4 +1,3 @@ -using System.ComponentModel.DataAnnotations; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; @@ -12,7 +11,10 @@ public class Test : EntityBase public string? Abbreviation { get; set; } public string? Description { get; set; } public string? PubchemLink { get; set; } - + + public List TestOffers { get; set; } = new(); + + public List Synonyms { get; set; } = new(); } public class TestConfiguration : EntityBaseConfiguration diff --git a/Models/LabTest.cs b/Models/TestOffer.cs similarity index 73% rename from Models/LabTest.cs rename to Models/TestOffer.cs index 47c0deb..c8a6086 100644 --- a/Models/LabTest.cs +++ b/Models/TestOffer.cs @@ -3,9 +3,9 @@ using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace labdb.Models; -public record LabTestId : EntityIdBase; +public record TestOfferId : EntityIdBase; -public class LabTest : EntityBase +public class TestOffer : EntityBase { public LabId LabId { get; init; } = null!; public Lab Lab { get; init; } = null!; @@ -18,9 +18,9 @@ public class LabTest : EntityBase public string? Notes { get; set; } } -public class LabTestConfiguration : EntityBaseConfiguration +public class LabTestConfiguration : EntityBaseConfiguration { - public override void Configure(EntityTypeBuilder builder) + public override void Configure(EntityTypeBuilder builder) { base.Configure(builder); diff --git a/Models/TestSynonym.cs b/Models/TestSynonym.cs new file mode 100644 index 0000000..e0738a3 --- /dev/null +++ b/Models/TestSynonym.cs @@ -0,0 +1,24 @@ +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata.Builders; + +namespace labdb.Models; + +public record TestSynonymId : EntityIdBase; + +public class TestSynonym : EntityBase +{ + public TestId TestId { get; init; } = null!; + public Test Test { get; init; } = null!; + public string Name { get; set; } = null!; +} + +public class TestSynonymConfiguration : EntityBaseConfiguration +{ + public override void Configure(EntityTypeBuilder builder) + { + base.Configure(builder); + + builder.HasIndex(x => x.Name, "name").IsUnique(); + builder.HasIndex(x => x.Name, "name_trgm").HasMethod("gin").HasOperators("gin_trgm_ops"); + } +} \ No newline at end of file diff --git a/Pages/FetchData.razor b/Pages/FetchData.razor index e0e9425..879e207 100644 --- a/Pages/FetchData.razor +++ b/Pages/FetchData.razor @@ -6,4 +6,4 @@

Weather forecast

This component demonstrates fetching data from a service.

-

Not implemented

\ No newline at end of file +

Loading...

\ No newline at end of file diff --git a/Pages/Labs/Edit.razor b/Pages/Labs/Edit.razor new file mode 100644 index 0000000..2d5a8f2 --- /dev/null +++ b/Pages/Labs/Edit.razor @@ -0,0 +1,257 @@ +@page "/labs/add" +@page "/labs/{id:guid}" +@using Microsoft.EntityFrameworkCore +@using Microsoft.AspNetCore.Components + +@Title + +

@Title

+@if (Lab != null) +{ + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + @foreach (var country in Countries) + { + + } + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+
+ + +
+
+
+
+ + +
+
+ +
+ + +
+
+ + +
+ +
+ + +
+ +
+
+ @foreach (var test in Tests) + { + var offer = Lab.TestOffers.FirstOrDefault(x => x.TestId == test.Id); +
+
+ @if (offer == null) + { + + } + else + { + + } +
@test.Abbreviation
+
@test.Name
+ @if (offer != null) + { +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ } +
+
+ } +
+
+ + +
+
+} +else +{ +

NOT FOUND

+} + +@if (ShowDeleteModal) +{ + + +} + + +@code { + + [Inject] + public NavigationManager NavigationManager { get; set; } = null!; + + [Inject] + public IDbContextFactory DbContextFactory { get; set; } = null!; + + + [Parameter] + public Guid? Id { get; set; } + + private Lab? Lab { get; set; } + + private List Countries { get; set; } = new(); + + private List Tests { get; set; } = new(); + + private string Title => Id == null ? "Add lab" : "Edit lab"; + + private Guid SelectedCountryId + { + get => Lab?.CountryId.Value ?? Guid.Empty; + set => Lab!.CountryId = CountryId.FromGuid(value); + } + + private List NewOffers { get; set; } = new(); + private List RemovedOffers { get; set; } = new(); + + private bool ShowDeleteModal { get; set; } + + protected override void OnInitialized() + { + base.OnInitialized(); + using var ctx = DbContextFactory.CreateDbContext(); + + Countries = ctx.Set().ToList(); + Tests = ctx.Set().ToList(); + + if (Id != null) + { + Lab = ctx.Set() + .Include(x => x.TestOffers) + .First(x => x.Id == LabId.FromGuid(Id.Value)); + Lab.Country = null!; // this seems super hacky, wtf + } + else + { + Lab = new Lab { CountryId = Countries.First().Id }; + } + } + + private void HandleValidSubmit() + { + using var ctx = DbContextFactory.CreateDbContext(); + if (Id == null) + { + ctx.Add(Lab!); + } + else + { + ctx.Update(Lab!); + } + ctx.AddRange(NewOffers); + ctx.RemoveRange(RemovedOffers); + ctx.SaveChanges(); + NavigationManager.NavigateTo("/labs"); + } + + private void AddOffer(Test test) + { + var offer = new TestOffer { TestId = test.Id }; + Lab!.TestOffers.Add(offer); + NewOffers.Add(offer); + } + + private void RemoveOffer(TestOffer offer) + { + Lab!.TestOffers.Remove(offer); + RemovedOffers.Add(offer); + } + + private void DeleteLab() + { + using var ctx = DbContextFactory.CreateDbContext(); + ctx.RemoveRange(Lab!.TestOffers); + ctx.Remove(Lab!); + ctx.SaveChanges(); + NavigationManager.NavigateTo("/labs"); + } + +} \ No newline at end of file diff --git a/Pages/Labs/List.razor b/Pages/Labs/List.razor new file mode 100644 index 0000000..2f223d1 --- /dev/null +++ b/Pages/Labs/List.razor @@ -0,0 +1,94 @@ +@page "/labs" +@using Microsoft.EntityFrameworkCore + +Labs + +

Labs

+ +Add new + + + + + + + + + + @foreach (var lab in Labs) + { + + + + + } + +
NameLocation
+ @lab.Name + + @if (!string.IsNullOrEmpty(lab.AddressCity)) + { + @lab.AddressCity@(", ") + } + @lab.Country.Name +
+ +
+
    + @for (var i = 1; i <= TotalPages; i++) + { + var p = i; +
  • + @p +
  • + } +
+
+ +@code { + + [Inject] + public IDbContextFactory DbContextFactory { get; set; } = null!; + + [Parameter] + [SupplyParameterFromQuery(Name = "page")] + public int? CurrentPage { get; set; } + + private int Count { get; set; } + private int PageSize { get; set; } = 10; + + private int TotalPages => (int)Math.Ceiling(decimal.Divide(Count, PageSize)); + + + private List Labs { get; set; } = new(); + + + private void Load() + { + using var ctx = DbContextFactory.CreateDbContext(); + + Count = ctx.Set().Count(); + + var page = CurrentPage ?? 1; + + Labs = ctx.Set() + .OrderBy(x => x.Id) + .Skip((page - 1) * PageSize) + .Take(PageSize) + .Include(x => x.Country) + .ToList(); + } + + protected override void OnInitialized() + { + base.OnInitialized(); + Load(); + } + + protected override void OnParametersSet() + { + base.OnParametersSet(); + Load(); + } + +} \ No newline at end of file diff --git a/Pages/Tests/Edit.razor b/Pages/Tests/Edit.razor new file mode 100644 index 0000000..7257bca --- /dev/null +++ b/Pages/Tests/Edit.razor @@ -0,0 +1,181 @@ +@page "/tests/add" +@page "/tests/{id:guid}" +@using Microsoft.EntityFrameworkCore +@using Microsoft.AspNetCore.Components + +@Title + +

@Title

+@if (Test != null) +{ + + + +
+
+ + +
+
+ + +
+
+ + +
+
+
+

Synonyms

+ @foreach (var synonym in Test.Synonyms) + { +
+ + +
+ } +
+ +
+
+
+ + +
+
+} +else +{ +

NOT FOUND

+} +@if (ShowDeleteModal) +{ + + +} + + + + +@code { + + [Inject] + public NavigationManager NavigationManager { get; set; } = null!; + + [Inject] + public IDbContextFactory DbContextFactory { get; set; } = null!; + + [Inject] + public IJSRuntime Js { get; set; } = null!; + + + [Parameter] + public Guid? Id { get; set; } + + private Test? Test { get; set; } + + private string Title => Id == null ? "Add test" : "Edit test"; + + private string NewSynonym { get; set; } = ""; + + private List NewSynonyms { get; set; } = new(); + private List RemovedSynonyms { get; set; } = new(); + + private bool ShowDeleteModal { get; set; } + + protected override void OnAfterRender(bool firstRender) + { + if (firstRender) + { + Js.InvokeVoidAsync("PreventEnterKey", "testNewSynonymInput"); + } + } + + protected override void OnInitialized() + { + base.OnInitialized(); + using var ctx = DbContextFactory.CreateDbContext(); + + if (Id != null) + { + Test = ctx.Set() + .Include(x => x.Synonyms) + .First(x => x.Id == TestId.FromGuid(Id.Value)); + } + else + { + Test = new Test(); + } + } + + private void HandleValidSubmit() + { + using var ctx = DbContextFactory.CreateDbContext(); + if (Id == null) + { + ctx.Add(Test!); + } + else + { + ctx.Update(Test!); + } + ctx.AddRange(NewSynonyms); + ctx.RemoveRange(RemovedSynonyms); + ctx.SaveChanges(); + NavigationManager.NavigateTo("/tests"); + } + + private void AddSynonym() + { + if (NewSynonym == "") return; + var synonym = new TestSynonym { Name = NewSynonym }; + Test!.Synonyms.Add(synonym); + NewSynonyms.Add(synonym); + NewSynonym = ""; + } + + private void NewSynonymKeydown(KeyboardEventArgs e) + { + if (e.Code == "Enter") + { + AddSynonym(); + } + } + + private void NewSynonymBlur() + { + AddSynonym(); + } + + private void DeleteSynonym(TestSynonym synonym) + { + Test!.Synonyms.Remove(synonym); + RemovedSynonyms.Add(synonym); + } + + private void DeleteTest() + { + using var ctx = DbContextFactory.CreateDbContext(); + ctx.RemoveRange(Test!.TestOffers); + ctx.Remove(Test!); + ctx.SaveChanges(); + NavigationManager.NavigateTo("/tests"); + } + +} \ No newline at end of file diff --git a/Pages/Tests/List.razor b/Pages/Tests/List.razor new file mode 100644 index 0000000..552d10d --- /dev/null +++ b/Pages/Tests/List.razor @@ -0,0 +1,94 @@ +@page "/tests" +@using Microsoft.EntityFrameworkCore + +Tests + +

Tests

+ +Add new + + + + + + + + + + + @foreach (var test in Tests) + { + + + + + + } + +
NameAbbreviationSynonyms
+ @test.Name + + @test.Abbreviation + + @(string.Join(", ", test.Synonyms.Select(x => x.Name).ToArray())) +
+ +
+
    + @for (var i = 1; i <= TotalPages; i++) + { + var p = i; +
  • + @p +
  • + } +
+
+ +@code { + + [Inject] + public IDbContextFactory DbContextFactory { get; set; } = null!; + + [Parameter] + [SupplyParameterFromQuery(Name = "page")] + public int? CurrentPage { get; set; } + + private int Count { get; set; } + private int PageSize { get; set; } = 10; + + private int TotalPages => (int)Math.Ceiling(decimal.Divide(Count, PageSize)); + + + private List Tests { get; set; } = new(); + + + private void Load() + { + using var ctx = DbContextFactory.CreateDbContext(); + + Count = ctx.Set().Count(); + + var page = CurrentPage ?? 1; + + Tests = ctx.Set() + .OrderBy(x => x.Id) + .Skip((page - 1) * PageSize) + .Take(PageSize) + .Include(x => x.Synonyms) + .ToList(); + } + + protected override void OnInitialized() + { + base.OnInitialized(); + Load(); + } + + protected override void OnParametersSet() + { + base.OnParametersSet(); + Load(); + } + +} \ No newline at end of file diff --git a/Pages/_Layout.cshtml b/Pages/_Layout.cshtml index 6769bd7..3e0e780 100644 --- a/Pages/_Layout.cshtml +++ b/Pages/_Layout.cshtml @@ -5,28 +5,29 @@ - - - - - - - + + + + + + + - @RenderBody() +@RenderBody() -
- - An error has occurred. This application may no longer respond until reloaded. - - - An unhandled exception has occurred. See browser dev tools for details. - - Reload - 🗙 -
+
+ + An error has occurred. This application may no longer respond until reloaded. + + + An unhandled exception has occurred. See browser dev tools for details. + + Reload + 🗙 +
- + + - + \ No newline at end of file diff --git a/Shared/NavMenu.razor b/Shared/NavMenu.razor index 16c4de0..780820b 100644 --- a/Shared/NavMenu.razor +++ b/Shared/NavMenu.razor @@ -10,18 +10,13 @@
diff --git a/_Imports.razor b/_Imports.razor index 541ae7b..b612928 100644 --- a/_Imports.razor +++ b/_Imports.razor @@ -8,3 +8,5 @@ @using Microsoft.JSInterop @using labdb @using labdb.Shared +@using labdb.Models + diff --git a/labdb.csproj b/labdb.csproj index 642fbf7..bf8d9d4 100644 --- a/labdb.csproj +++ b/labdb.csproj @@ -1,7 +1,7 @@ - net6.0 + net7.0 enable enable @@ -18,4 +18,8 @@ + + + + diff --git a/readme.md b/readme.md index 8ba19e2..ce3aa8d 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ -# datenbankschema +# datenbankschemaLocaition labs: diff --git a/wwwroot/js/site.js b/wwwroot/js/site.js new file mode 100644 index 0000000..5a18f3b --- /dev/null +++ b/wwwroot/js/site.js @@ -0,0 +1,8 @@ +window.PreventEnterKey = (id) => { + document.getElementById(id).addEventListener('keydown', function (event) { + if (event.keyCode === 13) { + event.preventDefault(); + return false; + } + }) +}; \ No newline at end of file