Files
Libation/Source/DataLayer/EfClasses/LibraryBook.cs
Michael Bucari-Tovo 3ab1edc076 Code Cleanup
Make fields readonly
Remove unnecessary casts
Format document
Remove unnecessary usings
Sort usings
Use file-level namespaces
Order modifiers
2026-02-05 12:48:44 -07:00

36 lines
1.2 KiB
C#

using Dinah.Core;
using System;
namespace DataLayer;
public class LibraryBook
{
internal int BookId { get; private set; }
public Book Book { get; private set; }
public DateTime DateAdded { get; private set; }
public string Account { get; private set; }
public bool IsDeleted { get; set; }
public bool AbsentFromLastScan { get; set; }
public DateTime? IncludedUntil { get; private set; }
public bool IsAudiblePlus { get; set; }
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.
private LibraryBook() { }
#pragma warning restore CS8618
public LibraryBook(Book book, DateTime dateAdded, string account)
{
ArgumentValidator.EnsureNotNull(book, nameof(book));
ArgumentValidator.EnsureNotNull(account, nameof(account));
Book = book;
DateAdded = dateAdded;
Account = account;
}
public void SetAccount(string account) => Account = account;
public void SetIncludedUntil(DateTime? includedUntil) => IncludedUntil = includedUntil;
public void SetIsAudiblePlus(bool isAudiblePlus) => IsAudiblePlus = isAudiblePlus;
public override string ToString() => $"{DateAdded:d} {Book}";
}