Giter VIP home page Giter VIP logo

zeki.frame's Introduction

基于Dapper为底层封装,以及面向接口的三层框架

查询

示例:

使用匿名类
var list_0 = DAL.QueryList<SysUserInfo>(new { uId = 5 });
使用指定的类进行复杂的操作拼装
var dataParms = new DataParameters();
dataParms.Add<SysUserInfo>(p => p.uLoginName, "zzq");
dataParms.Add<SysUserInfo>(p => p.uRemark, "", ConditionOperator.Like);
var list_1 = DAL.QueryList<SysUserInfo>(dataParms);

存储过程

示例:

var dbParameters = new DataParameters();
dbParameters.Add("@channelId", 2, DbType.Int32);
dbParameters.Add("outstr", "未知错误", DbType.String, direction: ParameterDirection.Output);
DAL.ExecProcedure("sp_test", dbParameters);
var outstr = dbParameters.GetParamVal<string>("outstr");

添加

示例:

var insertModel = new Model.SysUserInfo()
{
    uAddTime = DateTime.Now,
    uDepId = 2,
    uEmail = "[email protected]",
    uGender = false,
    uId = 5,
    uIsDel = true,
    uLoginName = "zzq",
    uPwd = "jsdjfiu",
    uRemark = "ceshi1"
};
var res = SysUserInfoBLL.Insert(insertModel);

修改

示例:

var dataParam = new DataParameters();
dataParam.Add<SysUserInfo>(p => p.uId, 5);
dataParam.Add<SysUserInfo>(p => p.uLoginName, "zzq");
dataParam.AddUpdate<SysUserInfo>(p => p.uEmail, "[email protected]");
var res = SysUserInfoDAL.UpdatePart<SysUserInfo>(dataParam);

其它

另外还有批量新增,标注特性使用事务等,此处就不再演示

生成Model、BLL、DAL可以使用Tool中的模板(使用CodeSimith)

使用的框架

.Net 5.0,MiniProfiler(监控Sql)、AspectCore(实现AOP)、AutoFac、NLog、Dapper

使用的中间件

HttpClient 过滤器 请求中间件

zeki.frame's People

Contributors

zkenone avatar

Stargazers

 avatar  avatar 小付同学 avatar  avatar yj_小白 avatar  avatar  avatar

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.