All Projects → EminemJK → Banana

EminemJK / Banana

Licence: MIT license
🍌 The collection of CRUD helpers for Dapper.

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to Banana

dapper-repositories
CRUD for Dapper
Stars: ✭ 523 (+757.38%)
Mutual labels:  repository, micro-orm, dapper
Dapper.AmbientContext
Ambient context implementation for Dapper.NET
Stars: ✭ 31 (-49.18%)
Mutual labels:  repository, dapper
CodexMicroORM
An alternative to ORM's such as Entity Framework, offers light-weight database mapping to your existing CLR objects. Visit "Design Goals" on GitHub to see more rationale and guidance.
Stars: ✭ 32 (-47.54%)
Mutual labels:  micro-orm, dapper
GraphQL.RepoDB
A set of extensions for working with HotChocolate GraphQL and Database access with micro-orms such as RepoDb (or Dapper). This extension pack provides access to key elements such as Selections/Projections, Sort arguments, & Paging arguments in a significantly simplified facade so this logic can be leveraged in the Serivces/Repositories that enca…
Stars: ✭ 25 (-59.02%)
Mutual labels:  repository, dapper
SQLBuilder.Core
.NET Standard 2.1、.NET 5、.NET 6 版本SQLBuilder,Expression表达式转换为SQL语句,支持SqlServer、MySql、Oracle、Sqlite、PostgreSql;基于Dapper实现了不同数据库对应的数据仓储Repository;
Stars: ✭ 85 (+39.34%)
Mutual labels:  repository, dapper
Microorm.dapper.repositories
CRUD for Dapper
Stars: ✭ 424 (+595.08%)
Mutual labels:  repository, dapper
Urf.core
Unit of Work & Repositories Framework - .NET Core, NET Standard, Entity Framework Core. 100% extensible & lightweight. Live demo: https://goo.gl/QpJVgd
Stars: ✭ 226 (+270.49%)
Mutual labels:  repository
support
A Laravel 5 package which promotes the use of best practices and design patterns
Stars: ✭ 19 (-68.85%)
Mutual labels:  repository
Init
❗️ Go to the first (initial) commit of any GitHub repo
Stars: ✭ 207 (+239.34%)
Mutual labels:  repository
Onion Architecture Asp.net Core
WhiteApp API solution template which is built on Onion Architecture with all essential feature using .NET 5!
Stars: ✭ 196 (+221.31%)
Mutual labels:  repository
wikirepo
Python based Wikidata framework for easy dataframe extraction
Stars: ✭ 33 (-45.9%)
Mutual labels:  repository
ioBroker.heatingcontrol
heating control incl. simple actor handling
Stars: ✭ 43 (-29.51%)
Mutual labels:  repository
Hexagonal-architecture-ASP.NET-Core
App generator API solution template which is built on Hexagnonal Architecture with all essential feature using .NET Core
Stars: ✭ 57 (-6.56%)
Mutual labels:  repository
Nexus Oss
Sonatype Nexus OSS
Stars: ✭ 240 (+293.44%)
Mutual labels:  repository
standardnotes-extensions
Standard Notes Extensions
Stars: ✭ 16 (-73.77%)
Mutual labels:  repository
Mvvmframe
🏰 MVVMFrame for Android 是一个基于Google官方推出的Architecture Components dependencies(现在叫JetPack){ Lifecycle,LiveData,ViewModel,Room } 构建的快速开发框架。有了MVVMFrame的加持,从此构建一个MVVM模式的项目变得快捷简单。
Stars: ✭ 218 (+257.38%)
Mutual labels:  repository
meta-repo
Meta-repo is a git repository that contains all the ports trees for Funtoo Linux. (GitHub Mirror)
Stars: ✭ 40 (-34.43%)
Mutual labels:  repository
Projj
Manage repository easily.
Stars: ✭ 206 (+237.7%)
Mutual labels:  repository
receptacle
minimalistic implementation of the repository pattern
Stars: ✭ 18 (-70.49%)
Mutual labels:  repository
repository
[PHP 7] Implementation and definition of a base Repository in Domain land.
Stars: ✭ 26 (-57.38%)
Mutual labels:  repository

