Abp IRepository 方法解释(1)
//
// 摘要:
// This interface is implemented by all repositories to ensure implementation of
// fixed methods.
// **实现这一接口以确保使用存储库中的方法
// 类型参数:
// TEntity:
// Main Entity type this repository works on
// **实体类
// TPrimaryKey:
// Primary key type of the entity
// **实体类的主键类型
public interface IRepository<TEntity, TPrimaryKey> : IRepository, ITransientDependency where TEntity : class, IEntity<TPrimaryKey>
{
//
// 摘要:
// Gets count of all entities in this repository.
//
// 返回结果:
// Count of entities
int Count();
//
// 摘要:
// Gets count of all entities in this repository based on given predicate.
// **基于委托方法条件来获取实体个数
// 参数:
// predicate:
// A method to filter count
// 过滤的方法
// 返回结果:
// Count of entities
int Count(Expression<Func<TEntity, bool>> predicate);
//
// 摘要:
// Gets count of all entities in this repository.
//
// 返回结果:
// Count of entities
Task<int> CountAsync();
// 摘要:
// Gets count of all entities in this repository based on given predicate.
//
// 参数:
// predicate:
// A method to filter count
//
// 返回结果:
// Count of entities
Task<int> CountAsync(Expression<Func<TEntity, bool>> predicate);
// 摘要:
// Deletes an entity.
//
// 参数:
// entity:
// Entity to be deleted
void Delete(TEntity entity);
// 摘要:
// Deletes an entity by primary key.
//
// 参数:
// id:
// Primary key of the entity
void Delete(TPrimaryKey id);
// 摘要:
// Deletes many entities by function. Notice that: All entities fits to given predicate
// are retrieved and deleted. This may cause major performance problems if there
// are too many entities with given predicate.
// ***通过传递的表达式树来删除多个实体,注意:如果有委托中有太多的实体,有可能引发重大的性能问题
// 参数:
// predicate:
// A condition to filter entities
//**过滤实体的条件
void Delete(Expression<Func<TEntity, bool>> predicate);
// 摘要:
// Deletes an entity by primary key.
//
// 参数:
// id:
// Primary key of the entity
Task DeleteAsync(TPrimaryKey id);
// 摘要:
// Deletes many entities by function. Notice that: All entities fits to given predicate
// are retrieved and deleted. This may cause major performance problems if there
// are too many entities with given predicate.
//
// 参数:
// predicate:
// A condition to filter entities
Task DeleteAsync(Expression<Func<TEntity, bool>> predicate);
// 摘要:
// Deletes an entity.
//
// 参数:
// entity:
// Entity to be deleted
Task DeleteAsync(TEntity entity);
// 摘要:
// Gets an entity with given given predicate or null if not found.
// **根据条件来查找实体,如果找不到则返回null
// 参数:
// predicate:
// Predicate to filter entities
TEntity FirstOrDefault(Expression<Func<TEntity, bool>> predicate);
// 摘要:
// Gets an entity with given primary key or null if not found.
// **通过主键来获取实体类,找不到则返回null
// 参数:
// id:
// Primary key of the entity to get
//
// 返回结果:
// Entity or null
TEntity FirstOrDefault(TPrimaryKey id);
// 摘要:
// Gets an entity with given given predicate or null if not found.
//
// 参数:
// predicate:
// Predicate to filter entities
Task<TEntity> FirstOrDefaultAsync(Expression<Func<TEntity, bool>> predicate);
// 摘要:
// Gets an entity with given primary key or null if not found.
//
// 参数:
// id:
// Primary key of the entity to get
//
// 返回结果:
// Entity or null
Task<TEntity> FirstOrDefaultAsync(TPrimaryKey id);
// 摘要:
// Gets an entity with given primary key.
//
// 参数:
// id:
// Primary key of the entity to get
//
// 返回结果:
// Entity
TEntity Get(TPrimaryKey id);
// 摘要:
// Used to get a IQueryable that is used to retrieve entities from entire table.
//
// 返回结果:
// IQueryable to be used to select entities from database
IQueryable<TEntity> GetAll();
// 摘要:
// Used to get a IQueryable that is used to retrieve entities from entire table.
// One or more
//
// 参数:
// propertySelectors:
// A list of include expressions.
//
// 返回结果:
// IQueryable to be used to select entities from database
IQueryable<TEntity> GetAllIncluding(params Expression<Func<TEntity, object>>[] propertySelectors);
// 摘要:
// Used to get all entities.
//
// 返回结果:
// List of all entities
List<TEntity> GetAllList();
// 摘要:
// Used to get all entities based on given predicate.
//
// 参数:
// predicate:
// A condition to filter entities
//
// 返回结果:
// List of all entities
List<TEntity> GetAllList(Expression<Func<TEntity, bool>> predicate);
// 摘要:
// Used to get all entities.
//
// 返回结果:
// List of all entities
Task<List<TEntity>> GetAllListAsync();
// 摘要:
// Used to get all entities based on given predicate.
//
// 参数:
// predicate:
// A condition to filter entities
//
// 返回结果:
// List of all entities
Task<List<TEntity>> GetAllListAsync(Expression<Func<TEntity, bool>> predicate);
// 摘要:
// Gets an entity with given primary key.
//
// 参数:
// id:
// Primary key of the entity to get
//
// 返回结果:
// Entity
Task<TEntity> GetAsync(TPrimaryKey id);
// 摘要:
// Inserts a new entity.
//
// 参数:
// entity:
// Inserted entity
TEntity Insert(TEntity entity);
// 摘要:
// Inserts a new entity and gets it's Id. It may require to save current unit of
// work to be able to retrieve id.
// **插入一个实体返回其Id,
// 参数:
// entity:
// Entity
//
// 返回结果:
// Id of the entity
TPrimaryKey InsertAndGetId(TEntity entity);
// 摘要:
// Inserts a new entity and gets it's Id. It may require to save current unit of
// work to be able to retrieve id.
//
// 参数:
// entity:
// Entity
//
// 返回结果:
// Id of the entity
Task<TPrimaryKey> InsertAndGetIdAsync(TEntity entity);
// 摘要:
// Inserts a new entity.
//
// 参数:
// entity:
// Inserted entity
Task<TEntity> InsertAsync(TEntity entity);
// 摘要:
// Inserts or updates given entity depending on Id's value.
//
// 参数:
// entity:
// Entity
TEntity InsertOrUpdate(TEntity entity);
// 摘要:
// Inserts or updates given entity depending on Id's value. Also returns Id of the
// entity. It may require to save current unit of work to be able to retrieve id.
//
// 参数:
// entity:
// Entity
//
// 返回结果:
// Id of the entity
TPrimaryKey InsertOrUpdateAndGetId(TEntity entity);
// 摘要:
// Inserts or updates given entity depending on Id's value. Also returns Id of the
// entity. It may require to save current unit of work to be able to retrieve id.
//
// 参数:
// entity:
// Entity
//
// 返回结果:
// Id of the entity
Task<TPrimaryKey> InsertOrUpdateAndGetIdAsync(TEntity entity);
// 摘要:
// Inserts or updates given entity depending on Id's value.
//
// 参数:
// entity:
// Entity
Task<TEntity> InsertOrUpdateAsync(TEntity entity);
// 摘要:
// Creates an entity with given primary key without database access.
// **为实体创建一个主键,此主键不是数据库生成的
// 参数:
// id:
// Primary key of the entity to load
//
// 返回结果:
// Entity
TEntity Load(TPrimaryKey id);
// 摘要:
// Gets count of all entities in this repository (use if expected return value is
// greather than System.Int32.MaxValue.
//
// 返回结果:
// Count of entities
long LongCount();
// 摘要:
// Gets count of all entities in this repository based on given predicate (use this
// overload if expected return value is greather than System.Int32.MaxValue).
//
// 参数:
// predicate:
// A method to filter count
//
// 返回结果:
// Count of entities
long LongCount(Expression<Func<TEntity, bool>> predicate);
// 摘要:
// Gets count of all entities in this repository (use if expected return value is
// greather than System.Int32.MaxValue.
//
// 返回结果:
// Count of entities
Task<long> LongCountAsync();
// 摘要:
// Gets count of all entities in this repository based on given predicate (use this
// overload if expected return value is greather than System.Int32.MaxValue).
//
// 参数:
// predicate:
// A method to filter count
//
// 返回结果:
// Count of entities
Task<long> LongCountAsync(Expression<Func<TEntity, bool>> predicate);
// 摘要:
// Used to run a query over entire entities. Abp.Domain.Uow.UnitOfWorkAttribute
// attribute is not always necessary (as opposite to Abp.Domain.Repositories.IRepository`2.GetAll)
// if queryMethod finishes IQueryable with ToList, FirstOrDefault etc..
//
// 参数:
// queryMethod:
// This method is used to query over entities
//
// 类型参数:
// T:
// Type of return value of this method
//
// 返回结果:
// Query result
T Query<T>(Func<IQueryable<TEntity>, T> queryMethod);
// 摘要:
// Gets exactly one entity with given predicate. Throws exception if no entity or
// more than one entity.
// 得到仅有的一个查询出的实体,如果没有该实体或者多余一个将会抛出异常
// 参数:
// predicate:
// Entity
TEntity Single(Expression<Func<TEntity, bool>> predicate);
/ 摘要:
// Gets exactly one entity with given predicate. Throws exception if no entity or
// more than one entity.
//
// 参数:
// predicate:
// Entity
Task<TEntity> SingleAsync(Expression<Func<TEntity, bool>> predicate);
// 摘要:
// Updates an existing entity.
//
// 参数:
// entity:
// Entity
TEntity Update(TEntity entity);
// 摘要:
// Updates an existing entity.
//
// 参数:
// id:
// Id of the entity
//
// updateAction:
// Action that can be used to change values of the entity
//
// 返回结果:
// Updated entity
TEntity Update(TPrimaryKey id, Action<TEntity> updateAction);
// 摘要:
// Updates an existing entity.
//
// 参数:
// entity:
// Entity
Task<TEntity> UpdateAsync(TEntity entity);
// 摘要:
// Updates an existing entity.
//
// 参数:
// id:
// Id of the entity
//
// updateAction:
// Action that can be used to change values of the entity
//
// 返回结果:
// Updated entity
Task<TEntity> UpdateAsync(TPrimaryKey id, Func<TEntity, Task> updateAction);
}
Abp IRepository 方法解释(1)的更多相关文章
- Info.plist和pch文件的作用,UIApplication,iOS程序的启动过程,AppDelegate 方法解释,UIWindow,生命周期方法
Info.plist常见的设置 建立一个工程后,会在Supporting files文件夹下看到一个“工程名-Info.plist”的文件,该文件对工程做一些运行期的配置,非常重要,不能删除 注:在旧 ...
- es6的map()方法解释
es6的map()方法解释 map方法的作用不难理解,即“映射”,也就是原数组被“映射”成对应新数组.下面这个例子是数值项求平方: var data = [1, 2, 3, 4]; var arr ...
- vue第六单元(vue的实例和组件-vue实例的相关属性和方法-解释vue的原理-创建vue的组件)
第六单元(vue的实例和组件-vue实例的相关属性和方法-解释vue的原理-创建vue的组件) #课程目标 掌握vue实例的相关属性和方法的含义和使用 了解vue的数据响应原理 熟悉创建组件,了解全局 ...
- Python __new__ 方法解释与使用
解释 我们通常把 __init__ 称为构造方法,这是从其他语言借鉴过来的术语. 其实,用于构建实例的是特殊方法 __new__:这是个类方法(使用特殊方式处理,因此不必使用 @classmethod ...
- java url方法解释
java 的url类中有很多get方法 以下是获取值的意义 // 首先先看一下wikipedia上关于url的一个描述 //Every HTTP URL conforms to the syntax ...
- python thread的join方法解释
python的Thread类中提供了join()方法,使得一个线程可以等待另一个线程执行结束后再继续运行.这个方法还可以设定一个timeout参数,避免无休止的等待.因为两个线程顺序完成,看起来象一个 ...
- cocos2d-lua class 方法解释
lua中没有类的概念,有的只是表(table),而类之间的继承也就是将父类的表连到了一起,派生类中没有找到的属性和方法就通过元表查找父类,在cocos2d-lua中,封装好的class方法,完美的实现 ...
- 关于android WebViewClient的方法解释
1.public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true ...
- android WebViewClient的方法解释
1.在点击请求的是链接是才会调用,重写此方法返回true表明点击网页里面的链接还是在当前的webview里跳转,不跳到浏览器那边. public boolean shouldOverrideUrlLo ...
随机推荐
- LG3975 [TJOI2015]弦论
题意 题目描述 为了提高智商,ZJY开始学习弦论.这一天,她在< String theory>中看到了这样一道问题:对于一个给定的长度为n的字符串,求出它的第k小子串是什么.你能帮帮她吗? ...
- test20190409 线段
题意 线段(segment) [题目描述] 给定n条线段,第i条线段的左端点为\(l_i\),右端点为\(r_i\).第i条线段覆盖了点x当且仅当\(l_i ≤x ≤ r_i\). 给定Q个询问,第i ...
- day 47 html 学习 css 学习
前端基础之CSS CSS实例 每个CSS样式由两个组成部分:选择器和声明.声明又包括属性和属性值.每个声明之后用分号结束. CSS(Cascading Style Sheet,层叠样式表)定义如何显示 ...
- 07机器学习实战k-means
K-Means原理初探 K-Means算法的思想很简单,对于给定的样本集,按照样本之间的距离大小,将样本集划分为K个簇.让簇内的点尽量紧密的连在一起,而让簇间的距离尽量的大. 如果我们想直接求上式的最 ...
- 数学 它的内容,方法和意义 第三卷 (A. D. 亚历山大洛夫 著)
第十五章 实变数函数论 1. 绪论 2. 集合论 3. 实数 4. 点集 5. 集合的测度 6. 勒贝格积分 第十六章 线性代数 1. 线性代数的对象和它的工具 2. 线性空间 3. 线性方程组 4. ...
- 机器学习 - 开发环境安装pycharm + pyspark + spark集成篇
AS WE ALL KNOW,学机器学习的一般都是从python+sklearn开始学,适用于数据量不大的场景(这里就别计较“不大”具体指标是啥了,哈哈) 数据量大了,就需要用到其他技术了,如:spa ...
- 与左侧的 圆括号“(”(位于“e:\大二上课程课件、作业和答案\数据结构\chapter4\sqstack\sqstack\mysqstack.h(23)”)匹配之前遇到文件结束
错误原因是“某对圆括号只打了左括号而没有右括号”,debug方法是:直接根据报错提示:“与左侧的 圆括号“(”(位于“e:\大二上课程课件.作业和答案\数据结构\chapter4\sqstack\sq ...
- pycharm Process finished with exit code (0xC0000005)
pycharm Process finished with exit code (0xC0000005)解决办法 上次报过这个错误,是在安装浏览器时发现的,报过同样的错误.按当时的方法,以为切地解 ...
- pip查看已安装包列表
输入命令: pip freeze 结果: certifi==2018.10.15chardet==3.0.4Django==2.1.2idna==2.7pytz==2018.5requests==2. ...
- 自动加载以及Composer的实现
类的自动加载 两个函数 __autoload()魔术方法.spl_autoload_register 当php文件中使用了new关键字实例化一个对象时,如果该类没有在本php文件中被定义,将会触发__ ...