SqlDao 1.0.0
See the version list below for details.
dotnet add package SqlDao --version 1.0.0
NuGet\Install-Package SqlDao -Version 1.0.0
<PackageReference Include="SqlDao" Version="1.0.0" />
paket add SqlDao --version 1.0.0
#r "nuget: SqlDao, 1.0.0"
// Install SqlDao as a Cake Addin #addin nuget:?package=SqlDao&version=1.0.0 // Install SqlDao as a Cake Tool #tool nuget:?package=SqlDao&version=1.0.0
SqlDao
项目介绍
C# 操作数据库ORM类库,支持所有支持标准Sql语句的主流数据库
软件架构
软件架构说明
安装教程
clone 项目 用Vs2017 打开重先生成,把新生成的SqlDao.dll 添加到你的项目 还可以在你的项目里添加一个现有项,作为类库。在你的主项目时添加项目的引用
连接数据库字符串(和平时开发一样)
connectionString="Database=ticket;Data Source=127.0.0.1;User Id=admin;Password=;pooling=false;CharSet=utf8;port=3306;"
连接数据库 (以mysql 为例)
public class DatabaseOPtionHelper {
private static DbHelper Instance; public static DbHelper GetInstance() { string conn = ConfigurationHelper.GetConnectionConfig(ConfigItemName.mysqlConn.ToString()); Instance = new MySqlHelper(conn); App.Current.Dispatcher.BeginInvoke(new Action(delegate { if (Instance == null) { Instance = new MySqlHelper(conn); } })); return Instance; }
}
使用说明
- select
List<Company> tempList = CompanyModel.IndistinctSearchByNameOrNameFirstCase(tempStr);
WeighingBillModel里的方法
public static List<Company> IndistinctSearchByNameOrNameFirstCase(String nameOrCase)
{
string condition = null;
if (!String.IsNullOrEmpty(nameOrCase))
{
condition = CompanyColumns.name.ToString() + " like '%" + nameOrCase + "%' " + " OR " + CompanyColumns.name_first_case.ToString() + " like '%" + nameOrCase.ToUpper() + "%'";
}
String sql = DatabaseOPtionHelper.GetInstance().getSelectSql(TableName.company.ToString(), null, condition);
List<Company> list = DatabaseOPtionHelper.GetInstance().select<Company>(sql);
return list;
}
insert
int res = WeighingBillModel.Create(mWeighingBill);
WeighingBillModel里的方法
public static int Create(WeighingBill mWeighingBill) { return DatabaseOPtionHelper.GetInstance().insert(mWeighingBill); }
update
int res = WeighingBillModel.update(mWeighingBill);
WeighingBillModel里的方法
public static int Create(WeighingBill mWeighingBill)
{
return DatabaseOPtionHelper.GetInstance().update(mWeighingBill);
}
4.del
int res = WeighingBillModel.del(mWeighingBill);
WeighingBillModel里的方法
public static int del(WeighingBill mWeighingBill)
{
return DatabaseOPtionHelper.GetInstance().del(mWeighingBill);
}
- 类似 GreenDao 操作,功能大至相似
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on SqlDao:
Package | Downloads |
---|---|
clf.code.first
C# 代码到数据结构自动生成工具 |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
2.0.8 | 228 | 4/11/2023 |
2.0.5 | 241 | 3/10/2023 |
2.0.4 | 247 | 3/8/2023 |
2.0.3 | 243 | 3/8/2023 |
2.0.2 | 226 | 3/7/2023 |
2.0.1 | 530 | 11/22/2022 |
2.0.0 | 854 | 11/21/2022 |
1.1.6 | 520 | 4/2/2021 |
1.1.5 | 462 | 12/15/2020 |
1.1.4 | 545 | 7/8/2020 |
1.1.3 | 682 | 3/18/2020 |
1.1.2 | 540 | 3/18/2020 |
1.1.1 | 561 | 3/18/2020 |
1.0.1 | 632 | 9/24/2019 |
1.0.0 | 506 | 9/10/2019 |
初始一个 Nuget 库