WebApi框架搭建(二)集成ORM
时间:2020-03-22 18:53:03
收藏:0
阅读:116
1、添加引用:FluentData.NetCore.dll
2、安装包:
System.Data.SqlClient
System.Configuration.ConfigurationManager
3、Startup.cs ConfigureServices方法,添加:
DbProviderFactories.RegisterFactory("System.Data.SqlClient", SqlClientFactory.Instance);
4、添加Db.cs类
5、添加ConfigurationHelper.cs类
6、appsettings.json添加ConnectionStrings节
7、使用
DataTable dt = Db.Context("HYFW").Select<DataTable>("*") .From("table1") .QuerySingle();
原文:https://www.cnblogs.com/mellen/p/12547428.html
评论(0)