ProjectLib/ProjectLibrary/Entites/Book.cs

27 lines
783 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;
public BookType Type { get; private set; } = BookType.None;
public int LibraryID { get; private set; }
public static Book CreateEntity(int id, string author, string name, BookType type, int libraryID)
{
return new Book
{
Id = id,
Author = author ?? string.Empty,
Name = name ?? string.Empty,
Type = type,
LibraryID = libraryID
};
}
}
}