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

namespace DatabaseModule.Entieties
{
    public class News
    {
        [Key]
        public int Id { get; set; }
        [Required]
        [MaxLength(255)]
        [Index(IsUnique = true)]
        public string BaseUrl { get; set; }
        public virtual Category Category { get; set; }
        [Required]
        public string Title { get; set; }
        public string ImageUrl { get; set; }
        [Required]
        public string Description { get; set; }
        [Required]
        public DateTime PublicationDate { get; set; }

        public virtual ICollection<UserNews> UsersNews { get; set; }
    }
}
