Ajout des noms des tables via les annotations de données

pull/29/head
Clement CHIEU 1 year ago
parent 6e11809f60
commit ff1b907c80

@ -1,14 +1,11 @@
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; }
@ -18,5 +15,4 @@ namespace Entities
Email = email;
ExpirationDate = expirationDate;
}
}
}

@ -1,9 +1,10 @@
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; }
@ -20,5 +21,4 @@ namespace Entities
LessonPartId = lessonPartId;
Paragraph = paragraph;
}
}
}

@ -1,4 +1,6 @@
namespace Entities
using System.ComponentModel.DataAnnotations;
namespace Entities
{
public class InquiryEntity
{

@ -1,10 +1,11 @@
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)]
@ -33,5 +34,4 @@ namespace Entities
DatabaseName = databaseName;
ConnectionInfo = connectionInfo;
}
}
}

@ -1,7 +1,10 @@
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; }
@ -27,5 +30,4 @@
LastPublisher = lastPublisher;
LastEdit = lastEdit;
}
}
}

@ -1,9 +1,10 @@
using System.ComponentModel.DataAnnotations.Schema;
namespace Entities
namespace Entities;
[Table("Notepad")]
public class NotepadEntity
{
public class NotepadEntity
{
public int Id { get; set; }
[ForeignKey(nameof(User))]
@ -34,5 +35,4 @@ namespace Entities
Inquiry = inquiry;
Notes = notes;
}
}
}

@ -1,7 +1,10 @@
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; }
@ -34,5 +37,4 @@
Query = query;
Comment = comment;
}
}
}

@ -1,10 +1,11 @@
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)]
@ -40,5 +41,4 @@ namespace Entities
MurderWeapon = murderWeapon;
Explanation = explanation;
}
}
}

@ -1,9 +1,10 @@
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; }
@ -37,5 +38,4 @@ namespace Entities
Inquiry = inquiry;
IsFinished = isFinished;
}
}
}

@ -1,17 +1,19 @@
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 UserEntity() { }
public UserEntity()
{
}
public UserEntity(int id)
{
@ -34,5 +36,4 @@ namespace Entities
Email = email;
IsAdmin = isAdmin;
}
}
}
Loading…
Cancel
Save