updated controllers and some services to use async/await

This commit is contained in:
Cameron
2024-08-29 05:36:01 -05:00
parent 18de6d599b
commit 8302e3ea61
36 changed files with 1981 additions and 1809 deletions

View File

@@ -3,33 +3,32 @@ using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ComiServ.Entities
namespace ComiServ.Entities;
[Index(nameof(Handle), IsUnique = true)]
[Index(nameof(Filepath), IsUnique = true)]
public class Comic
{
[Index(nameof(Handle), IsUnique = true)]
[Index(nameof(Filepath), IsUnique = true)]
public class Comic
{
public int Id { get; set; }
public bool Exists { get; set; }
//id exposed through the API
[Required]
[StringLength(ComicsContext.HANDLE_LENGTH)]
public string Handle { get; set; } = null!;
[Required]
public string Filepath { get; set; } = null!;
[Required]
public string Title { get; set; } = null!;
[Required]
public string Description { get; set; } = null!;
public int PageCount { get; set; }
public long SizeBytes { get; set; }
public long FileXxhash64 { get; set; }
public byte[]? ThumbnailWebp { get; set; }
[InverseProperty("Comic")]
public ICollection<ComicTag> ComicTags { get; set; } = [];
[InverseProperty("Comic")]
public ICollection<ComicAuthor> ComicAuthors { get; set; } = [];
[InverseProperty("Comic")]
public ICollection<ComicRead> ReadBy { get; set; } = [];
}
public int Id { get; set; }
public bool Exists { get; set; }
//id exposed through the API
[Required]
[StringLength(ComicsContext.HANDLE_LENGTH)]
public string Handle { get; set; } = null!;
[Required]
public string Filepath { get; set; } = null!;
[Required]
public string Title { get; set; } = null!;
[Required]
public string Description { get; set; } = null!;
public int PageCount { get; set; }
public long SizeBytes { get; set; }
public long FileXxhash64 { get; set; }
public byte[]? ThumbnailWebp { get; set; }
[InverseProperty("Comic")]
public ICollection<ComicTag> ComicTags { get; set; } = [];
[InverseProperty("Comic")]
public ICollection<ComicAuthor> ComicAuthors { get; set; } = [];
[InverseProperty("Comic")]
public ICollection<ComicRead> ReadBy { get; set; } = [];
}