31 lines
891 B
C#

namespace ProjectLibrary.Entities
{
using ProjectLibrary.Entities.Enums;
using System.ComponentModel;
public class Book
{
public int Id { get; private set; }
[DisplayName("Автор")]
public string Author { get; private set; } = string.Empty;
[DisplayName("Назвние книги")]
public string Name { get; private set; } = string.Empty;
[DisplayName("Тип книги")]
public BookType TypeBookID { get; set; } = BookType.None;
public static Book CreateEntity(int id, string author, string name, BookType typeBookID = BookType.None)
{
return new Book
{
Id = id,
Author = author ?? string.Empty,
Name = name ?? string.Empty,
TypeBookID = typeBookID
};
}
}
}