回到目录

返回异步与并行目录

在写完仓储接口的改造改造后,总觉得有个代码的坏味道,这种味道源于它的DRP,即重复的代码太多了,即异步操作和同步操作其实只是在insert,update和delete上有所不同,获取数据的方法都是一样的,所以,我最后决定,将异步的接口进行改造,让它更加合理,方法后都加上Async的后缀,看上去也更像是个异步方法,呵。

改造后的异步接口

  /// <summary>
/// 异步操作
/// 基础的数据操作规范
/// 与ORM架构无关
/// </summary>
/// <typeparam name="TEntity"></typeparam>
public interface IRepositoryAsync<TEntity>
where TEntity : class
{ /// <summary>
/// 添加实体并提交到数据服务器
/// </summary>
/// <param name="item">Item to add to repository</param>
Task InsertAsync(TEntity item); /// <summary>
/// 移除实体并提交到数据服务器
/// 如果表存在约束,需要先删除子表信息
/// </summary>
/// <param name="item">Item to delete</param>
Task DeleteAsync(TEntity item); /// <summary>
/// 修改实体并提交到数据服务器
/// </summary>
/// <param name="item"></param>
Task UpdateAsync(TEntity item); /// <summary>
/// 添加集合[集合数目不大时用此方法,超大集合使用BulkInsert]
/// </summary>
/// <param name="item"></param>
Task InsertAsync(IEnumerable<TEntity> item); /// <summary>
/// 修改集合[集合数目不大时用此方法,超大集合使用BulkUpdate]
/// </summary>
/// <param name="item"></param>
Task UpdateAsync(IEnumerable<TEntity> item); /// <summary>
/// 删除集合[集合数目不大时用此方法,超大集合使用批量删除]
/// </summary>
/// <param name="item"></param>
Task DeleteAsync(IEnumerable<TEntity> item);
/// <summary>
/// 批量添加,添加之前可以去除自增属性,默认不去除
/// </summary>
/// <param name="item"></param>
/// <param name="isRemoveIdentity"></param>
Task BulkInsertAsync(IEnumerable<TEntity> item, bool isRemoveIdentity); /// <summary>
/// 批量添加
/// </summary>
/// <param name="item"></param>
Task BulkInsertAsync(IEnumerable<TEntity> item); /// <summary>
/// 批量更新
/// </summary>
/// <param name="item"></param>
Task BulkUpdateAsync(IEnumerable<TEntity> item, params string[] fieldParams); /// <summary>
/// 批量删除
/// </summary>
/// <param name="item"></param>
Task BulkDeleteAsync(IEnumerable<TEntity> item);
}

