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

namespace CARRE_DSS2.Models
{
    public class RiskElement
    {

        public RiskElement()
        {
            this.Observables = new HashSet<Observable>();
            this.ParrentRiskFactorTargets = new HashSet<RiskFactor>();
        }
        [Key]
        [Display(Name = "Id")]
        public int Id { get; set; }

        [Display(Name = "Node")]
        public string Node { get; set; }

        [Display(Name = "Name")]
        public string Name { get; set; }

        [Display(Name = "Expression")]
        public string Expression { get; set; }

        [Display(Name = "Type")]
        public string Type { get; set; }

        public virtual ICollection<Observable> Observables { get; set; }

        public virtual ICollection<RiskFactor> ParrentRiskFactors { get; set; }

        [InverseProperty("Target")]
        public virtual ICollection<RiskFactor> ParrentRiskFactorTargets { get; set; }

        public override string ToString()
        {
            string str = "Id " + this.Id.ToString() + " Node " + this.Node + " Name " + this.Name + " Expression " + this.Expression + " Type " + this.Type;
            return str;
        }
    }
}