using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Options;
using System;
using System.Collections.Generic;

namespace goods.Models
{
    public class DBContext : DbContext
    {
        public DBContext(DbContextOptions<DBContext> options) : base(options)
        {
        
        }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            if (!optionsBuilder.IsConfigured)
            {
                string connection = "Server=192.168.0.110;Database=goods;User ID=sa;Password=@@20120726KKh;Trusted_Connection=True;Encrypt=False;";
                optionsBuilder.UseSqlServer(connection);
            }
        }

        public DbSet<SearchKeyword>? SearchKeyword { get; set; }
    }
}