而原来的IExtendRepository同时去继承同步和异步两个仓储接口

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAc8AAACqCAIAAABEVFMhAAAR7UlEQVR4nO2dvY7bOhpA9TgL5V0G2EIvEmBr6RVSqLvNYjo26YIUAdQOUtvIYtKmElLNC3ALkRR/Psryn0zb50C4d8KhSFqJjz99oslKAwDA9aku0MZedf0wnlwIAPAEnG/bverU/vRCAICn4FzbXsO149CXrOXChwcAZXKeba+QQ9irzq85Dn3nMI7z2zI/j0Pf933XdV2v1PT/YRQLTRcO29Jedaay62qvulmr49AHvZISAYCjOMe2F3ftOPRdGDaKcaRs264fRivIcegn26aFuaZ8tdpSr/dkIOlYAQAWON22l3ZtEEnO2ODWayFjWxOOqr32bJsUBo16DYuJDhfQytkDQlwAWM2ptpUCxSMKZRbsNQ69L8ZzbCtFsdm08lQhExajWgBYzWm2vYprbf3MDfocXs6KdA4+wrZ+mOoZM/cQz+RzwxdBGgEAjuUU2157fm2ULk0eaHmlaggVuiqTMD8ls6frhSkTflQdDw8AYC2X+HbDY5PJJwMAHAW2XYSUAQBcCGybZa86TAsAlwLbAgBsQTWOHxwcHBwc1z6wLQcHB8cWB5kEAIAtKMq2qukaFZTs2r5qkgdVu6Guuip79O3Or71vgpLojw/MvqnUdDl3bR9dpbqNpkGPbW0uvmrS33ooZX+7bw5c+anZuVD+2wR4Egq37fSWjgt3Q10POWGqJnjPx+9wpar8uY9FYNvgGs7GtMyXdD5LxrdtcCU9sSqV/yx0x2IvAI9HIXs3hMGXUvLb1b6Z18a2UfCllB7bOqx8m1BrbOsrd+1dwLodD8a2u7Y3JQtXPrzsjTK2tSoPwljvlRLbAmitC9u7YY5tlVp6W3qxrRcOR6GWDsO0fTNJ3Kvjv/lVs2nYld6tX8FEh6LUGZdGMHKc5ZuSxLYZ245tvZiRAHg2itq74Sjbtk0agrmwy3QZ2rav6yAp4TvF09+cwdyS69nWC2yV8uL9WYW7oa66Rs1juIRttXZXN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k5DNlcGKuaRASZmguDKHQDgpNYSMKk0my92wJzlr16gbLFQgBYQTG23em61qrVTavrWrdWnbJtpZyAbNvD2YOwjQI3IDiV9bYVbyD8ymkSRiwEgAWKsa3WTa2bWqvpFriekwaxbUM7OATbZmrmKW4DApl1s8r81EpEYNudrl2+RXmxrZYqLBcCQJ6CbNvWxg7To5jpnSzadpJC9PxHtK1YM09ZGxAsDXNdTT8/oKRym4qeH3y19Zy3dee6vIFYCABrKMi2zw4bEAA8NNi2DEr7yhkAXBpse3vYgADgGcC2AABbgG0BALYA2wIAbAG2BQDYAmwLALAF2BYAYAvOsq35ShSTlwAADnGGbW+/KDYAwN1wnm0vtl4VAMCDg20BALbgDNses2kXAMCTc5ptp8djuBYAYC3nxbZkEgAA1kHeFgBgC7AtAMAWYFsAgC0457tkbO0CALCWc9dJwLgAAGtgVRoAgC3AtgAAW4BtAQC2ANsCAGwBtgUA2AJsCwCwBaXadq+6fhhPLgQAKIwybbtXndqfXggAUBwl2vYarh2HvmQtFz48ADif8mx7hRzCXnV+zXHoO4dxnN+W+Xkc+r7vu67reqWm/w+jWGi6cNiW9qozlV1Xe9XNWh2HPuiVlAjAA1OabS/u2nHouzBsFONI2bZdP4xWkOPQT7ZNC3NN+Wq1pV7vyUDSsQLAw1CWbS/t2iCSnLHBrddCxrYmHFV77dk2KQwa9RoWEx0uoJWzB4S4AA9KSbaVAsUjCmUW7DUOvS/Gc2wrRbHZtPJUIRMWo1qAB+X/arNeDnHYpLkAAAAASUVORK5CYII=" alt="" />

而在调用上,开发者们更清楚自己使用的是同步还是异步方法

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAkAAAADOCAIAAABZ3SrgAAAUNklEQVR4nO3dzXWjPBiGYZpIE6ohbaiCFMI+bcyOXaaE6WDOYZHldPCVoG9hwPp5XyEMwZK5r5NFQgCJH+uxMEadq9Bguzs7TJNMPy7/Xn73Z75NHHvjLZ2b07l5du/vZZo30Z9nsEudlHrGk8JpYVlx6UHlgzn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ADSJAAMANIkAAwA0iQADADSJAAMANKnGAJseR8E3bAEAuhoDzDmXf6w6AADVBlgwChYAABECDADQpHoDjGuIAICMegNsvpmDezkAAIJ6A4xLiACADAIMANAkAgwA0CQCDADQpFoDjMHuAQBZNQYY4QUAWFVjgAEAsIoAAwA0iQADADSJAAMANOl/N3QdnhyuCD8AAAAASUVORK5CYII=" alt="" />

回到目录

返回异步与并行目录

