PIbd-33_Sergunov_M.A._COP_4/Library/LibraryDatabaseImplement/Models/Book.cs

39 lines
862 B
C#
Raw Normal View History

2023-11-17 09:56:34 +04:00
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LibraryDatabaseImplement.Models
{
public class Book
{
public int Id { get; set; }
[Required]
public string Title { get; set; }
[Required]
public string Description { get; set; }
[Required]
public string Genre { get; set; }
[Required]
public int? Cost { get; set; }
public string CostStr
{
set { }
get
{
if (Cost == 0) return "Бесплатная";
else if (Cost == null) return "Не указано";
else return Cost.ToString();
}
}
}
}