static void test() { IdleBus <IFreeSql> ib = null; //单例注入 var fsql = ib.Get(); //获取当前租户对应的 IFreeSql var fsql00102 = ib.ChangeTenant("00102").Get(); //切换租户,后面的操作都是针对 00102 var songRepository = ib.GetRepository <Song>(); var detailRepository = ib.GetRepository <Detail>(); }