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

namespace DatabaseEditor.DAL.Entities
{
    public class Author
    {
        public Author()
        {
            Books = new HashSet<Book>();
        }

        public Guid AuthorId { get; set; }

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

        [Required]
        [Index]
        [MaxLength(15)]
        public string Surname { get; set; }

        public virtual ICollection<Book> Books { get; set; }
    }
}