using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace ms_lesService.Database.Models;

[Table("rules")]
[Index(nameof(Rule.Identifier), IsUnique = true)]
public class Rule
{
    [Key]
    [Column("id_rule")] 
    public int Identifier { get; set; }

    [Column("id_object")] 
    [ForeignKey("id_object")]
    public Entity Object { get; set; } 
    
    [Column("id_rule_type")]
    [ForeignKey("id_rule_type")]
    public RuleType RuleType { get; set; }
    
    public virtual ICollection<RulesMetadataType> RulesMetadataTypes { get; set; }
}