diff --git a/.gitignore b/.gitignore index 9b6a2b1..ea886bb 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ # This .gitignore file was automatically created by Microsoft(R) Visual Studio. ################################################################################ -*.lock +.vs/ diff --git a/LearningCentre/Controllers/StudentController.cs b/LearningCentre/Controllers/StudentController.cs index cdb1a75..70065ce 100644 --- a/LearningCentre/Controllers/StudentController.cs +++ b/LearningCentre/Controllers/StudentController.cs @@ -12,7 +12,7 @@ namespace LearningCentre.Controllers { [Route("[controller]")] - public class StudentController : Controller + public class StudentController : ControllerBase { /// /// diff --git a/LearningCentre/Database/LearningCentre/Country.cs b/LearningCentre/Database/LearningCentre/Country.cs index 074df71..8d20724 100644 --- a/LearningCentre/Database/LearningCentre/Country.cs +++ b/LearningCentre/Database/LearningCentre/Country.cs @@ -3,10 +3,37 @@ namespace LearningCentre.Database { + /// + /// + /// public partial class Country { + /// + /// + /// + public Country() + { + Student=new HashSet(); + } + + /// + /// + /// public int Id { get; set; } + + /// + /// + /// public string Code { get; set; } + + /// + /// + /// public string Name { get; set; } + + /// + /// + /// + public ICollection Student { get; set; } } } diff --git a/LearningCentre/Database/Role.cs b/LearningCentre/Database/LearningCentre/Role.cs similarity index 100% rename from LearningCentre/Database/Role.cs rename to LearningCentre/Database/LearningCentre/Role.cs diff --git a/LearningCentre/Database/LearningCentre/Student.cs b/LearningCentre/Database/LearningCentre/Student.cs index ce64c64..67978fc 100644 --- a/LearningCentre/Database/LearningCentre/Student.cs +++ b/LearningCentre/Database/LearningCentre/Student.cs @@ -13,12 +13,13 @@ public partial class Student public string NativeLanguage { get; set; } public string Citizenship { get; set; } public long? PassportNumber { get; set; } - public int? Hometown { get; set; } + public int? CountryId { get; set; } public string WorkPlace { get; set; } public string PlaceOfStudy { get; set; } public DateTime? DateOfRegistration { get; set; } public int? UserProfileId { get; set; } + public Country Country { get; set; } public UserProfile UserProfile { get; set; } } } diff --git a/LearningCentre/Database/LearningCentre/LearningCentreContext.cs b/LearningCentre/Database/LearningCentreContext.cs similarity index 100% rename from LearningCentre/Database/LearningCentre/LearningCentreContext.cs rename to LearningCentre/Database/LearningCentreContext.cs diff --git a/LearningCentre/Migrations/20190613045015_LearningCentre.Designer.cs b/LearningCentre/Migrations/20190613045015_LearningCentre.Designer.cs new file mode 100644 index 0000000..31b376f --- /dev/null +++ b/LearningCentre/Migrations/20190613045015_LearningCentre.Designer.cs @@ -0,0 +1,219 @@ +// +using System; +using LearningCentre.Database; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +namespace LearningCentre.Migrations +{ + [DbContext(typeof(LearningCentreContext))] + [Migration("20190613045015_LearningCentre")] + partial class LearningCentre + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("LearningCentre.Database.City", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Code"); + + b.Property("CountryId"); + + b.Property("Name"); + + b.HasKey("Id"); + + b.ToTable("City"); + }); + + modelBuilder.Entity("LearningCentre.Database.Country", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Code"); + + b.Property("Name"); + + b.HasKey("Id"); + + b.ToTable("Country"); + }); + + modelBuilder.Entity("LearningCentre.Database.Level", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Name"); + + b.HasKey("Id"); + + b.ToTable("Level"); + }); + + modelBuilder.Entity("LearningCentre.Database.PlacementTest", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("LevelId"); + + b.Property("PlacementTestDate") + .HasColumnType("datetime"); + + b.Property("TeacherId"); + + b.HasKey("Id"); + + b.HasIndex("LevelId"); + + b.ToTable("PlacementTest"); + }); + + modelBuilder.Entity("LearningCentre.Database.Student", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Citizenship") + .HasMaxLength(50); + + b.Property("DateOfBirth") + .HasColumnType("date"); + + b.Property("DateOfRegistration") + .HasColumnType("datetime"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(50); + + b.Property("Gender") + .HasColumnType("nchar(10)"); + + b.Property("Hometown"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(50); + + b.Property("NativeLanguage") + .HasMaxLength(50); + + b.Property("PassportNumber"); + + b.Property("PlaceOfStudy"); + + b.Property("UserProfileId"); + + b.Property("WorkPlace"); + + b.HasKey("Id"); + + b.HasIndex("UserProfileId"); + + b.ToTable("Student"); + }); + + modelBuilder.Entity("LearningCentre.Database.Subject", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Name"); + + b.HasKey("Id"); + + b.ToTable("Subject"); + }); + + modelBuilder.Entity("LearningCentre.Database.Teacher", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("FirstName") + .HasMaxLength(50); + + b.Property("LastName") + .HasMaxLength(50); + + b.Property("SubjectId"); + + b.HasKey("Id"); + + b.HasIndex("SubjectId"); + + b.ToTable("Teacher"); + }); + + modelBuilder.Entity("LearningCentre.Database.UserProfile", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Password"); + + b.Property("PasswordHash"); + + b.Property("PasswordSalt"); + + b.Property("Role") + .HasMaxLength(50); + + b.Property("Token"); + + b.Property("Username"); + + b.HasKey("Id"); + + b.ToTable("UserProfile"); + }); + + modelBuilder.Entity("LearningCentre.Database.PlacementTest", b => + { + b.HasOne("LearningCentre.Database.Level", "Level") + .WithMany("PlacementTest") + .HasForeignKey("LevelId") + .HasConstraintName("FK_PlacementTest_Level"); + }); + + modelBuilder.Entity("LearningCentre.Database.Student", b => + { + b.HasOne("LearningCentre.Database.UserProfile", "UserProfile") + .WithMany("Student") + .HasForeignKey("UserProfileId") + .HasConstraintName("FK_Student_Country"); + }); + + modelBuilder.Entity("LearningCentre.Database.Teacher", b => + { + b.HasOne("LearningCentre.Database.Subject", "Subject") + .WithMany("Teacher") + .HasForeignKey("SubjectId") + .HasConstraintName("FK_Teacher_Subject"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/LearningCentre/Migrations/20190613045015_LearningCentre.cs b/LearningCentre/Migrations/20190613045015_LearningCentre.cs new file mode 100644 index 0000000..f2771f1 --- /dev/null +++ b/LearningCentre/Migrations/20190613045015_LearningCentre.cs @@ -0,0 +1,199 @@ +using System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace LearningCentre.Migrations +{ + public partial class LearningCentre : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "City", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), + Code = table.Column(nullable: true), + Name = table.Column(nullable: true), + CountryId = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_City", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Country", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), + Code = table.Column(nullable: true), + Name = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Country", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Level", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), + Name = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Level", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Subject", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), + Name = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Subject", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "UserProfile", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), + Username = table.Column(nullable: true), + Password = table.Column(nullable: true), + Role = table.Column(maxLength: 50, nullable: true), + Token = table.Column(nullable: true), + PasswordHash = table.Column(nullable: true), + PasswordSalt = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_UserProfile", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "PlacementTest", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), + TeacherId = table.Column(nullable: true), + LevelId = table.Column(nullable: true), + PlacementTestDate = table.Column(type: "datetime", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_PlacementTest", x => x.Id); + table.ForeignKey( + name: "FK_PlacementTest_Level", + column: x => x.LevelId, + principalTable: "Level", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Teacher", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), + FirstName = table.Column(maxLength: 50, nullable: true), + LastName = table.Column(maxLength: 50, nullable: true), + SubjectId = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Teacher", x => x.Id); + table.ForeignKey( + name: "FK_Teacher_Subject", + column: x => x.SubjectId, + principalTable: "Subject", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Student", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), + FirstName = table.Column(maxLength: 50, nullable: false), + LastName = table.Column(maxLength: 50, nullable: false), + DateOfBirth = table.Column(type: "date", nullable: true), + Gender = table.Column(type: "nchar(10)", nullable: true), + NativeLanguage = table.Column(maxLength: 50, nullable: true), + Citizenship = table.Column(maxLength: 50, nullable: true), + PassportNumber = table.Column(nullable: true), + Hometown = table.Column(nullable: true), + WorkPlace = table.Column(nullable: true), + PlaceOfStudy = table.Column(nullable: true), + DateOfRegistration = table.Column(type: "datetime", nullable: true), + UserProfileId = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Student", x => x.Id); + table.ForeignKey( + name: "FK_Student_Country", + column: x => x.UserProfileId, + principalTable: "UserProfile", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateIndex( + name: "IX_PlacementTest_LevelId", + table: "PlacementTest", + column: "LevelId"); + + migrationBuilder.CreateIndex( + name: "IX_Student_UserProfileId", + table: "Student", + column: "UserProfileId"); + + migrationBuilder.CreateIndex( + name: "IX_Teacher_SubjectId", + table: "Teacher", + column: "SubjectId"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "City"); + + migrationBuilder.DropTable( + name: "Country"); + + migrationBuilder.DropTable( + name: "PlacementTest"); + + migrationBuilder.DropTable( + name: "Student"); + + migrationBuilder.DropTable( + name: "Teacher"); + + migrationBuilder.DropTable( + name: "Level"); + + migrationBuilder.DropTable( + name: "UserProfile"); + + migrationBuilder.DropTable( + name: "Subject"); + } + } +} diff --git a/LearningCentre/Migrations/20190613051245_Update.Designer.cs b/LearningCentre/Migrations/20190613051245_Update.Designer.cs new file mode 100644 index 0000000..13ad1d4 --- /dev/null +++ b/LearningCentre/Migrations/20190613051245_Update.Designer.cs @@ -0,0 +1,225 @@ +// +using System; +using LearningCentre.Database; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +namespace LearningCentre.Migrations +{ + [DbContext(typeof(LearningCentreContext))] + [Migration("20190613051245_Update")] + partial class Update + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("LearningCentre.Database.City", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Code"); + + b.Property("CountryId"); + + b.Property("Name"); + + b.HasKey("Id"); + + b.ToTable("City"); + }); + + modelBuilder.Entity("LearningCentre.Database.Country", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Code"); + + b.Property("Name"); + + b.HasKey("Id"); + + b.ToTable("Country"); + }); + + modelBuilder.Entity("LearningCentre.Database.Level", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Name"); + + b.HasKey("Id"); + + b.ToTable("Level"); + }); + + modelBuilder.Entity("LearningCentre.Database.PlacementTest", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("LevelId"); + + b.Property("PlacementTestDate") + .HasColumnType("datetime"); + + b.Property("TeacherId"); + + b.HasKey("Id"); + + b.HasIndex("LevelId"); + + b.ToTable("PlacementTest"); + }); + + modelBuilder.Entity("LearningCentre.Database.Student", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Citizenship") + .HasMaxLength(50); + + b.Property("CountryId"); + + b.Property("DateOfBirth") + .HasColumnType("date"); + + b.Property("DateOfRegistration") + .HasColumnType("datetime"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(50); + + b.Property("Gender") + .HasColumnType("nchar(10)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(50); + + b.Property("NativeLanguage") + .HasMaxLength(50); + + b.Property("PassportNumber"); + + b.Property("PlaceOfStudy"); + + b.Property("UserProfileId"); + + b.Property("WorkPlace"); + + b.HasKey("Id"); + + b.HasIndex("CountryId"); + + b.HasIndex("UserProfileId"); + + b.ToTable("Student"); + }); + + modelBuilder.Entity("LearningCentre.Database.Subject", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Name"); + + b.HasKey("Id"); + + b.ToTable("Subject"); + }); + + modelBuilder.Entity("LearningCentre.Database.Teacher", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("FirstName") + .HasMaxLength(50); + + b.Property("LastName") + .HasMaxLength(50); + + b.Property("SubjectId"); + + b.HasKey("Id"); + + b.HasIndex("SubjectId"); + + b.ToTable("Teacher"); + }); + + modelBuilder.Entity("LearningCentre.Database.UserProfile", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Password"); + + b.Property("PasswordHash"); + + b.Property("PasswordSalt"); + + b.Property("Role") + .HasMaxLength(50); + + b.Property("Token"); + + b.Property("Username"); + + b.HasKey("Id"); + + b.ToTable("UserProfile"); + }); + + modelBuilder.Entity("LearningCentre.Database.PlacementTest", b => + { + b.HasOne("LearningCentre.Database.Level", "Level") + .WithMany("PlacementTest") + .HasForeignKey("LevelId") + .HasConstraintName("FK_PlacementTest_Level"); + }); + + modelBuilder.Entity("LearningCentre.Database.Student", b => + { + b.HasOne("LearningCentre.Database.Country", "Country") + .WithMany("Student") + .HasForeignKey("CountryId"); + + b.HasOne("LearningCentre.Database.UserProfile", "UserProfile") + .WithMany("Student") + .HasForeignKey("UserProfileId") + .HasConstraintName("FK_Student_Country"); + }); + + modelBuilder.Entity("LearningCentre.Database.Teacher", b => + { + b.HasOne("LearningCentre.Database.Subject", "Subject") + .WithMany("Teacher") + .HasForeignKey("SubjectId") + .HasConstraintName("FK_Teacher_Subject"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/LearningCentre/Migrations/20190613051245_Update.cs b/LearningCentre/Migrations/20190613051245_Update.cs new file mode 100644 index 0000000..4e4c0cd --- /dev/null +++ b/LearningCentre/Migrations/20190613051245_Update.cs @@ -0,0 +1,44 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace LearningCentre.Migrations +{ + public partial class Update : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.RenameColumn( + name: "Hometown", + table: "Student", + newName: "CountryId"); + + migrationBuilder.CreateIndex( + name: "IX_Student_CountryId", + table: "Student", + column: "CountryId"); + + migrationBuilder.AddForeignKey( + name: "FK_Student_Country_CountryId", + table: "Student", + column: "CountryId", + principalTable: "Country", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_Student_Country_CountryId", + table: "Student"); + + migrationBuilder.DropIndex( + name: "IX_Student_CountryId", + table: "Student"); + + migrationBuilder.RenameColumn( + name: "CountryId", + table: "Student", + newName: "Hometown"); + } + } +} diff --git a/LearningCentre/Migrations/LearningCentreContextModelSnapshot.cs b/LearningCentre/Migrations/LearningCentreContextModelSnapshot.cs new file mode 100644 index 0000000..b0b1b54 --- /dev/null +++ b/LearningCentre/Migrations/LearningCentreContextModelSnapshot.cs @@ -0,0 +1,223 @@ +// +using System; +using LearningCentre.Database; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +namespace LearningCentre.Migrations +{ + [DbContext(typeof(LearningCentreContext))] + partial class LearningCentreContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("LearningCentre.Database.City", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Code"); + + b.Property("CountryId"); + + b.Property("Name"); + + b.HasKey("Id"); + + b.ToTable("City"); + }); + + modelBuilder.Entity("LearningCentre.Database.Country", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Code"); + + b.Property("Name"); + + b.HasKey("Id"); + + b.ToTable("Country"); + }); + + modelBuilder.Entity("LearningCentre.Database.Level", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Name"); + + b.HasKey("Id"); + + b.ToTable("Level"); + }); + + modelBuilder.Entity("LearningCentre.Database.PlacementTest", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("LevelId"); + + b.Property("PlacementTestDate") + .HasColumnType("datetime"); + + b.Property("TeacherId"); + + b.HasKey("Id"); + + b.HasIndex("LevelId"); + + b.ToTable("PlacementTest"); + }); + + modelBuilder.Entity("LearningCentre.Database.Student", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Citizenship") + .HasMaxLength(50); + + b.Property("CountryId"); + + b.Property("DateOfBirth") + .HasColumnType("date"); + + b.Property("DateOfRegistration") + .HasColumnType("datetime"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(50); + + b.Property("Gender") + .HasColumnType("nchar(10)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(50); + + b.Property("NativeLanguage") + .HasMaxLength(50); + + b.Property("PassportNumber"); + + b.Property("PlaceOfStudy"); + + b.Property("UserProfileId"); + + b.Property("WorkPlace"); + + b.HasKey("Id"); + + b.HasIndex("CountryId"); + + b.HasIndex("UserProfileId"); + + b.ToTable("Student"); + }); + + modelBuilder.Entity("LearningCentre.Database.Subject", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Name"); + + b.HasKey("Id"); + + b.ToTable("Subject"); + }); + + modelBuilder.Entity("LearningCentre.Database.Teacher", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("FirstName") + .HasMaxLength(50); + + b.Property("LastName") + .HasMaxLength(50); + + b.Property("SubjectId"); + + b.HasKey("Id"); + + b.HasIndex("SubjectId"); + + b.ToTable("Teacher"); + }); + + modelBuilder.Entity("LearningCentre.Database.UserProfile", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Password"); + + b.Property("PasswordHash"); + + b.Property("PasswordSalt"); + + b.Property("Role") + .HasMaxLength(50); + + b.Property("Token"); + + b.Property("Username"); + + b.HasKey("Id"); + + b.ToTable("UserProfile"); + }); + + modelBuilder.Entity("LearningCentre.Database.PlacementTest", b => + { + b.HasOne("LearningCentre.Database.Level", "Level") + .WithMany("PlacementTest") + .HasForeignKey("LevelId") + .HasConstraintName("FK_PlacementTest_Level"); + }); + + modelBuilder.Entity("LearningCentre.Database.Student", b => + { + b.HasOne("LearningCentre.Database.Country", "Country") + .WithMany("Student") + .HasForeignKey("CountryId"); + + b.HasOne("LearningCentre.Database.UserProfile", "UserProfile") + .WithMany("Student") + .HasForeignKey("UserProfileId") + .HasConstraintName("FK_Student_Country"); + }); + + modelBuilder.Entity("LearningCentre.Database.Teacher", b => + { + b.HasOne("LearningCentre.Database.Subject", "Subject") + .WithMany("Teacher") + .HasForeignKey("SubjectId") + .HasConstraintName("FK_Teacher_Subject"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/LearningCentre/appsettings.json b/LearningCentre/appsettings.json index c8a1998..c571922 100644 --- a/LearningCentre/appsettings.json +++ b/LearningCentre/appsettings.json @@ -3,7 +3,7 @@ "Secret": "My Name Is Abdulatif my phone number is +998935464689. It is my secret key" }, "ConnectionStrings": { - "Database": "Server=Joker\\SqlExpress;Database=LearningCentre;Trusted_Connection=True;" + "Database": "Server=Joker\\SqlExpress1uz;Database=LearningCentre;Trusted_Connection=True;" }, "Logging": { "IncludeScopes": false, diff --git a/LearningCentre/bin/Debug/netcoreapp2.2/LearningCentre.dll b/LearningCentre/bin/Debug/netcoreapp2.2/LearningCentre.dll index db2ca99..81d4401 100644 Binary files a/LearningCentre/bin/Debug/netcoreapp2.2/LearningCentre.dll and b/LearningCentre/bin/Debug/netcoreapp2.2/LearningCentre.dll differ diff --git a/LearningCentre/bin/Debug/netcoreapp2.2/LearningCentre.pdb b/LearningCentre/bin/Debug/netcoreapp2.2/LearningCentre.pdb index 963e2cf..b3ff2ab 100644 Binary files a/LearningCentre/bin/Debug/netcoreapp2.2/LearningCentre.pdb and b/LearningCentre/bin/Debug/netcoreapp2.2/LearningCentre.pdb differ diff --git a/LearningCentre/obj/Debug/netcoreapp2.2/LearningCentre.assets.cache b/LearningCentre/obj/Debug/netcoreapp2.2/LearningCentre.assets.cache index bce7f13..705356f 100644 Binary files a/LearningCentre/obj/Debug/netcoreapp2.2/LearningCentre.assets.cache and b/LearningCentre/obj/Debug/netcoreapp2.2/LearningCentre.assets.cache differ diff --git a/LearningCentre/obj/Debug/netcoreapp2.2/LearningCentre.csproj.CoreCompileInputs.cache b/LearningCentre/obj/Debug/netcoreapp2.2/LearningCentre.csproj.CoreCompileInputs.cache index 2461015..0f56988 100644 --- a/LearningCentre/obj/Debug/netcoreapp2.2/LearningCentre.csproj.CoreCompileInputs.cache +++ b/LearningCentre/obj/Debug/netcoreapp2.2/LearningCentre.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -d24d445a909d2d86988a2a8811796e696346f575 +f4014c1bf97d53c4df61ed2ef5925678bc2ca574 diff --git a/LearningCentre/obj/Debug/netcoreapp2.2/LearningCentre.csproj.FileListAbsolute.txt b/LearningCentre/obj/Debug/netcoreapp2.2/LearningCentre.csproj.FileListAbsolute.txt index c306136..d817270 100644 --- a/LearningCentre/obj/Debug/netcoreapp2.2/LearningCentre.csproj.FileListAbsolute.txt +++ b/LearningCentre/obj/Debug/netcoreapp2.2/LearningCentre.csproj.FileListAbsolute.txt @@ -23,3 +23,17 @@ D:\Projects\LR\LR Server App\LearningCentre\LearningCentre\obj\Debug\netcoreapp2 D:\Projects\LR\LR Server App\LearningCentre\LearningCentre\obj\Debug\netcoreapp2.2\LearningCentre.RazorTargetAssemblyInfo.cache D:\Projects\LR\LR Server App\LearningCentre\LearningCentre\obj\Debug\netcoreapp2.2\LearningCentre.dll D:\Projects\LR\LR Server App\LearningCentre\LearningCentre\obj\Debug\netcoreapp2.2\LearningCentre.pdb +D:\Projects\LR\LR Server App\LR-Learning-Centre\LearningCentre\bin\Debug\netcoreapp2.2\LearningCentre.deps.json +D:\Projects\LR\LR Server App\LR-Learning-Centre\LearningCentre\bin\Debug\netcoreapp2.2\LearningCentre.runtimeconfig.json +D:\Projects\LR\LR Server App\LR-Learning-Centre\LearningCentre\bin\Debug\netcoreapp2.2\LearningCentre.runtimeconfig.dev.json +D:\Projects\LR\LR Server App\LR-Learning-Centre\LearningCentre\bin\Debug\netcoreapp2.2\LearningCentre.dll +D:\Projects\LR\LR Server App\LR-Learning-Centre\LearningCentre\bin\Debug\netcoreapp2.2\LearningCentre.pdb +D:\Projects\LR\LR Server App\LR-Learning-Centre\LearningCentre\obj\Debug\netcoreapp2.2\LearningCentre.csprojAssemblyReference.cache +D:\Projects\LR\LR Server App\LR-Learning-Centre\LearningCentre\obj\Debug\netcoreapp2.2\LearningCentre.csproj.CoreCompileInputs.cache +D:\Projects\LR\LR Server App\LR-Learning-Centre\LearningCentre\obj\Debug\netcoreapp2.2\LearningCentre.RazorAssemblyInfo.cache +D:\Projects\LR\LR Server App\LR-Learning-Centre\LearningCentre\obj\Debug\netcoreapp2.2\LearningCentre.RazorAssemblyInfo.cs +D:\Projects\LR\LR Server App\LR-Learning-Centre\LearningCentre\obj\Debug\netcoreapp2.2\LearningCentre.AssemblyInfoInputs.cache +D:\Projects\LR\LR Server App\LR-Learning-Centre\LearningCentre\obj\Debug\netcoreapp2.2\LearningCentre.AssemblyInfo.cs +D:\Projects\LR\LR Server App\LR-Learning-Centre\LearningCentre\obj\Debug\netcoreapp2.2\LearningCentre.RazorTargetAssemblyInfo.cache +D:\Projects\LR\LR Server App\LR-Learning-Centre\LearningCentre\obj\Debug\netcoreapp2.2\LearningCentre.dll +D:\Projects\LR\LR Server App\LR-Learning-Centre\LearningCentre\obj\Debug\netcoreapp2.2\LearningCentre.pdb diff --git a/LearningCentre/obj/Debug/netcoreapp2.2/LearningCentre.dll b/LearningCentre/obj/Debug/netcoreapp2.2/LearningCentre.dll index db2ca99..81d4401 100644 Binary files a/LearningCentre/obj/Debug/netcoreapp2.2/LearningCentre.dll and b/LearningCentre/obj/Debug/netcoreapp2.2/LearningCentre.dll differ diff --git a/LearningCentre/obj/Debug/netcoreapp2.2/LearningCentre.pdb b/LearningCentre/obj/Debug/netcoreapp2.2/LearningCentre.pdb index 963e2cf..b3ff2ab 100644 Binary files a/LearningCentre/obj/Debug/netcoreapp2.2/LearningCentre.pdb and b/LearningCentre/obj/Debug/netcoreapp2.2/LearningCentre.pdb differ diff --git a/LearningCentre/obj/LearningCentre.csproj.nuget.cache b/LearningCentre/obj/LearningCentre.csproj.nuget.cache index 532c616..2d71d2a 100644 --- a/LearningCentre/obj/LearningCentre.csproj.nuget.cache +++ b/LearningCentre/obj/LearningCentre.csproj.nuget.cache @@ -1,5 +1,5 @@ { "version": 1, - "dgSpecHash": "iiKo6Y49fArhUC34DnNAgYSRM7C+lby9fNdAR508cEmCqhjoW4NWCm/3fOdqJoal6gjdE1pWR3+9Z1iBbl1G6A==", + "dgSpecHash": "K7tXRcFnQOMhVOg0H2339r8mdUfKkr6cZsL80+/28B+LTD/Qe5Zw8v4h+/SDnjibWFSdsuk6LZcLW6XRvGjUPw==", "success": true } \ No newline at end of file diff --git a/LearningCentre/obj/LearningCentre.csproj.nuget.g.props b/LearningCentre/obj/LearningCentre.csproj.nuget.g.props index 109487c..a131287 100644 --- a/LearningCentre/obj/LearningCentre.csproj.nuget.g.props +++ b/LearningCentre/obj/LearningCentre.csproj.nuget.g.props @@ -3,7 +3,7 @@ True NuGet - D:\Projects\LR\LR Server App\LearningCentre\LearningCentre\obj\project.assets.json + D:\Projects\LR\LR Server App\LR-Learning-Centre\LearningCentre\obj\project.assets.json $(UserProfile)\.nuget\packages\ C:\Users\l.rasulov\.nuget\packages\;C:\Program Files\dotnet\sdk\NuGetFallbackFolder PackageReference diff --git a/LearningCentre/obj/project.assets.json b/LearningCentre/obj/project.assets.json index d46e7c5..153293e 100644 --- a/LearningCentre/obj/project.assets.json +++ b/LearningCentre/obj/project.assets.json @@ -14134,11 +14134,11 @@ "project": { "version": "1.0.0", "restore": { - "projectUniqueName": "D:\\Projects\\LR\\LR Server App\\LearningCentre\\LearningCentre\\LearningCentre.csproj", + "projectUniqueName": "D:\\Projects\\LR\\LR Server App\\LR-Learning-Centre\\LearningCentre\\LearningCentre.csproj", "projectName": "LearningCentre", - "projectPath": "D:\\Projects\\LR\\LR Server App\\LearningCentre\\LearningCentre\\LearningCentre.csproj", + "projectPath": "D:\\Projects\\LR\\LR Server App\\LR-Learning-Centre\\LearningCentre\\LearningCentre.csproj", "packagesPath": "C:\\Users\\l.rasulov\\.nuget\\packages\\", - "outputPath": "D:\\Projects\\LR\\LR Server App\\LearningCentre\\LearningCentre\\obj\\", + "outputPath": "D:\\Projects\\LR\\LR Server App\\LR-Learning-Centre\\LearningCentre\\obj\\", "projectStyle": "PackageReference", "fallbackFolders": [ "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder"