Added ability to automatically track last modified and created timestamps for entities via an interface. DBContext will automatically update for us.
This commit is contained in:
parent
55a44000fc
commit
d632e53f18
11 changed files with 660 additions and 17 deletions
|
@ -1,4 +1,5 @@
|
|||
namespace API.Entities
|
||||
|
||||
namespace API.Entities
|
||||
{
|
||||
public class FolderPath
|
||||
{
|
||||
|
|
10
API/Entities/Interfaces/IEntityDate.cs
Normal file
10
API/Entities/Interfaces/IEntityDate.cs
Normal file
|
@ -0,0 +1,10 @@
|
|||
using System;
|
||||
|
||||
namespace API.Entities.Interfaces
|
||||
{
|
||||
public interface IEntityDate
|
||||
{
|
||||
DateTime Created { get; set; }
|
||||
DateTime LastModified { get; set; }
|
||||
}
|
||||
}
|
|
@ -1,15 +1,20 @@
|
|||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using API.Entities.Interfaces;
|
||||
|
||||
namespace API.Entities
|
||||
{
|
||||
public class Library
|
||||
public class Library : IEntityDate
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string CoverImage { get; set; }
|
||||
public LibraryType Type { get; set; }
|
||||
public DateTime Created { get; set; }
|
||||
public DateTime LastModified { get; set; }
|
||||
public ICollection<FolderPath> Folders { get; set; }
|
||||
public ICollection<AppUser> AppUsers { get; set; }
|
||||
public ICollection<Series> Series { get; set; }
|
||||
|
||||
}
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
namespace API.Entities
|
||||
|
||||
namespace API.Entities
|
||||
{
|
||||
public class MangaFile
|
||||
{
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using API.Entities.Interfaces;
|
||||
|
||||
namespace API.Entities
|
||||
{
|
||||
public class Series
|
||||
public class Series : IEntityDate
|
||||
{
|
||||
public int Id { get; set; }
|
||||
/// <summary>
|
||||
|
@ -22,6 +24,8 @@ namespace API.Entities
|
|||
/// </summary>
|
||||
public string Summary { get; set; }
|
||||
public string CoverImage { get; set; }
|
||||
public DateTime Created { get; set; }
|
||||
public DateTime LastModified { get; set; }
|
||||
public ICollection<Volume> Volumes { get; set; }
|
||||
|
||||
public Library Library { get; set; }
|
||||
|
|
|
@ -1,12 +1,16 @@
|
|||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using API.Entities.Interfaces;
|
||||
|
||||
namespace API.Entities
|
||||
{
|
||||
public class Volume
|
||||
public class Volume : IEntityDate
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Number { get; set; }
|
||||
public ICollection<MangaFile> Files { get; set; }
|
||||
public DateTime Created { get; set; }
|
||||
public DateTime LastModified { get; set; }
|
||||
|
||||
// Many-to-Many relationships
|
||||
public Series Series { get; set; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue