Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/SkyChenSky/Sikiro.Dapper.Extension
This is an extension based on dapper, supporting lambda expression, with chain style which allows developers to use more gracely and innovationally.
https://github.com/SkyChenSky/Sikiro.Dapper.Extension
Last synced: about 2 months ago
JSON representation
This is an extension based on dapper, supporting lambda expression, with chain style which allows developers to use more gracely and innovationally.
- Host: GitHub
- URL: https://github.com/SkyChenSky/Sikiro.Dapper.Extension
- Owner: SkyChenSky
- License: mit
- Created: 2018-06-15T05:36:21.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-01-16T19:16:38.000Z (11 months ago)
- Last Synced: 2024-10-02T16:08:47.223Z (3 months ago)
- Language: C#
- Homepage:
- Size: 1.23 MB
- Stars: 210
- Watchers: 14
- Forks: 59
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome - SkyChenSky/Sikiro.Dapper.Extension - This is an extension based on dapper, supporting lambda expression, with chain style which allows developers to use more gracely and innovationally. (C\#)
README
Sikiro.Dapper.Extension - a simple lambda extension for dapper [中文](https://github.com/SkyChenSky/Sikiro.Dapper.Extension/blob/master/README.zh-cn.md)
========================================This is an extension based on dapper, supporting lambda expression, with chain style which allows developers to use more gracely and innovationally.
Nuget
-----------
| Package | NuGet |
| ------- | ------|
| Sikiro.Dapper.Extension |[![Sikiro.Dapper.Extension](https://img.shields.io/badge/nuget-v2.0.0.0-blue.svg)](https://www.nuget.org/packages/Sikiro.Dapper.Extension/)|
| Sikiro.Dapper.Extension.MsSql | [![Sikiro.Dapper.Extension.MsSql](https://img.shields.io/badge/nuget-v2.0.0.0-blue.svg)](https://www.nuget.org/packages/Sikiro.Dapper.Extension.MsSql/)|
| Sikiro.Dapper.Extension.MySql | [![Sikiro.Dapper.Extension.MySql](https://img.shields.io/badge/nuget-v2.0.0.0-blue.svg)](https://www.nuget.org/packages/Sikiro.Dapper.Extension.MySql/)|
| Sikiro.Dapper.Extension.PostgreSql |[![Sikiro.Dapper.Extension.PostgreSql](https://img.shields.io/badge/nuget-v2.0.0.0-blue.svg)](https://www.nuget.org/packages/Sikiro.Dapper.Extension.PostgreSql/)|Install
------------
#### MsSql
```
PM> Install-Package Sikiro.Dapper.Extension.MsSql
```
#### MySql
```
PM> Install-Package Sikiro.Dapper.Extension.MySql
```
#### PostgreSql
```
PM> Install-Package Sikiro.Dapper.Extension.PostgreSql
```
Document
---------
https://github.com/SkyChenSky/Sikiro.Dapper.Extension/wikiFeatures
---------
### 1.Base On DapperSikiro.Dapper.Extension is a library hosted in nuget. It can be used both on dotNet framework and dotNet Core.
The lambda expression encapsulation based on dapper is still an extension of `IDbConnection`Interface, and retains and opens the original `Execute`, `Query`, etc
### 2.Simple And Intuitive Chain
#### Query
```c#
con.QuerySet().Where(a => a.Email == "[email protected]")
.OrderBy(a => a.CreateDatetime)
.Select(a => new SysUser { Email = a.Email, CreateDatetime = a.CreateDatetime, SysUserid = a.SysUserid })
.PageList(1, 10);
```#### Command
```c#
con.CommandSet().Where(a => a.Email == "[email protected]").Update(a => new SysUser { Email = "[email protected]" });
```
#### ExpressionBuilder
-----------------
```c#
var where = ExpressionBuilder.Init();if (string.IsNullOrWhiteSpace(param.Email))
where = where.And(a => a.Email == "[email protected]");if (string.IsNullOrWhiteSpace(param.Mobile))
where = where.And(a => a.Mobile == "18988565556");con.QuerySet().Where(where).OrderBy(b => b.Email).Top(10).Select(a => a.Email).ToList();
```
### 3.Support Async
```c#
ToListAsync
GetAsync
InsertAsync
DeleteAsync
UpdateSelectAsync
UpdateAsync
```
### 4.Faithful To Native Attribute
```c#
[Table("SYS_USER")]
[Key]
[Required]
[StringLength(32)]
[Display(Name = "主键")]
[Column("SYS_USERID")]
[DatabaseGenerated]
```Build Entity Tool
-------
[AutoBuildEntity](https://github.com/SkyChenSky/AutoBuildEntity)![img](https://github.com/SkyChenSky/AutoBuildEntity/blob/master/AutoBuildEntity/Resources/entity.gif "效果图")
Contribution
-------
Welcome to submit Pull Request for code changes. If you have any questions, you can open an issue for further discussion.License
-------
[MIT](https://github.com/SkyChenSky/Sikiro.Dapper.Extension/blob/master/LICENSE)