54 lines
1.4 KiB
C#
54 lines
1.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.Linq;
|
|
using System.Web;
|
|
|
|
namespace Book_club.Models
|
|
{
|
|
public class Book
|
|
{
|
|
[Key]
|
|
public int Id { get; set; }
|
|
|
|
[Required(ErrorMessage = "Name required")]
|
|
public string Name { get; set; }
|
|
|
|
//[MinValue(1500, "Value must be at least 1")]
|
|
// [MaxValue(2020, "Value can't be more than 10")]
|
|
[Required(ErrorMessage = "YearProducktion required")]
|
|
public int YearProducktion { get; set; }
|
|
|
|
//public DateTime ReadDate { get; set; }
|
|
|
|
[Required(ErrorMessage = "AgeLimit required")]
|
|
public int AgeLimit { get; set; }
|
|
|
|
|
|
public bool IsChildBook { get; set; }
|
|
|
|
public string Genre { get; set; }
|
|
|
|
public string UserId { get; set; }
|
|
|
|
ApplicationUser User { get; set; }
|
|
|
|
|
|
//public Book(string name, int year, int agelimit, string genre)
|
|
//{
|
|
// Name = name;
|
|
// YearProducktion = year;
|
|
// AgeLimit = agelimit;
|
|
// Genre = genre;
|
|
|
|
//}
|
|
//public Book(string name, int agelimit, bool isChildBook)
|
|
//{
|
|
// Name = name;
|
|
// AgeLimit = agelimit;
|
|
// IsChildBook = isChildBook;
|
|
|
|
//}
|
|
|
|
}
|
|
} |