26 lines
790 B
C#
Raw Normal View History

2024-11-12 23:13:20 +04:00
namespace ProjectLibrary.Entities
{
using ProjectLibrary.Entities.Enums;
public class Book
{
public int Id { get; private set; }
public string Author { get; private set; } = string.Empty;
public string Name { get; private set; } = string.Empty;
2024-12-03 20:14:30 +04:00
public BookType Type { get; set; } = BookType.None;
2024-11-12 23:13:20 +04:00
public int LibraryID { get; private set; }
2024-12-03 20:14:30 +04:00
public static Book CreateEntity(int id, string author, string name, int libraryID, BookType type = BookType.None)
2024-11-12 23:13:20 +04:00
{
return new Book
{
Id = id,
Author = author ?? string.Empty,
Name = name ?? string.Empty,
2024-12-03 20:14:30 +04:00
LibraryID = libraryID,
Type = type
2024-11-12 23:13:20 +04:00
};
}
}
}