// See https://aka.ms/new-console-template for more information

using SqlSugar;
using System.Data;

Console.WriteLine("------SqlSugar生成实体对象~~");
try
{
    var connetctionlist = new List<SlaveConnectionConfig>()
        {
            //第一个从库
            new SlaveConnectionConfig(){
                 HitRate=10,
                 ConnectionString="Data Source=rbs_server_db.db"
            }
        };

    ConnectionConfig connectionConfig1 = new ConnectionConfig()
    {
        DbType = SqlSugar.DbType.Sqlite,
        ConnectionString = "Data Source=rbs_server_db.db",
        InitKeyType = InitKeyType.Attribute,
        //IsAutoCloseConnection = true,
        //SlaveConnectionConfigs = connetctionlist
    };

    using (ISqlSugarClient client = new SqlSugarClient(connectionConfig1))
    {
        //一、基于数据库生成实体对象--DbFirst 
        {
            client.DbFirst.CreateClassFile(@"..\..\..\myModels");
        }
    }
}
catch (Exception)
{

    throw;
}
