using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
//using pecklist.Util;
using Microsoft.Extensions.Logging;

namespace GZTW.Pecklist.Models
{
    public partial class PecklistContext : DbContext
    {

       
        public virtual DbSet<User> User { get; set; }    
        public virtual DbSet<ListData> ListData { get; set; }      

        public PecklistContext(DbContextOptions<PecklistContext> options) : base(options)
        { }

       
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
           
            modelBuilder.Entity<User>(entity =>
            {
                entity.ToTable("user");

                entity.Property(e => e.Id).HasColumnName("id");

                entity.Property(e => e.Login)
                    .IsRequired()
                    .HasColumnName("login")
                    .HasColumnType("text");

                entity.Property(e => e.Name)
                    .IsRequired()
                    .HasColumnName("name")
                    .HasColumnType("text");

                entity.Property(e => e.DlKey)
                    .HasColumnName("dlkey")
                    .HasColumnType("text");

                entity.Property(e => e.DlKeyExp)
                    .HasColumnName("dlkeyexp")
                    .HasColumnType("integer");
            });

             modelBuilder.Entity<ListData>(entity =>
            {
                entity.ToTable("listdata");

                entity.Property(e => e.Id).HasColumnName("id");

                entity.Property(e => e.TheList)
                    .IsRequired()
                    .HasColumnName("thelist")
                    .HasColumnType("text");

              
            });



            //-----------
        }
    }
}