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();