We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
{ IConfiguration configuration = services.GetConfiguration(); var freeSqlCloud = new FreeSqlCloud<string>() { DistributeTrace = Console.WriteLine }; freeSqlCloud.Register(Constants.DefaultDb, () => new FreeSqlBuilder() .UseConnectionString(DataType.MySql, configuration.GetConnectionString(Constants.DefaultDb)) .Build()); freeSqlCloud.Register(Constants.OldDb, () => new FreeSqlBuilder() .UseConnectionString(DataType.MySql, configuration.GetConnectionString(Constants.OldDb)) .Build()); services.AddSingleton(freeSqlCloud); services.AddSingleton<IFreeSql>(freeSqlCloud); return services; }```
The text was updated successfully, but these errors were encountered:
ioc认为是在外部new的,所以由你自己来dispose
办法:AddSingletion(() => new)
Sorry, something went wrong.
No branches or pull requests
The text was updated successfully, but these errors were encountered: