Basics setup, going to change how repos work

This commit is contained in:
2022-07-14 18:12:04 -04:00
commit 4c42b765e1
64 changed files with 2385 additions and 0 deletions

View 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; }
}

View File

@@ -0,0 +1,7 @@
namespace DBConnection.Models;
public abstract class BaseEntity
{
public DateTime DateCreated { get; set; }
public DateTime DateModified { get; set; }
}

View 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; }
}

View 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; }
}

View 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; }
}

View 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; }
}

View 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; }
}