GithubHelp home page GithubHelp logo

fangjun953322 / dapper-plus Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zzzprojects/dapper-plus

0.0 1.0 0.0 417 KB

Dapper Plus - High-Efficient Bulk Actions (Insert, Update, Delete, and Merge) for .NET

Home Page: https://dapper-plus.net/

License: Other

C# 100.00%

dapper-plus's Introduction

Like Dapper,

Dapper Plus is a NuGet library that you can add to your project that will extend your IDbConnection and IDbTransaction interface with high efficient Bulk Actions Helpers (Insert, Update, Delete, and Merge).

It can be used with or without Dapper, and it's compatible with all others Dapper packages.

Example

// CONFIGURE & MAP entity
DapperPlusManager.Entity<Order>().Table("Orders").Identity(x => x.ID);

// CHAIN & SAVE entity
connection.BulkInsert(orders)
          .AlsoInsert(order => order.Items);
          .Include(order => order.ThenMerge(order => order.Invoice)
                                 .AlsoMerge(invoice => invoice.Items))
          .AlsoMerge(order => order.ShippingAddress);	

Download

download

PM> Install-Package Z.Dapper.Plus

* PRO Version unlocked for the current month

Stay updated with latest changes

Twitter Follow Facebook Like

Wiki

Introduction

Dapper Plus - Actions

Dapper Plus - Mapper

Dapper Plus - Manager

PRO License

Mapper

Dapper Plus Mapper allow to map the conceptual model (Entity) with the storage model (Database) and configure options to perform Bulk Actions.

DapperPlusManager.Entity<Order>().Table("Orders")
                                 .Identity(x => x.ID)
                                 .BatchSize(200);

Bulk Actions

Bulk Actions allow to perform a bulk insert, update, delete or merge and include related child items.

connection.BulkInsert(orders, order => order.Items)
          .BulkInsert(invoices, invoice => invoice.Items)
          .BulkMerge(shippingAddresses);

Also Bulk Actions

Also Bulk Actions allow to perform bulk action with a lambda expression using entities from the last Bulk[Action] or ThenBulk[Action] used.

connection.BulkInsert(orders)
          .AlsoInsert(order => order.Items)
          .AlsoInsert(order => order.Invoice)
          .AlsoInsert(order => order.Invoice.Items);

Then Bulk Actions

Then Bulk Actions is similar to Also Bulk Actions but modify entities used for the next bulk action using a lambda expression.

connection.BulkInsert(orders)
          .AlsoInsert(order => order.Items)
          .ThenInsert(order => order.Invoice)
          .ThenInsert(invoice => invoice.Items);

Include Actions

The Dapper Plus Include method allow resolving issues with multiple "ThenBulk[Action]" method.

connection.BulkInsert(orders)
          .Include(x => x.ThenInsert(order => order.Items)
                         .ThenInsert(orderItem => orderItem.Metas))
          .Include(x => x.ThenInsert(order => order.Invoice)
                         .ThenInsert(Invoice => invoice.Items));   	

Transaction

All Dapper Plus extension methods are also available on the IDbTransaction interface

transaction.BulkInsert(orders)
          .Include(x => x.ThenInsert(order => order.Items)
                         .ThenInsert(orderItem => orderItem.Metas))
          .Include(x => x.ThenInsert(order => order.Invoice)
                         .ThenInsert(Invoice => invoice.Items));   	

DB Provider Supported

All major database provider are supported or under development.

  • SQL Server 2008+
  • SQL Azure
  • SQL Compact
  • SQLite
  • MySQL
  • PostgreSQL
  • Oracle

Support

Contact our outstanding customer support for any request. We usually answer within the next business day, hour, or minutes!

PRO

PRO Version unlocked for the current month

Features PRO Version
Bulk Insert Yes
Bulk Update Yes
Bulk Delete Yes
Bulk Merge Yes
Bulk Action Async Yes
Bulk Also Action Yes
Bulk Then Action Yes
Commercial License Yes
Royalty-Free Yes
Support & Upgrades (1 year) Yes

Learn more about the PRO Version

Contribute

The best way to contribute is by spreading the word about the library:

  • Blog it
  • Comment it
  • Fork it
  • Star it
  • Share it

A HUGE THANKS for your help.

More Projects

Entity Framework

Bulk Operations

Expression Evaluator

Utilities

Need more info? [email protected]

Contact our outstanding customer support for any request. We usually answer within the next business day, hour, or minutes!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.