diff --git a/API_SQLuedo/EntityFramework/BlackListEntity.cs b/API_SQLuedo/EntityFramework/BlackListEntity.cs index bcc8c6d..e4b744b 100644 --- a/API_SQLuedo/EntityFramework/BlackListEntity.cs +++ b/API_SQLuedo/EntityFramework/BlackListEntity.cs @@ -1,22 +1,18 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace Entities +namespace Entities; + +[Table("BlackList")] +public class BlackListEntity { - public class BlackListEntity + [Key] + public string Email { get; set; } + public DateOnly ExpirationDate { get; set; } + public BlackListEntity() { } + public BlackListEntity(string email, DateOnly expirationDate) { - [Key] - public string Email { get; set; } - public DateOnly ExpirationDate { get; set; } - public BlackListEntity() { } - public BlackListEntity(string email, DateOnly expirationDate) - { - Email = email; - ExpirationDate = expirationDate; - } + Email = email; + ExpirationDate = expirationDate; } -} +} \ No newline at end of file diff --git a/API_SQLuedo/EntityFramework/ContentLessonEntity.cs b/API_SQLuedo/EntityFramework/ContentLessonEntity.cs index 414fef6..067cc39 100644 --- a/API_SQLuedo/EntityFramework/ContentLessonEntity.cs +++ b/API_SQLuedo/EntityFramework/ContentLessonEntity.cs @@ -1,24 +1,24 @@ using System.ComponentModel.DataAnnotations.Schema; -namespace Entities +namespace Entities; + +[Table("ContentLesson")] +public class ContentLessonEntity { - public class ContentLessonEntity - { - [ForeignKey(nameof(Lesson))] - public int LessonId { get; set; } - public LessonEntity Lesson { get; set; } + [ForeignKey(nameof(Lesson))] + public int LessonId { get; set; } + public LessonEntity Lesson { get; set; } - [ForeignKey(nameof(Paragraph))] - public int LessonPartId { get; set; } - public ParagraphEntity Paragraph { get; set; } + [ForeignKey(nameof(Paragraph))] + public int LessonPartId { get; set; } + public ParagraphEntity Paragraph { get; set; } - public ContentLessonEntity(){} - public ContentLessonEntity(int lessonId, LessonEntity lesson, int lessonPartId, ParagraphEntity paragraph) - { - LessonId = lessonId; - Lesson = lesson; - LessonPartId = lessonPartId; - Paragraph = paragraph; - } + public ContentLessonEntity(){} + public ContentLessonEntity(int lessonId, LessonEntity lesson, int lessonPartId, ParagraphEntity paragraph) + { + LessonId = lessonId; + Lesson = lesson; + LessonPartId = lessonPartId; + Paragraph = paragraph; } -} +} \ No newline at end of file diff --git a/API_SQLuedo/EntityFramework/InquiryEntity.cs b/API_SQLuedo/EntityFramework/InquiryEntity.cs index e311db5..f930acf 100644 --- a/API_SQLuedo/EntityFramework/InquiryEntity.cs +++ b/API_SQLuedo/EntityFramework/InquiryEntity.cs @@ -1,4 +1,6 @@ -namespace Entities +using System.ComponentModel.DataAnnotations; + +namespace Entities { public class InquiryEntity { diff --git a/API_SQLuedo/EntityFramework/InquiryTableEntity.cs b/API_SQLuedo/EntityFramework/InquiryTableEntity.cs index bc3f0e0..c8798b9 100644 --- a/API_SQLuedo/EntityFramework/InquiryTableEntity.cs +++ b/API_SQLuedo/EntityFramework/InquiryTableEntity.cs @@ -1,37 +1,37 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Entities +namespace Entities; + +[Table("InquiryTable")] +public class InquiryTableEntity { - public class InquiryTableEntity - { - [Key] - [ForeignKey(nameof(Owner))] - [DatabaseGenerated(DatabaseGeneratedOption.Identity)] - [Required] - public int OwnerId { get; set; } - public InquiryEntity Owner { get; set; } - public string DatabaseName { get; set; } - public string ConnectionInfo { get; set; } + [Key] + [ForeignKey(nameof(Owner))] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + [Required] + public int OwnerId { get; set; } + public InquiryEntity Owner { get; set; } + public string DatabaseName { get; set; } + public string ConnectionInfo { get; set; } - public InquiryTableEntity() { } + public InquiryTableEntity() { } - public InquiryTableEntity(int inquiryId) - { - OwnerId = inquiryId; - } - public InquiryTableEntity(int inquiryId, string databaseName, string connectionInfo) - { - OwnerId = inquiryId; - DatabaseName = databaseName; - ConnectionInfo = connectionInfo; - } + public InquiryTableEntity(int inquiryId) + { + OwnerId = inquiryId; + } + public InquiryTableEntity(int inquiryId, string databaseName, string connectionInfo) + { + OwnerId = inquiryId; + DatabaseName = databaseName; + ConnectionInfo = connectionInfo; + } - public InquiryTableEntity(InquiryEntity owner, string databaseName, string connectionInfo) - { - Owner = owner; - DatabaseName = databaseName; - ConnectionInfo = connectionInfo; - } + public InquiryTableEntity(InquiryEntity owner, string databaseName, string connectionInfo) + { + Owner = owner; + DatabaseName = databaseName; + ConnectionInfo = connectionInfo; } } \ No newline at end of file diff --git a/API_SQLuedo/EntityFramework/LessonEntity.cs b/API_SQLuedo/EntityFramework/LessonEntity.cs index af3986b..2c345d3 100644 --- a/API_SQLuedo/EntityFramework/LessonEntity.cs +++ b/API_SQLuedo/EntityFramework/LessonEntity.cs @@ -1,31 +1,33 @@ -namespace Entities +using System.ComponentModel.DataAnnotations.Schema; + +namespace Entities; + +[Table("Lesson")] +public class LessonEntity { - public class LessonEntity - { - public int Id { get; set; } - public string? Title { get; set; } - public string? LastPublisher { get; set; } - public DateOnly? LastEdit { get; set; } + public int Id { get; set; } + public string? Title { get; set; } + public string? LastPublisher { get; set; } + public DateOnly? LastEdit { get; set; } - public LessonEntity() { } + public LessonEntity() { } - public LessonEntity(int id) - { - Id = id; - } - public LessonEntity(int id, string title, string lastPublisher, DateOnly? lastEdit) - { - Id = id; - Title = title; - LastPublisher = lastPublisher; - LastEdit = lastEdit; - } + public LessonEntity(int id) + { + Id = id; + } + public LessonEntity(int id, string title, string lastPublisher, DateOnly? lastEdit) + { + Id = id; + Title = title; + LastPublisher = lastPublisher; + LastEdit = lastEdit; + } - public LessonEntity(string title, string lastPublisher, DateOnly? lastEdit) - { - Title = title; - LastPublisher = lastPublisher; - LastEdit = lastEdit; - } + public LessonEntity(string title, string lastPublisher, DateOnly? lastEdit) + { + Title = title; + LastPublisher = lastPublisher; + LastEdit = lastEdit; } -} +} \ No newline at end of file diff --git a/API_SQLuedo/EntityFramework/NotepadEntity.cs b/API_SQLuedo/EntityFramework/NotepadEntity.cs index 69226d2..0a3f9c9 100644 --- a/API_SQLuedo/EntityFramework/NotepadEntity.cs +++ b/API_SQLuedo/EntityFramework/NotepadEntity.cs @@ -1,38 +1,38 @@ using System.ComponentModel.DataAnnotations.Schema; -namespace Entities +namespace Entities; + +[Table("Notepad")] +public class NotepadEntity { - public class NotepadEntity - { - public int Id { get; set; } + public int Id { get; set; } - [ForeignKey(nameof(User))] - public int UserId { get; set; } - public UserEntity User { get; set; } + [ForeignKey(nameof(User))] + public int UserId { get; set; } + public UserEntity User { get; set; } - [ForeignKey(nameof(Inquiry))] - public int InquiryId { get; set; } - public InquiryEntity Inquiry { get; set; } - public string Notes { get; set; } + [ForeignKey(nameof(Inquiry))] + public int InquiryId { get; set; } + public InquiryEntity Inquiry { get; set; } + public string Notes { get; set; } - public NotepadEntity() { } + public NotepadEntity() { } - public NotepadEntity(int id, int userId, UserEntity user, int inquiryId, InquiryEntity inquiry, string notes) - { - Id = id; - UserId = userId; - User = user; - InquiryId = inquiryId; - Inquiry = inquiry; - Notes = notes; - } - public NotepadEntity(int userId, UserEntity user, int inquiryId, InquiryEntity inquiry, string notes) - { - UserId = userId; - User = user; - InquiryId = inquiryId; - Inquiry = inquiry; - Notes = notes; - } + public NotepadEntity(int id, int userId, UserEntity user, int inquiryId, InquiryEntity inquiry, string notes) + { + Id = id; + UserId = userId; + User = user; + InquiryId = inquiryId; + Inquiry = inquiry; + Notes = notes; + } + public NotepadEntity(int userId, UserEntity user, int inquiryId, InquiryEntity inquiry, string notes) + { + UserId = userId; + User = user; + InquiryId = inquiryId; + Inquiry = inquiry; + Notes = notes; } -} +} \ No newline at end of file diff --git a/API_SQLuedo/EntityFramework/ParagraphEntity.cs b/API_SQLuedo/EntityFramework/ParagraphEntity.cs index 65bd2cb..4dc2277 100644 --- a/API_SQLuedo/EntityFramework/ParagraphEntity.cs +++ b/API_SQLuedo/EntityFramework/ParagraphEntity.cs @@ -1,38 +1,40 @@ -namespace Entities +using System.ComponentModel.DataAnnotations.Schema; + +namespace Entities; + +[Table("Paragraph")] +public class ParagraphEntity { - public class ParagraphEntity - { - public int Id { get; set; } - public string Title { get; set; } - public string Content { get; set; } - public string Info { get; set; } - public string Query { get; set; } - public string Comment { get; set; } + public int Id { get; set; } + public string Title { get; set; } + public string Content { get; set; } + public string Info { get; set; } + public string Query { get; set; } + public string Comment { get; set; } - public ParagraphEntity() { } + public ParagraphEntity() { } - public ParagraphEntity(int id) - { - Id = id; - } + public ParagraphEntity(int id) + { + Id = id; + } - public ParagraphEntity(int id, string title, string content, string info, string query, string comment) - { - Id = id; - Title = title; - Content = content; - Info = info; - Query = query; - Comment = comment; - } - public ParagraphEntity(string title, string content, string info, string query, string comment) - { - Title = title; - Content = content; - Info = info; - Query = query; - Comment = comment; - } + public ParagraphEntity(int id, string title, string content, string info, string query, string comment) + { + Id = id; + Title = title; + Content = content; + Info = info; + Query = query; + Comment = comment; + } + public ParagraphEntity(string title, string content, string info, string query, string comment) + { + Title = title; + Content = content; + Info = info; + Query = query; + Comment = comment; } } \ No newline at end of file diff --git a/API_SQLuedo/EntityFramework/SolutionEntity.cs b/API_SQLuedo/EntityFramework/SolutionEntity.cs index fa15060..6c8dbdf 100644 --- a/API_SQLuedo/EntityFramework/SolutionEntity.cs +++ b/API_SQLuedo/EntityFramework/SolutionEntity.cs @@ -1,44 +1,44 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Entities +namespace Entities; + +[Table("Solution")] +public class SolutionEntity { - public class SolutionEntity + [Key] + [ForeignKey(nameof(Owner))] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + [Required] + public int OwnerId { get; set; } + public InquiryEntity? Owner { get; set; } + public string? MurdererFirstName { get; set; } + public string? MurdererLastName { get; set; } + public string? MurderPlace { get; set; } + public string? MurderWeapon { get; set; } + public string? Explanation { get; set; } + public SolutionEntity() { } + public SolutionEntity(int ownerId) + { + OwnerId = ownerId; + } + public SolutionEntity(int ownerId, InquiryEntity? owner, string murdererFirstName, string murdererLastName, string murderPlace, string murderWeapon, string explanation) + { + OwnerId = ownerId; + Owner = owner; + MurdererFirstName = murdererFirstName; + MurdererLastName = murdererLastName; + MurderPlace = murderPlace; + MurderWeapon = murderWeapon; + Explanation = explanation; + } + public SolutionEntity(InquiryEntity? owner, string murdererFirstName, string murdererLastName, string murderPlace, string murderWeapon, string explanation) { - [Key] - [ForeignKey(nameof(Owner))] - [DatabaseGenerated(DatabaseGeneratedOption.Identity)] - [Required] - public int OwnerId { get; set; } - public InquiryEntity? Owner { get; set; } - public string? MurdererFirstName { get; set; } - public string? MurdererLastName { get; set; } - public string? MurderPlace { get; set; } - public string? MurderWeapon { get; set; } - public string? Explanation { get; set; } - public SolutionEntity() { } - public SolutionEntity(int ownerId) - { - OwnerId = ownerId; - } - public SolutionEntity(int ownerId, InquiryEntity? owner, string murdererFirstName, string murdererLastName, string murderPlace, string murderWeapon, string explanation) - { - OwnerId = ownerId; - Owner = owner; - MurdererFirstName = murdererFirstName; - MurdererLastName = murdererLastName; - MurderPlace = murderPlace; - MurderWeapon = murderWeapon; - Explanation = explanation; - } - public SolutionEntity(InquiryEntity? owner, string murdererFirstName, string murdererLastName, string murderPlace, string murderWeapon, string explanation) - { - Owner = owner; - MurdererFirstName = murdererFirstName; - MurdererLastName = murdererLastName; - MurderPlace = murderPlace; - MurderWeapon = murderWeapon; - Explanation = explanation; - } + Owner = owner; + MurdererFirstName = murdererFirstName; + MurdererLastName = murdererLastName; + MurderPlace = murderPlace; + MurderWeapon = murderWeapon; + Explanation = explanation; } } \ No newline at end of file diff --git a/API_SQLuedo/EntityFramework/SuccessEntity.cs b/API_SQLuedo/EntityFramework/SuccessEntity.cs index 81f9e11..10f21a9 100644 --- a/API_SQLuedo/EntityFramework/SuccessEntity.cs +++ b/API_SQLuedo/EntityFramework/SuccessEntity.cs @@ -1,41 +1,41 @@ using System.ComponentModel.DataAnnotations.Schema; -namespace Entities +namespace Entities; + +[Table("Success")] +public class SuccessEntity { - public class SuccessEntity - { - [ForeignKey(nameof(User))] - public int UserId { get; set; } - public UserEntity User { get; set; } + [ForeignKey(nameof(User))] + public int UserId { get; set; } + public UserEntity User { get; set; } - [ForeignKey(nameof(Inquiry))] - public int InquiryId { get; set; } - public InquiryEntity Inquiry { get; set; } - public bool IsFinished { get; set; } + [ForeignKey(nameof(Inquiry))] + public int InquiryId { get; set; } + public InquiryEntity Inquiry { get; set; } + public bool IsFinished { get; set; } - public SuccessEntity() { } + public SuccessEntity() { } - public SuccessEntity(int userId, UserEntity user, int inquiryId, InquiryEntity inquiry, bool isFinished) - { - UserId = userId; - User = user; - InquiryId = inquiryId; - Inquiry = inquiry; - IsFinished = isFinished; - } + public SuccessEntity(int userId, UserEntity user, int inquiryId, InquiryEntity inquiry, bool isFinished) + { + UserId = userId; + User = user; + InquiryId = inquiryId; + Inquiry = inquiry; + IsFinished = isFinished; + } - public SuccessEntity(int userId, int inquiryId, bool isFinished) - { - UserId = userId; - InquiryId = inquiryId; - IsFinished = isFinished; - } + public SuccessEntity(int userId, int inquiryId, bool isFinished) + { + UserId = userId; + InquiryId = inquiryId; + IsFinished = isFinished; + } - public SuccessEntity(UserEntity user, InquiryEntity inquiry, bool isFinished) - { - User = user; - Inquiry = inquiry; - IsFinished = isFinished; - } + public SuccessEntity(UserEntity user, InquiryEntity inquiry, bool isFinished) + { + User = user; + Inquiry = inquiry; + IsFinished = isFinished; } -} +} \ No newline at end of file diff --git a/API_SQLuedo/EntityFramework/UserEntity.cs b/API_SQLuedo/EntityFramework/UserEntity.cs index 52ed8f8..2d22110 100644 --- a/API_SQLuedo/EntityFramework/UserEntity.cs +++ b/API_SQLuedo/EntityFramework/UserEntity.cs @@ -1,38 +1,39 @@ using System.ComponentModel.DataAnnotations.Schema; -namespace Entities +namespace Entities; + +[Table("User")] +public class UserEntity { - [Table("user")] - public class UserEntity - { - public int Id { get; set; } - public string Username { get; set; } - public string Password { get; set; } - public string Email { get; set; } - public bool IsAdmin { get; set; } + public int Id { get; set; } + public string Username { get; set; } + public string Password { get; set; } + public string Email { get; set; } + public bool IsAdmin { get; set; } - public UserEntity() { } + public UserEntity() + { + } - public UserEntity(int id) - { - Id = id; - } + public UserEntity(int id) + { + Id = id; + } - public UserEntity(int id, string username, string password, string email, bool isAdmin) - { - Id = id; - Username = username; - Password = password; - Email = email; - IsAdmin = isAdmin; - } + public UserEntity(int id, string username, string password, string email, bool isAdmin) + { + Id = id; + Username = username; + Password = password; + Email = email; + IsAdmin = isAdmin; + } - public UserEntity(string username, string password, string email, bool isAdmin) - { - Username = username; - Password = password; - Email = email; - IsAdmin = isAdmin; - } + public UserEntity(string username, string password, string email, bool isAdmin) + { + Username = username; + Password = password; + Email = email; + IsAdmin = isAdmin; } -} +} \ No newline at end of file