From 15464d501f632a52b4c1cc7c03fe6b05c1fd0c09 Mon Sep 17 00:00:00 2001 From: Modern 14 Date: Wed, 20 Nov 2024 16:09:09 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D1=8C=D1=82?= =?UTF-8?q?=D0=B5=20=D1=84=D0=B0=D0=B9=D0=BB=D1=8B=20=D0=BF=D1=80=D0=BE?= =?UTF-8?q?=D0=B5=D0=BA=D1=82=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/Context/ApplicationDbContext.cs | 56 ++++ data/DAO/Attendance.cs | 18 ++ data/DAO/Group.cs | 16 ++ data/DAO/Lesson.cs | 22 ++ data/DAO/Semester.cs | 15 ++ data/DAO/Student.cs | 18 ++ data/DAO/Subject.cs | 15 ++ .../20241120125823_InitialCreate.Designer.cs | 248 ++++++++++++++++++ .../20241120125823_InitialCreate.cs | 189 +++++++++++++ .../ApplicationDbContextModelSnapshot.cs | 245 +++++++++++++++++ data/data.csproj | 22 ++ desktop.ini | 2 + presence.sln | 22 ++ 13 files changed, 888 insertions(+) create mode 100644 data/Context/ApplicationDbContext.cs create mode 100644 data/DAO/Attendance.cs create mode 100644 data/DAO/Group.cs create mode 100644 data/DAO/Lesson.cs create mode 100644 data/DAO/Semester.cs create mode 100644 data/DAO/Student.cs create mode 100644 data/DAO/Subject.cs create mode 100644 data/Migrations/20241120125823_InitialCreate.Designer.cs create mode 100644 data/Migrations/20241120125823_InitialCreate.cs create mode 100644 data/Migrations/ApplicationDbContextModelSnapshot.cs create mode 100644 data/data.csproj create mode 100644 desktop.ini create mode 100644 presence.sln diff --git a/data/Context/ApplicationDbContext.cs b/data/Context/ApplicationDbContext.cs new file mode 100644 index 0000000..03cb65c --- /dev/null +++ b/data/Context/ApplicationDbContext.cs @@ -0,0 +1,56 @@ +using data.DAO; +using Microsoft.EntityFrameworkCore; + +namespace data.Context +{ + public class ApplicationDbContext : DbContext + { + public DbSet Students { get; set; } + public DbSet Groups { get; set; } + public DbSet Subjects { get; set; } + public DbSet Semesters { get; set; } + public DbSet Lessons { get; set; } + public DbSet Attendances { get; set; } + + + + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + modelBuilder.Entity() + .HasOne(s => s.Group) + .WithMany(g => g.Students) + .HasForeignKey(s => s.GroupId); + + modelBuilder.Entity() + .HasOne(l => l.Subject) + .WithMany(s => s.Lessons) + .HasForeignKey(l => l.SubjectId); + + modelBuilder.Entity() + .HasOne(l => l.Semester) + .WithMany(s => s.Lessons) + .HasForeignKey(l => l.SemesterId); + + modelBuilder.Entity() + .HasOne(l => l.Group) + .WithMany(g => g.Lessons) + .HasForeignKey(l => l.GroupId); + + modelBuilder.Entity() + .HasOne(a => a.Student) + .WithMany(s => s.Attendances) + .HasForeignKey(a => a.StudentId); + + modelBuilder.Entity() + .HasOne(a => a.Lesson) + .WithMany(l => l.Attendances) + .HasForeignKey(a => a.LessonId); + } + + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + optionsBuilder.UseNpgsql("Host=45.67.56.214;Database=user17;Username=user17;Password=3JSONQyy;Port=5454"); + } + } +} diff --git a/data/DAO/Attendance.cs b/data/DAO/Attendance.cs new file mode 100644 index 0000000..7a115dd --- /dev/null +++ b/data/DAO/Attendance.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace data.DAO +{ + public class Attendance + { + public int Id { get; set; } + public int StudentId { get; set; } + public Student Student { get; set; } + public int LessonId { get; set; } + public Lesson Lesson { get; set; } + public string Status { get; set; } + } +} diff --git a/data/DAO/Group.cs b/data/DAO/Group.cs new file mode 100644 index 0000000..f74ab56 --- /dev/null +++ b/data/DAO/Group.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace data.DAO +{ + public class Group + { + public int Id { get; set; } + public string Name { get; set; } + public ICollection Students { get; set; } + public ICollection Lessons { get; set; } + } +} diff --git a/data/DAO/Lesson.cs b/data/DAO/Lesson.cs new file mode 100644 index 0000000..582f217 --- /dev/null +++ b/data/DAO/Lesson.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace data.DAO +{ + public class Lesson + { + public int Id { get; set; } + public int SubjectId { get; set; } + public Subject Subject { get; set; } + public int SemesterId { get; set; } + public Semester Semester { get; set; } + public int GroupId { get; set; } + public Group Group { get; set; } + public DateTime Date { get; set; } + public int LessonNumber { get; set; } + public ICollection Attendances { get; set; } + } +} diff --git a/data/DAO/Semester.cs b/data/DAO/Semester.cs new file mode 100644 index 0000000..d33a06b --- /dev/null +++ b/data/DAO/Semester.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace data.DAO +{ + public class Semester + { + public int Id { get; set; } + public string Name { get; set; } + public ICollection Lessons { get; set; } + } +} diff --git a/data/DAO/Student.cs b/data/DAO/Student.cs new file mode 100644 index 0000000..7dd9b8e --- /dev/null +++ b/data/DAO/Student.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading.Tasks; + +namespace data.DAO +{ + public class Student + { + public int Id { get; set; } + public string Name { get; set; } + public int GroupId { get; set; } + public Group Group { get; set; } + public ICollection Attendances { get; set; } + } +} diff --git a/data/DAO/Subject.cs b/data/DAO/Subject.cs new file mode 100644 index 0000000..f42b371 --- /dev/null +++ b/data/DAO/Subject.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace data.DAO +{ + public class Subject + { + public int Id { get; set; } + public string Name { get; set; } + public ICollection Lessons { get; set; } + } +} diff --git a/data/Migrations/20241120125823_InitialCreate.Designer.cs b/data/Migrations/20241120125823_InitialCreate.Designer.cs new file mode 100644 index 0000000..802a84a --- /dev/null +++ b/data/Migrations/20241120125823_InitialCreate.Designer.cs @@ -0,0 +1,248 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using data.Context; + +#nullable disable + +namespace data.Migrations +{ + [DbContext(typeof(ApplicationDbContext))] + [Migration("20241120125823_InitialCreate")] + partial class InitialCreate + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.10") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("data.DAO.Attendance", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("LessonId") + .HasColumnType("integer"); + + b.Property("Status") + .IsRequired() + .HasColumnType("text"); + + b.Property("StudentId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("LessonId"); + + b.HasIndex("StudentId"); + + b.ToTable("Attendances"); + }); + + modelBuilder.Entity("data.DAO.Group", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Groups"); + }); + + modelBuilder.Entity("data.DAO.Lesson", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Date") + .HasColumnType("timestamp with time zone"); + + b.Property("GroupId") + .HasColumnType("integer"); + + b.Property("LessonNumber") + .HasColumnType("integer"); + + b.Property("SemesterId") + .HasColumnType("integer"); + + b.Property("SubjectId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("GroupId"); + + b.HasIndex("SemesterId"); + + b.HasIndex("SubjectId"); + + b.ToTable("Lessons"); + }); + + modelBuilder.Entity("data.DAO.Semester", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Semesters"); + }); + + modelBuilder.Entity("data.DAO.Student", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("GroupId") + .HasColumnType("integer"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("GroupId"); + + b.ToTable("Students"); + }); + + modelBuilder.Entity("data.DAO.Subject", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Subjects"); + }); + + modelBuilder.Entity("data.DAO.Attendance", b => + { + b.HasOne("data.DAO.Lesson", "Lesson") + .WithMany("Attendances") + .HasForeignKey("LessonId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("data.DAO.Student", "Student") + .WithMany("Attendances") + .HasForeignKey("StudentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Lesson"); + + b.Navigation("Student"); + }); + + modelBuilder.Entity("data.DAO.Lesson", b => + { + b.HasOne("data.DAO.Group", "Group") + .WithMany("Lessons") + .HasForeignKey("GroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("data.DAO.Semester", "Semester") + .WithMany("Lessons") + .HasForeignKey("SemesterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("data.DAO.Subject", "Subject") + .WithMany("Lessons") + .HasForeignKey("SubjectId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Group"); + + b.Navigation("Semester"); + + b.Navigation("Subject"); + }); + + modelBuilder.Entity("data.DAO.Student", b => + { + b.HasOne("data.DAO.Group", "Group") + .WithMany("Students") + .HasForeignKey("GroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Group"); + }); + + modelBuilder.Entity("data.DAO.Group", b => + { + b.Navigation("Lessons"); + + b.Navigation("Students"); + }); + + modelBuilder.Entity("data.DAO.Lesson", b => + { + b.Navigation("Attendances"); + }); + + modelBuilder.Entity("data.DAO.Semester", b => + { + b.Navigation("Lessons"); + }); + + modelBuilder.Entity("data.DAO.Student", b => + { + b.Navigation("Attendances"); + }); + + modelBuilder.Entity("data.DAO.Subject", b => + { + b.Navigation("Lessons"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/data/Migrations/20241120125823_InitialCreate.cs b/data/Migrations/20241120125823_InitialCreate.cs new file mode 100644 index 0000000..b3a8258 --- /dev/null +++ b/data/Migrations/20241120125823_InitialCreate.cs @@ -0,0 +1,189 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace data.Migrations +{ + /// + public partial class InitialCreate : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "Groups", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Name = table.Column(type: "text", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Groups", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Semesters", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Name = table.Column(type: "text", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Semesters", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Subjects", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Name = table.Column(type: "text", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Subjects", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Students", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Name = table.Column(type: "text", nullable: false), + GroupId = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Students", x => x.Id); + table.ForeignKey( + name: "FK_Students_Groups_GroupId", + column: x => x.GroupId, + principalTable: "Groups", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Lessons", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + SubjectId = table.Column(type: "integer", nullable: false), + SemesterId = table.Column(type: "integer", nullable: false), + GroupId = table.Column(type: "integer", nullable: false), + Date = table.Column(type: "timestamp with time zone", nullable: false), + LessonNumber = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Lessons", x => x.Id); + table.ForeignKey( + name: "FK_Lessons_Groups_GroupId", + column: x => x.GroupId, + principalTable: "Groups", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_Lessons_Semesters_SemesterId", + column: x => x.SemesterId, + principalTable: "Semesters", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_Lessons_Subjects_SubjectId", + column: x => x.SubjectId, + principalTable: "Subjects", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Attendances", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + StudentId = table.Column(type: "integer", nullable: false), + LessonId = table.Column(type: "integer", nullable: false), + Status = table.Column(type: "text", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Attendances", x => x.Id); + table.ForeignKey( + name: "FK_Attendances_Lessons_LessonId", + column: x => x.LessonId, + principalTable: "Lessons", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_Attendances_Students_StudentId", + column: x => x.StudentId, + principalTable: "Students", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_Attendances_LessonId", + table: "Attendances", + column: "LessonId"); + + migrationBuilder.CreateIndex( + name: "IX_Attendances_StudentId", + table: "Attendances", + column: "StudentId"); + + migrationBuilder.CreateIndex( + name: "IX_Lessons_GroupId", + table: "Lessons", + column: "GroupId"); + + migrationBuilder.CreateIndex( + name: "IX_Lessons_SemesterId", + table: "Lessons", + column: "SemesterId"); + + migrationBuilder.CreateIndex( + name: "IX_Lessons_SubjectId", + table: "Lessons", + column: "SubjectId"); + + migrationBuilder.CreateIndex( + name: "IX_Students_GroupId", + table: "Students", + column: "GroupId"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "Attendances"); + + migrationBuilder.DropTable( + name: "Lessons"); + + migrationBuilder.DropTable( + name: "Students"); + + migrationBuilder.DropTable( + name: "Semesters"); + + migrationBuilder.DropTable( + name: "Subjects"); + + migrationBuilder.DropTable( + name: "Groups"); + } + } +} diff --git a/data/Migrations/ApplicationDbContextModelSnapshot.cs b/data/Migrations/ApplicationDbContextModelSnapshot.cs new file mode 100644 index 0000000..562aba0 --- /dev/null +++ b/data/Migrations/ApplicationDbContextModelSnapshot.cs @@ -0,0 +1,245 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using data.Context; + +#nullable disable + +namespace data.Migrations +{ + [DbContext(typeof(ApplicationDbContext))] + partial class ApplicationDbContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.10") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("data.DAO.Attendance", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("LessonId") + .HasColumnType("integer"); + + b.Property("Status") + .IsRequired() + .HasColumnType("text"); + + b.Property("StudentId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("LessonId"); + + b.HasIndex("StudentId"); + + b.ToTable("Attendances"); + }); + + modelBuilder.Entity("data.DAO.Group", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Groups"); + }); + + modelBuilder.Entity("data.DAO.Lesson", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Date") + .HasColumnType("timestamp with time zone"); + + b.Property("GroupId") + .HasColumnType("integer"); + + b.Property("LessonNumber") + .HasColumnType("integer"); + + b.Property("SemesterId") + .HasColumnType("integer"); + + b.Property("SubjectId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("GroupId"); + + b.HasIndex("SemesterId"); + + b.HasIndex("SubjectId"); + + b.ToTable("Lessons"); + }); + + modelBuilder.Entity("data.DAO.Semester", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Semesters"); + }); + + modelBuilder.Entity("data.DAO.Student", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("GroupId") + .HasColumnType("integer"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("GroupId"); + + b.ToTable("Students"); + }); + + modelBuilder.Entity("data.DAO.Subject", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Subjects"); + }); + + modelBuilder.Entity("data.DAO.Attendance", b => + { + b.HasOne("data.DAO.Lesson", "Lesson") + .WithMany("Attendances") + .HasForeignKey("LessonId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("data.DAO.Student", "Student") + .WithMany("Attendances") + .HasForeignKey("StudentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Lesson"); + + b.Navigation("Student"); + }); + + modelBuilder.Entity("data.DAO.Lesson", b => + { + b.HasOne("data.DAO.Group", "Group") + .WithMany("Lessons") + .HasForeignKey("GroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("data.DAO.Semester", "Semester") + .WithMany("Lessons") + .HasForeignKey("SemesterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("data.DAO.Subject", "Subject") + .WithMany("Lessons") + .HasForeignKey("SubjectId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Group"); + + b.Navigation("Semester"); + + b.Navigation("Subject"); + }); + + modelBuilder.Entity("data.DAO.Student", b => + { + b.HasOne("data.DAO.Group", "Group") + .WithMany("Students") + .HasForeignKey("GroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Group"); + }); + + modelBuilder.Entity("data.DAO.Group", b => + { + b.Navigation("Lessons"); + + b.Navigation("Students"); + }); + + modelBuilder.Entity("data.DAO.Lesson", b => + { + b.Navigation("Attendances"); + }); + + modelBuilder.Entity("data.DAO.Semester", b => + { + b.Navigation("Lessons"); + }); + + modelBuilder.Entity("data.DAO.Student", b => + { + b.Navigation("Attendances"); + }); + + modelBuilder.Entity("data.DAO.Subject", b => + { + b.Navigation("Lessons"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/data/data.csproj b/data/data.csproj new file mode 100644 index 0000000..0ed250b --- /dev/null +++ b/data/data.csproj @@ -0,0 +1,22 @@ + + + + net8.0 + enable + enable + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + diff --git a/desktop.ini b/desktop.ini new file mode 100644 index 0000000..bf89f9d --- /dev/null +++ b/desktop.ini @@ -0,0 +1,2 @@ +[LocalizedFileNames] +presence.sln=@presence.sln,0 diff --git a/presence.sln b/presence.sln new file mode 100644 index 0000000..e9dfa8a --- /dev/null +++ b/presence.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "data", "data\data.csproj", "{74567B9C-DFD3-4878-9DF8-41F8556F2D91}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {74567B9C-DFD3-4878-9DF8-41F8556F2D91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {74567B9C-DFD3-4878-9DF8-41F8556F2D91}.Debug|Any CPU.Build.0 = Debug|Any CPU + {74567B9C-DFD3-4878-9DF8-41F8556F2D91}.Release|Any CPU.ActiveCfg = Release|Any CPU + {74567B9C-DFD3-4878-9DF8-41F8556F2D91}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal