Basics setup, going to change how repos work
This commit is contained in:
10
DBConnection/Models/Author.cs
Normal file
10
DBConnection/Models/Author.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DBConnection.Models;
|
||||
|
||||
public class Author : BaseEntity
|
||||
{
|
||||
[Key]
|
||||
public string Url { get; set; }
|
||||
public string Name { get; set; }
|
||||
}
|
||||
7
DBConnection/Models/BaseEntity.cs
Normal file
7
DBConnection/Models/BaseEntity.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace DBConnection.Models;
|
||||
|
||||
public abstract class BaseEntity
|
||||
{
|
||||
public DateTime DateCreated { get; set; }
|
||||
public DateTime DateModified { get; set; }
|
||||
}
|
||||
15
DBConnection/Models/Chapter.cs
Normal file
15
DBConnection/Models/Chapter.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DBConnection.Models;
|
||||
|
||||
public class Chapter : BaseEntity
|
||||
{
|
||||
[Key]
|
||||
public int ChapterNumber { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string? Content { get; set; }
|
||||
public string? RawContent { get; set; }
|
||||
public string Url { get; set; }
|
||||
public DateTime DatePosted { get; set; }
|
||||
public DateTime DateUpdated { get; set; }
|
||||
}
|
||||
15
DBConnection/Models/Novel.cs
Normal file
15
DBConnection/Models/Novel.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DBConnection.Models;
|
||||
|
||||
public class Novel : BaseEntity
|
||||
{
|
||||
[Key]
|
||||
public string Url { get; set; }
|
||||
public string Title { get; set; }
|
||||
public Author Author { get; set; }
|
||||
public List<Tag> Tags { get; set; }
|
||||
public List<Chapter> Chapters { get; set; }
|
||||
public DateTime LastUpdated { get; set; }
|
||||
public DateTime DatePosted { get; set; }
|
||||
}
|
||||
12
DBConnection/Models/Tag.cs
Normal file
12
DBConnection/Models/Tag.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace DBConnection.Models;
|
||||
|
||||
public class Tag : BaseEntity
|
||||
{
|
||||
[Key]
|
||||
public string TagValue { get; set; }
|
||||
[JsonIgnore]
|
||||
public List<Novel> Novels { get; set; }
|
||||
}
|
||||
11
DBConnection/Models/User.cs
Normal file
11
DBConnection/Models/User.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DBConnection.Models;
|
||||
|
||||
public class User : BaseEntity
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
public string Email { get; set; }
|
||||
public List<UserNovel> WatchedNovels { get; set; }
|
||||
}
|
||||
14
DBConnection/Models/UserNovel.cs
Normal file
14
DBConnection/Models/UserNovel.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace DBConnection.Models;
|
||||
|
||||
public class UserNovel
|
||||
{
|
||||
[JsonIgnore]
|
||||
public int UserId { get; set; }
|
||||
public string NovelUrl { get; set; }
|
||||
public Novel Novel { get; set; }
|
||||
public User User { get; set; }
|
||||
public int LastChapterRead { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user