using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WorkFlowCheck.DL.Configurations
{
    public class DeviceMessageTypeConfiguration : IEntityTypeConfiguration<Entities.DeviceMessage>
    {
        public void Configure(EntityTypeBuilder<Entities.DeviceMessage> builder)
        {
            builder.ToTable("DeviceMessage");
            builder.HasKey(e => e.Id);
            builder.Property(e => e.Id).ValueGeneratedOnAdd();

            builder.HasIndex(e => e.DeviceIdTo)
                   .HasDatabaseName("IX_DeviceMessage_DeviceIdTo");
        }

    }
}
