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
目前仅支持Sqlserver、MySQL、NpgSQL等三种数据库,具体用法如下:
services.Configure<DbContextOption>(options => { options.ConnectionString = "User ID=zengxw;Password=123456;Host=localhost;Port=5432;Database=ZxwPgDemo;Pooling=true;"; });
services.Configure<CodeGenerateOption>(options => { options.OutputPath = "F:\\Test\\PostgreSQL"; options.ModelsNamespace = "Zxw.Framework.Website.Models"; options.IRepositoriesNamespace = "Zxw.Framework.Website.IRepositories"; options.RepositoriesNamespace = "Zxw.Framework.Website.Repositories"; options.ControllersNamespace = "Zxw.Framework.Website.Controllers"; });
CodeGenerator.GenerateAllCodesFromDatabase(true);
The text was updated successfully, but these errors were encountered:
你好,我照着以上的代码在net core 的webapi中使用使用报错; StartUp中 调用部分: 请问是调用那里出的错吗?还是仅可以在mvc中controller中调用?
Sorry, something went wrong.
你代码注入有遗漏,请参照Demo中的注入
多谢,我尝试 了加入demo中的InitIoC ()并进行删减,并放置在步骤【注入DbContextOption】代码前。此时提示的是“未能获取到数据库上下文,请先注册数据库上下文。” 我后边继续再研究研究。
1.在Startup里面将ConfigureServices函数的返回值类型改成IServiceProvider, 如下 public IServiceProvider ConfigureServices(IServiceCollection services) 2.在所有资源都注入只有,这一句不能遗漏: return AspectCoreContainer.BuildServiceProvider(services);//接入AspectCore.Injector
No branches or pull requests
目前仅支持Sqlserver、MySQL、NpgSQL等三种数据库,具体用法如下:
The text was updated successfully, but these errors were encountered: