using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace DatabaseEditor.DAL.Entities
{
    public class Book
    {
        public Book()
        {
            Authors = new HashSet<Author>();
        }
        
        public Guid BookId { get; set; }

        public string ISBN { get; set; }

        [Required]
        [Index]
        [MaxLength(25)]
        public string Name { get; set; }

        public int Pages { get; set; }

        public int Year { get; set; }

        public virtual ICollection<Author> Authors { get; set; }
    }
}