mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 02:32:50 +08:00
update readme
This commit is contained in:
parent
9d89cb7a1e
commit
45fd9afba8
@ -4,6 +4,8 @@ using Microsoft.Data.SqlClient;
|
|||||||
using NetTaste;
|
using NetTaste;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Data.Common;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace FreeSql.Tests.SqlServer
|
namespace FreeSql.Tests.SqlServer
|
||||||
@ -43,7 +45,7 @@ namespace FreeSql.Tests.SqlServer
|
|||||||
[Fact]
|
[Fact]
|
||||||
public void ExecuteArray()
|
public void ExecuteArray()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
[Fact]
|
[Fact]
|
||||||
public void ExecuteNonQuery()
|
public void ExecuteNonQuery()
|
||||||
@ -51,12 +53,48 @@ namespace FreeSql.Tests.SqlServer
|
|||||||
var ps = new[]
|
var ps = new[]
|
||||||
{
|
{
|
||||||
new SqlParameter("@TableName", "tb1"),
|
new SqlParameter("@TableName", "tb1"),
|
||||||
new SqlParameter("@FInterID", System.Data.SqlDbType.Int)
|
new SqlParameter("@FInterID", SqlDbType.Int)
|
||||||
};
|
};
|
||||||
ps[1].Direction = System.Data.ParameterDirection.Output;
|
ps[1].Direction = System.Data.ParameterDirection.Output;
|
||||||
g.sqlserver.Ado.ExecuteNonQuery(System.Data.CommandType.StoredProcedure, "dbo.GetICMaxNum", ps);
|
g.sqlserver.Ado.ExecuteNonQuery(CommandType.StoredProcedure, "dbo.GetICMaxNum", ps);
|
||||||
Assert.Equal(100, ps[1].Value);
|
Assert.Equal(100, ps[1].Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void ComandFluent()
|
||||||
|
{
|
||||||
|
var fsql = g.sqlserver;
|
||||||
|
|
||||||
|
DbParameter p2 = null;
|
||||||
|
fsql.Ado.CommandFluent("dbo.GetICMaxNum")
|
||||||
|
.CommandType(CommandType.StoredProcedure)
|
||||||
|
.WithParameter("TableName", "tb1")
|
||||||
|
.WithParameter("FInterID", null, p =>
|
||||||
|
{
|
||||||
|
p2 = p;
|
||||||
|
p.DbType = DbType.Int32;
|
||||||
|
p.Direction = ParameterDirection.Output;
|
||||||
|
})
|
||||||
|
.ExecuteNonQuery();
|
||||||
|
Assert.Equal(100, p2.Value);
|
||||||
|
|
||||||
|
DbParameter p3 = null;
|
||||||
|
fsql.Ado.CommandFluent("dbo.GetICMaxNum", new Dictionary<string, object>
|
||||||
|
{
|
||||||
|
["TableName"] = "tb1"
|
||||||
|
// ¸ü¶à²ÎÊý
|
||||||
|
})
|
||||||
|
.WithParameter("FInterID", null, p =>
|
||||||
|
{
|
||||||
|
p3 = p;
|
||||||
|
p.DbType = DbType.Int32;
|
||||||
|
p.Direction = ParameterDirection.Output;
|
||||||
|
})
|
||||||
|
.CommandType(CommandType.StoredProcedure)
|
||||||
|
.ExecuteNonQuery();
|
||||||
|
Assert.Equal(100, p3.Value);
|
||||||
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void ExecuteScalar()
|
public void ExecuteScalar()
|
||||||
{
|
{
|
||||||
|
@ -28,7 +28,7 @@ QQ Groups:4336577(full)、**8578575(available)**、**52508226(available)**
|
|||||||
|
|
||||||
| |
|
| |
|
||||||
| - |
|
| - |
|
||||||
| [Select](https://github.com/2881099/FreeSql/wiki/%e6%9f%a5%e8%af%a2) \| [Update](https://github.com/2881099/FreeSql/wiki/%e4%bf%ae%e6%94%b9) \| [Insert](https://github.com/2881099/FreeSql/wiki/%e6%b7%bb%e5%8a%a0) \| [Delete](https://github.com/2881099/FreeSql/wiki/%e5%88%a0%e9%99%a4) \| [FAQ](https://github.com/dotnetcore/FreeSql/wiki/%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98) |
|
| [基础入门](https://www.cnblogs.com/FreeSql/p/11531300.html) \| [Select](https://github.com/2881099/FreeSql/wiki/%e6%9f%a5%e8%af%a2) \| [Update](https://github.com/2881099/FreeSql/wiki/%e4%bf%ae%e6%94%b9) \| [Insert](https://github.com/2881099/FreeSql/wiki/%e6%b7%bb%e5%8a%a0) \| [Delete](https://github.com/2881099/FreeSql/wiki/%e5%88%a0%e9%99%a4) \| [FAQ](https://github.com/dotnetcore/FreeSql/wiki/%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98) |
|
||||||
| [Expression](https://github.com/2881099/FreeSql/wiki/%e8%a1%a8%e8%be%be%e5%bc%8f%e5%87%bd%e6%95%b0) \| [CodeFirst](https://github.com/2881099/FreeSql/wiki/CodeFirst) \| [DbFirst](https://github.com/2881099/FreeSql/wiki/DbFirst) \| [Filters](https://github.com/2881099/FreeSql/wiki/%e8%bf%87%e6%bb%a4%e5%99%a8) \| [AOP](https://github.com/2881099/FreeSql/wiki/AOP) |
|
| [Expression](https://github.com/2881099/FreeSql/wiki/%e8%a1%a8%e8%be%be%e5%bc%8f%e5%87%bd%e6%95%b0) \| [CodeFirst](https://github.com/2881099/FreeSql/wiki/CodeFirst) \| [DbFirst](https://github.com/2881099/FreeSql/wiki/DbFirst) \| [Filters](https://github.com/2881099/FreeSql/wiki/%e8%bf%87%e6%bb%a4%e5%99%a8) \| [AOP](https://github.com/2881099/FreeSql/wiki/AOP) |
|
||||||
| [Repository](https://github.com/2881099/FreeSql/wiki/Repository) \| [UnitOfWork](https://github.com/2881099/FreeSql/wiki/%e5%b7%a5%e4%bd%9c%e5%8d%95%e5%85%83) \| [DbContext](https://github.com/2881099/FreeSql/wiki/DbContext) |
|
| [Repository](https://github.com/2881099/FreeSql/wiki/Repository) \| [UnitOfWork](https://github.com/2881099/FreeSql/wiki/%e5%b7%a5%e4%bd%9c%e5%8d%95%e5%85%83) \| [DbContext](https://github.com/2881099/FreeSql/wiki/DbContext) |
|
||||||
| [Read/Write](https://github.com/2881099/FreeSql/wiki/%e8%af%bb%e5%86%99%e5%88%86%e7%a6%bb) \| [Splitting Table](https://github.com/2881099/FreeSql/wiki/%e5%88%86%e8%a1%a8%e5%88%86%e5%ba%93) \| [Hide tech](https://github.com/2881099/FreeSql/wiki/%E9%AA%9A%E6%93%8D%E4%BD%9C) \| [*Update Notes*](https://github.com/2881099/FreeSql/wiki/%e6%9b%b4%e6%96%b0%e6%97%a5%e5%bf%97) |
|
| [Read/Write](https://github.com/2881099/FreeSql/wiki/%e8%af%bb%e5%86%99%e5%88%86%e7%a6%bb) \| [Splitting Table](https://github.com/2881099/FreeSql/wiki/%e5%88%86%e8%a1%a8%e5%88%86%e5%ba%93) \| [Hide tech](https://github.com/2881099/FreeSql/wiki/%E9%AA%9A%E6%93%8D%E4%BD%9C) \| [*Update Notes*](https://github.com/2881099/FreeSql/wiki/%e6%9b%b4%e6%96%b0%e6%97%a5%e5%bf%97) |
|
||||||
|
Loading…
x
Reference in New Issue
Block a user