using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using Models.Models.LOGDB;
using System;
using System.Threading;
using System.Threading.Tasks;

namespace Models.Models.LOGDB
{
    public class LOG_DBContext : DbContext
    {
  
        public LOG_DBContext(DbContextOptions<LOG_DBContext> options)
            : base(options)
        {
            this.Database.SetCommandTimeout(600000); //时间单位是毫秒
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            if (ConfigEntity.Instance.DBTYPE == 2)
            {
                modelBuilder.Entity<TBL_RUCS_UDP_LOG>().Property(t => t.DATETIME).HasColumnType("datetime(3)");
            }
        }


        /// <summary>
        /// RUCS UDP 通讯日志  
        /// </summary>
        public DbSet<TBL_RUCS_UDP_LOG> TBL_RUCS_UDP_LOGS { get; set; }


        /// <summary>
        /// RUCS 活动日志        
        /// </summary>
        public DbSet<TBL_RUCS_ACTIVE_LOG> TBL_RUCS_ACTIVE_LOGS { get; set; }



        /// <summary>
        /// RUCS TCP通讯记录     
        /// </summary>
        public DbSet<TBL_TCP_LOG> TBL_RUCS_TCP_LOGS { get; set; }



        /// <summary>
        /// RUCS MSG消息处理日志   
        /// </summary>
        public DbSet<TBL_MSG_LOG> TBL_MSG_LOGS { get; set; }

        /// <summary>
        /// RLS 活动日志         
        /// </summary>
        public DbSet<TBL_RLS_ACTIVE_LOG> TBL_RLS_ACTIVE_LOGS { get; set; }


        /// <summary>
        /// 系统错误日志       
        /// </summary>
        public DbSet<TBL_SYS_ERR_REPORT> TBL_SYS_ERR_REPORTS { get; set; }

        /// <summary>
        /// MSG消息类型副表      
        /// </summary>
        public DbSet<TBL_LOG_TYPE> TBL_LOG_TYPES { get; set; }


       

    }
}