Projekt/Book_club/Models/Book.cs

54 lines
1.4 KiB
C#
Raw Permalink Normal View History

2019-06-01 12:34:27 +02:00
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; }
2019-06-01 15:11:00 +02:00
[Required(ErrorMessage = "Name required")]
2019-06-01 12:34:27 +02:00
public string Name { get; set; }
2019-06-01 15:11:00 +02:00
2019-06-01 12:34:27 +02:00
//[MinValue(1500, "Value must be at least 1")]
2019-06-01 15:11:00 +02:00
// [MaxValue(2020, "Value can't be more than 10")]
[Required(ErrorMessage = "YearProducktion required")]
2019-06-01 12:34:27 +02:00
public int YearProducktion { get; set; }
2019-06-01 15:11:00 +02:00
2019-06-01 14:12:39 +02:00
//public DateTime ReadDate { get; set; }
2019-06-01 15:11:00 +02:00
[Required(ErrorMessage = "AgeLimit required")]
2019-06-01 12:34:27 +02:00
public int AgeLimit { get; set; }
2019-06-01 15:11:00 +02:00
2019-06-01 12:34:27 +02:00
public bool IsChildBook { get; set; }
public string Genre { get; set; }
2019-06-01 15:11:00 +02:00
2019-06-01 12:34:27 +02:00
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;
//}
}
}