hds.alligator
2.0.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package hds.alligator --version 2.0.1
NuGet\Install-Package hds.alligator -Version 2.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="hds.alligator" Version="2.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add hds.alligator --version 2.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: hds.alligator, 2.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install hds.alligator as a Cake Addin #addin nuget:?package=hds.alligator&version=2.0.1 // Install hds.alligator as a Cake Tool #tool nuget:?package=hds.alligator&version=2.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
示例: #region 添加一条数据 //var _para = new { // code = "cd001", // name = "nam001", // remarks = "rmk001" //}; //Postgre.Constructor["LocalDB", "localdb_table1_new"].Execute(parameters: _para); #endregion
#region 添加多条数据
// 固定数量的
//var _paras = new[] {
// new {
// code = "cd001",
// name = "nam001",
// remarks = "rmk001"
// },
// new {
// code = "cd002",
// name = "nam002",
// remarks = "rmk002"
// }
//};
// 非固定数量
//var _paras = new ArrayList();
//for(int i = 0; i < 10; i++)
//{
// _paras.Add(
// new
// {
// code = "cd001" + i,
// name = "nam001",
// remarks = "rmk001"
// }
// );
//}
//Postgre.Constructor["LocalDB", "localdb_table1_new"].Execute(parameters: _paras);
#endregion
#region 添加一条数据 并返回自增列的值
//var _para = new
//{
// code = "cd001",
// name = "nam001",
// remarks = "rmk001"
//};
//var _newId = Postgre.Constructor["LocalDB", "localdb_table1_new"].Execute<Int64>(autoincrementName: "id", parameters: _para);
//Console.WriteLine($"{_newId}");
#endregion
#region 非事务
//using (var alligator = Postgre.Constructor["LocalDB"])
//{
// var _para1 = new
// {
// code = "cd008",
// name = "nam001",
// remarks = "rmk001"
// };
// alligator["localdb_table1_new"].Execute(parameters: _para1);
// var _para2 = new
// {
// code = "cd008",
// name = "nam002",
// remarks = "rmk002"
// };
// alligator["localdb_table2_new"].Execute(parameters: _para2);
//}
#endregion
#region 事务
//using (var alligator = Postgre.Constructor["LocalDB"])
//{
// var trans = alligator.BeginTransaction();
// var _para1 = new
// {
// code = "cd001",
// name = "nam001",
// remarks = "rmk001"
// };
// alligator["localdb_table1_new"].Execute(parameters: _para1, transaction: trans);
// var _para2 = new
// {
// code = "cd002",
// name = "nam002",
// remarks = "rmk002"
// };
// alligator["localdb_table2_new"].Execute(parameters: _para2, transaction: trans, transactionAction: TransactionAction.CommitAndClose);
//}
#endregion
#region 查询
// 返回第一行第一列的值
//Postgre.Constructor["LocalDB", "查询语句"].QueryScalar<T>
// 返回集合
//Postgre.Constructor["LocalDB", "查询语句"].Query<T>(;
// 返回集合中的第一条, 结果集为空则引发异常
//Postgre.Constructor["LocalDB", "查询语句"].QueryFirst<T>();
// 返回集合中的第一条, 结果集为空不引发异常
//Postgre.Constructor["LocalDB", "查询语句"].QueryFirstOrDefault
// 返回集合中的第一条, 结果集为空则引发异常(根据主键获取一条数据 采用此方法)
//Postgre.Constructor["LocalDB", "查询语句"].QuerySingle<T>();
// 返回集合中的第一条, 结果集为空不引发异常(根据主键获取一条数据 采用此方法)
//Postgre.Constructor["LocalDB", "查询语句"].QuerySingleOrDefault
// 获取两个及以上结果集
// 譬如 一次性获取两张表
// select * from table1; select * from table2;
//Postgre.Constructor["LocalDB", "查询语句"].QueryMultiple<T1, T2>();
#endregion
#region 拼接SQL
// SQL语句: select * from table1 where code in (#in) limit 10;
//var _spliceds = new SplicedSql[] {
// new SplicedSql{ Key = "in", Value = "'t1-000', 't1-001'" }
//};
//var _list = Postgre.Constructor["LocalDB", "localdb_table1_read"].Query(splicedSqls: _spliceds);
#endregion
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 | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.1
- System.Text.Json (>= 4.7.2)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on hds.alligator:
Package | Downloads |
---|---|
hds.alligator.postgre
POSTGRESQL数据库逻辑处理 |
|
hds.alligator.sqlite
SQLITE数据库逻辑处理 |
GitHub repositories
This package is not used by any popular GitHub repositories.
重大改版: 增加拼接SQL参数