Luke.IBatisNet.DataMapper
1.0.1
dotnet add package Luke.IBatisNet.DataMapper --version 1.0.1
NuGet\Install-Package Luke.IBatisNet.DataMapper -Version 1.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="Luke.IBatisNet.DataMapper" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Luke.IBatisNet.DataMapper" Version="1.0.1" />
<PackageReference Include="Luke.IBatisNet.DataMapper" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Luke.IBatisNet.DataMapper --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Luke.IBatisNet.DataMapper, 1.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.
#:package Luke.IBatisNet.DataMapper@1.0.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Luke.IBatisNet.DataMapper&version=1.0.1
#tool nuget:?package=Luke.IBatisNet.DataMapper&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Luke.IBatisNet
A cross-platform version of IBatisNet
How to use?
Add providers.config
<?xml version="1.0" encoding="utf-8"?>
<providers
xmlns="http://ibatis.apache.org/providers"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<clear/>
<provider
name="MySql"
description="MySQL, MySQL provider"
enabled="true"
assemblyName="MySql.Data, Version=8.0.30.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"
connectionClass="MySql.Data.MySqlClient.MySqlConnection"
commandClass="MySql.Data.MySqlClient.MySqlCommand"
parameterClass="MySql.Data.MySqlClient.MySqlParameter"
parameterDbTypeClass="MySql.Data.MySqlClient.MySqlDbType"
parameterDbTypeProperty="MySqlDbType"
dataAdapterClass="MySql.Data.MySqlClient.MySqlDataAdapter"
commandBuilderClass="MySql.Data.MySqlClient.MySqlCommandBuilder"
usePositionalParameters="false"
useParameterPrefixInSql="true"
useParameterPrefixInParameter="true"
parameterPrefix="?"
allowMARS="false"
/>
</providers>
Add SqlMap.config
<?xml version="1.0" encoding="utf-8"?>
<sqlMapConfig
xmlns="http://ibatis.apache.org/dataMapper"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<settings>
<setting useStatementNamespaces="false"/>
<setting cacheModelsEnabled="true"/>
<setting validateSqlMap="false"/>
</settings>
<providers resource="providers.config"/>
<database>
<provider name="MySql"/>
<dataSource name="YourDbConnactionName" connectionString="YourconnectionString"/>
</database>
<sqlMaps>
<sqlMap resource="SqlMappers/TestMapper.xml"/>
</sqlMaps>
</sqlMapConfig>
Add SqlMappers/TestMapper.xml
<?xml version="1.0" encoding="utf-8" ?>
<sqlMap namespace="" xmlns="http://ibatis.apache.org/mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<statements>
<select id="TestSql" resultClass="System.Data.DataTable" parameterClass="System.String">
SELECT * FROM sys_user
<dynamic prepend="where">
<isNotEmpty prepend="and" property="">
name like '%$name$%'
</isNotEmpty>
</dynamic>
</select>
</statements>
</sqlMap>
Program.cs
DomSqlMapBuilder builder = new DomSqlMapBuilder();
ISqlMapper mapper = builder.Configure("SqlMap.config");
DataTable dt = mapper.QueryForDataTable("TestSql", "b");
dt = await mapper.QueryForDataTableAsync("TestSql", "b");
//mapper.Insert("XXX");
//mapper.Update("XXX");
//mapper.Delete("XXX");
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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.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
- Castle.Core (>= 4.0.0)
- Luke.IBatisNet.Common (>= 1.0.1)
- System.Configuration.ConfigurationManager (>= 6.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Luke.IBatisNet.DataMapper:
Package | Downloads |
---|---|
Luke.IBatisNet.DataAccess
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.