mirror of
https://github.com/Kareadita/Kavita.git
synced 2026-03-10 20:15:26 -04:00
Co-authored-by: Joseph Milazzo <joseph.v.milazzo@gmail.com> Co-authored-by: Joe Milazzo <josephmajora@gmail.com>
17 lines
648 B
C#
17 lines
648 B
C#
namespace Kavita.Models.DTOs.Reader;
|
|
|
|
public sealed record BookResourceResultDto
|
|
{
|
|
public bool IsSuccess { get; init; }
|
|
public string ErrorMessage { get; init; }
|
|
public byte[] Content { get; init; }
|
|
public string ContentType { get; init; }
|
|
public string FileName { get; init; }
|
|
|
|
public static BookResourceResultDto Success(byte[] content, string contentType, string fileName) =>
|
|
new() { IsSuccess = true, Content = content, ContentType = contentType, FileName = fileName };
|
|
|
|
public static BookResourceResultDto Error(string errorMessage) =>
|
|
new() { IsSuccess = false, ErrorMessage = errorMessage };
|
|
}
|