27 lines
783 B
C#
27 lines
783 B
C#
|
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
|
|||
|
};
|
|||
|
}
|
|||
|
}
|
|||
|
}
|