EF架构~EF异步改造之路~仓储接口的改造~续的更多相关文章

  1. EF架构~EF异步改造之路~仓储接口的改造

    回到目录 返回异步与并行目录 C#5.0带来了并行编程 {C#1.0托管代码→C#2.0泛型→C#3.0LINQ→C#4.0动态语言→C#5.0异步编程} 随着C#5.0在.net4.5出来之后,它们 ...

  2. EF架构~EF异步改造之路~让DbContextRepository去实现异步接口

    回到目录 返回异步与并行目录 上一讲中,我们定义了三个异步操作接口,这回我们将对它进行实现,而有一个基础知识需要大家清楚,那就是实现接口的方式,一般我们使用默认的方式(隐式实现),这种方法实现的接口方 ...

  3. 关于MVC EF架构及Repository模式的一点心得

    一直都想写博客,可惜真的太懒了或者对自己的描述水平不太自信,所以...一直都是不想写的状态,关于领域驱动的东西看了不少,但是由于自己水平太差加上工作中实在用不到,所以一直处于搁置状态,最近心血来潮突然 ...

  4. EF架构~基于EF数据层的实现

    回到目录 之前写过关于实现一个完整的EF架构的文章,文章的阅读量也是满大的,自己很欣慰,但是,那篇文章是我2011年写的,所以,技术有些不成熟,所以今天把我的2014年写的EF底层架构公开一下,这个架 ...

  5. EF架构~通过EF6的DbCommand拦截器来实现数据库读写分离~终结~配置的优化和事务里读写的统一

    回到目录 本讲是通过DbCommand拦截器来实现读写分离的最后一讲,对之前几篇文章做了一个优化,无论是程序可读性还是实用性上都有一个提升,在配置信息这块,去除了字符串方式的拼接,取而代之的是sect ...

  6. EF架构~为EF DbContext生成的实体添加注释(T5模板应用)

    回到目录 相关文章系列 第八回 EF架构~将数据库注释添加导入到模型实体类中 第二十一回  EF架构~为EF DbContext生成的实体添加注释(T4模板应用) 第二十二回EF架构~为EF DbCo ...

  7. EF架构~数据分批批量提交

    回到目录 对于大数据量提交,包括插入,更新和删除,我始终不建议用EF自带的方法,因为它会增加与数据库的交互次数,一般地,EF的一个上下文在提交时会打开一个数据连接,然后把转换成的SQL语句一条一条的发 ...

  8. EF架构~扩展一个分页处理大数据的方法

    回到目录 最近总遇到大数据的问题,一次性处理几千万数据不实际,所以,我们需要对大数据进行分块处理,或者叫分页处理,我在EF架构里曾经写过类似的,那是在进行BulkInsert时,对大数据批量插入时候用 ...

  9. EF架构~CodeFirst数据迁移与防数据库删除

    回到目录 本文介绍两个概念,防数据库自动删除,这是由于在code first模式下,当数据实体发生变化时,会对原来数据库进行删除,并将新数据表添加进来,但这对于我们的运营环境数据库,是万万不能接受的, ...

随机推荐

  1. Struts2原理

    Struts 2以WebWork优秀的设计思想为核心,吸收了Struts 1的部分优点,建立了一个兼容WebWork和Struts 1的MVC框架,Struts 2的目标是希望可以让原来使用Strut ...

  2. SU suspike命令学习

    用默认参数生成的数据如下: 用别的软件打开数据查看, 依次查看4个脉冲的位置(第几道.出现的时间), 接下来我们做一些小练习,比如说在同一道上放两个脉冲 还可以增加道数,让脉冲位于不同地方,

  3. Eclipse配置Flex开发环境(转)

    Eclipse配置Flex开发环境 开发环境:Eclipse3.2.Flex Builder31.下载安装Flex Builder3,下载地址:http://subject.csdn.net/adob ...

  4. Lesson2.1:LinkedList、ConcurrentLinkedQueue、LinkedBlockingQueue对比分析

    写这篇文章源于我经历过的一次生产事故,在某家公司的时候,有个服务会收集业务系统的日志,此服务的开发人员在给业务系统的sdk中就因为使用了LinkedList,又没有做并发控制,就造成了此服务经常不能正 ...

  5. Knockout应用开发指南 第三章:绑定语法(2)

    原文:Knockout应用开发指南 第三章:绑定语法(2) 7   click 绑定 目的 click绑定在DOM元素上添加事件句柄以便元素被点击的时候执行定义的JavaScript 函数.大部分是用 ...

  6. Qt 显示图片的三种方法

    一. 直接用QLabel显示原图 //单独显示的QLabel 其大小为内容即图片的大小,若将QLabel放入QMainWindow中则QLabel的大小为其初始大小. /* QLabel *label ...

  7. 网友&quot;就像一支烟&quot;山寨币分析估值方法

    [注:素材取自QQ群,2017年12月28日的聊天记录."就像一支烟"分享了自己的山寨币分析估值方法.因为删去了其他人的聊天记录,部分文字可能断章取义,仅供参考,具体情况请自行分析 ...

  8. Audio播放

    <audio controls="controls" id="warnAudio" hidden> <source src="~/m ...

  9. 1--Selenium环境准备--Eclipse 添加Testng插件

    Eclipse安装TestNG TestNG官网地址:http://testng.org/ 1.离线安装TestNG插件: 受网络等因素影响,在线安装方式速度比较慢,可以通过如下方式离线安装TestN ...

  10. Ajax初窥

    Ajax四个步骤 1. 创建Ajax对象2. 连接到服务器3. 发送请求4. 接收返回值 0x01 创建AJAX对象 方法1(非IE6.0) Var oAjax = new XMLHttpReques ...