Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A simple unit of work implementation on top of Dapper, with some basic CQS in mind

License

NotificationsYou must be signed in to change notification settings

giangcoi48k/Dapper.CQS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A simple unit of work implementation on top of Dapper, with some basic CQS in mind.

I've found an awesome project,https://github.com/outmatic/Dapper.UnitOfWork, and I decided to extend some features so that the library can be used more easily. That's why I created this project.

For the query, I have already implemented 3 data types: single, list, paged. You just need to create a Query class, which inherits from 3 respective base classes:QueryBase<T>,QueryListBase<T>,QueryPagedBase<T>.

The following example is a pagination query

publicclassPropertyPagedFilterQuery:QueryPagedBase<Property>{[Parameter]publicstring?Name{get;set;}protectedoverrideCommandTypeCommandType=>CommandType.Text;protectedoverridestringProcedure=>@"SELECT *, COUNT(*) OVER() [COUNT]FROM Properties WHERE Name = @Name OR @Name IS NULLORDER BY [Name]OFFSET (@page -1 ) * @pageSize ROWSFETCH NEXT @pageSize ROWS ONLY";publicPropertyPagedFilterQuery(string?name,intpage,intpageSize){Name=name;Page=page;PageSize=pageSize;}}

The default CommandType is StoredProcedure, which means you will specify the Procedure property as Stored Procedure in the database.

Take a look at specific examples in the Example project.

Install from nuget

Install-Package Dapper.CQS

dotnet add package Dapper.CQS

About

A simple unit of work implementation on top of Dapper, with some basic CQS in mind

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp