﻿using Restaurant.Domain.Entities;
using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Restaurant.Infra.Data.EntityConfig
{
    public class OptionConfiguration : EntityTypeConfiguration<Option>
    {
        public OptionConfiguration()
        {
            HasKey(p => p.Id);
            Property(p => p.Description).IsRequired().HasMaxLength(100);

            HasRequired(p => p.Category).WithMany(p => p.Options).HasForeignKey(p => p.CategoryId);

            ToTable("Option");
        }
    }
}