Developer: Lio.Huang

Package NuGet Stable NuGet Pre-release Downloads
Banana.Uow Banana.Uow Banana.Uow Banana.Uow
Banana.Utility Banana.Utility Banana.Utility Banana.Utility

Banana.Uow

项目介绍

👉English documentation

基于Dapper封装的仓储、工作单元,支持SQL Server, MySQL, Sqlite,Postgresql,Oracle...

一、使用说明

1. 注册链接

 ConnectionBuilder.ConfigRegist("strConn", Banana.Uow.Models.DBType.SqlServer);

2. 模型

引入命名空间:

using Banana.Uow.Models;

创建模型:

   [Table("T_Student")]
   public class Student : IEntity
   {
      // if Oracle db
     //[Key("user_sequence")]
       [Key]
       public int Id { get; set; }
       public string Name { get; set; }
       public int Sex { get; set; }
       public int ClassId { get; set; }
       [Computed]
       public DateTime Createtime { get; set; }
       [Column("UserNameFiel")]
       public string UserName { get; set; }
   }

特性说明:

  • Table:指定实体对应地数据库表名,如果类名和数据库表名不同,需要设置
  • Key:指定此列为自动增长主键(oracle设置序列名称即可)
  • ExplicitKey:指定此列为非自动增长主键(例如guid,字符串列)
  • Computed:计算属性,此列不作为更新
  • Write:指定列是否可写
  • Column:指定列名
  • ExceptUpdate: 指定该列不需要Update操作

3. 仓储使用

3.1 增删改查

    var repo = new Repository<Student>();
    //查询单个
    var model = repo.Query(7);

    //查询列表
    var list = repo.QueryList("Name like @Name", new { Name = "%EminemJK%" });

    //分页查询
    var page1 = repo.QueryList(1,5);
    var page2 = repo.QueryList(2,5);
    … …
    var page0 = repo.QueryList(1, 10, "ID>@Id", new { Id = 2 }, "id", false);

    //删除
    boo b = repo.Delete(model);
    boo b = repo.Delete(new Category(){ Id =7 });

    //更新
    bool model = repo.Update(model);

    //插入
    int id = (int)repo.Insert(new Student() { Name = "EminemJK",… … });

    //批量插入
    bool b = repo.InsertBatch(sql,List);

    //执行语句
    int res = repo.Execute(sql,param);

3.2 多数据库时

    var dbA = "dbStoreA";
    var dbB = "dbStoreA";
    ConnectionBuilder.ConfigRegist("strConnA", DBType.SqlServer2012, dbA);
    ConnectionBuilder.ConfigRegist("strConnB", DBType.SqlServer2012, dbB);
    
    var userInfo_ReadRepo = new Repository<Student>(dbA); 
    var userInfo_WirteRepo = new Repository<Student>(dbA);
    Your code ……

4. 工作单元

using (UnitOfWork uow = new UnitOfWork())
{
       var studentRepo = uow.GetRepository<Student>();
       var model = new Student("EminemJK");
       var sid = studentRepo.Insert(model);

       var classRepo = uow.GetRepository<MClass>();
       var cid = classRepo.Insert(new MClass("Fifth Grade"));
       if (sid > 0 && cid > 0)
       {
            uow.Commit();
       }
       else
       {
            uow.Rollback();
       }
}

多数据库时

using (UnitOfWork uow = new UnitOfWork(IDbConnection context))
{
      Your code
}

OR

using (UnitOfWork uow = new UnitOfWork("dbKey"))
{
      Your code
}

5.日志记录

MiniProfiler

Banana.Utility

公用库 Utility

Name Use
RedisUtils 基于StackExchange.Redis封装
PinYin 拼音帮助类
JavaDate 时间戳
ModelConvertUtil 模型拷贝
PagingUtil 分页
HttpHelper easy Get & Post
EnumDescription 枚举特性说明
Encryption 常用加密解密,DES/MD5/RSA

To Be Continued

👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍


License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].