using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GreenTree.Nachtragsmanagement.Core.Domain.Config;
using GreenTree.Nachtragsmanagement.Core.Domain.Misc;

namespace GreenTree.Nachtragsmanagement.Data.Mapping.Misc
{
    public class UserConfigItemMap : EntityTypeConfiguration<UserConfigItem>
    {
        public UserConfigItemMap()
        {
            ToTable("UserConfigItem");

            HasKey(m => m.Id);

            Property(m => m.Name);
            Property(m => m.Value);

            HasRequired(a => a.User)
                .WithMany(s => s.UserConfigItems)
                .HasForeignKey(a => a.UserId);
        }
    }
}
