/// <inheritdoc/> public override Task UpdateRange(IEnumerable <T> entities, CancellationToken cancellationToken) { var entitiesList = entities.ToList(); foreach (var entity in entitiesList) { SetModified(entity); } return(InnerRepository.UpdateRange(entitiesList, cancellationToken)); }
/// <inheritdoc/> public override Task Update(T entity, CancellationToken cancellationToken) { SetModified(entity); return(InnerRepository.Update(entity, cancellationToken)); }
/// <inheritdoc/> public override Task <T> Add(T entity, CancellationToken cancellationToken) { SetCreated(entity); return(InnerRepository.Add(entity, cancellationToken)); }
//================================================================================ public void Dispose() { InnerRepository.Dispose(); }
public String Get(Part part, Locale locale, String key) { return(InnerRepository.Get(new Qualifier.Unique(part, locale, key))); }
/// <summary> /// 根据Lambda表达式对实体集合进行批量操作 /// </summary> /// <param name="instances"></param> /// <param name="fnOperation"></param> /// <returns></returns> public static IEnumerable <int> Batch <M>(IEnumerable <M> instances, Expression <Func <IRepository <T>, M, int> > fnOperation) { return(InnerRepository.Batch <M>(instances, fnOperation)); }
/// <summary> /// 删除 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="instance"></param> /// <param name="deleteCheck">除了id条件之外的附加条件</param> /// <returns></returns> public static int Delete(object instance, Expression <Func <T, bool> > deleteCheck) { return(InnerRepository.Delete(instance, deleteCheck)); }
/// <summary> /// 更新 /// </summary> /// <param name="instance">支持PO、POCO、IDictionary、IDictionaryOfKV, NameValueCollection 类型</param> /// <param name="updateCheck">除了id条件之外的附加条件</param> /// <returns></returns> public static int Update(object instance, Expression <Func <T, bool> > updateCheck) { return(InnerRepository.Update(instance, updateCheck)); }
public override IQueryable <T> Query() { return(InnerRepository.Query()); }
public override void DeleteAll() { InnerRepository.DeleteAll(); }
public override void Delete(T entity) { InnerRepository.Delete(entity); }
public override void Update(T entity) { InnerRepository.Update(entity); }
public QualifiedValue GetQualified(Part part, Locale locale, String key, String defaultValue = null) { var value = InnerRepository.GetQualified(new Qualifier.Unique(GetSegmentPart(part), locale, key), defaultValue); return(value); }
public String Get(Part part, Locale locale, String key, String defaultValue = null) { return(InnerRepository.Get(new Qualifier.Unique(GetSegmentPart(part), locale, key), defaultValue)); }
public QualifiedValue GetQualified(Part part, Locale locale, String key) { var value = InnerRepository.GetQualified(new Qualifier.Unique(part, locale, key)); return(value); }
public override T GetById(object id) { return(InnerRepository.GetById(id)); }
/// <summary> /// 插入并根据Lambda表达式返回特定信息 /// </summary> /// <typeparam name="S"></typeparam> /// <param name="instance"></param> /// <param name="resultSelector"></param> /// <returns></returns> public static S Save <S>(object instance, Expression <Func <T, S> > resultSelector) { return(InnerRepository.Insert <S>(instance, resultSelector)); }
public override void Create(T entity) { InnerRepository.Create(entity); }
/// <summary> /// 更新并根据Lambda表达式返回特定信息 /// </summary> /// <param name="instance">支持PO、POCO、IDictionary、IDictionaryOfKV, NameValueCollection 类型</param> /// <param name="updateCheck">除了id条件之外的附加条件</param> /// <param name="resultSelector"></param> /// <returns></returns> public static S Update <S>(object instance, Expression <Func <T, bool> > updateCheck, Expression <Func <T, S> > resultSelector) { return(InnerRepository.Update <S>(instance, updateCheck, resultSelector)); }
public override void UpdateWorkItem(WorkItem workItem) { RunOptimistic(() => InnerRepository.UpdateWorkItem(workItem)); }
/// <summary> /// 删除 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="predicate"></param> /// <returns></returns> public static int Delete(Expression <Func <T, bool> > predicate) { return(InnerRepository.Delete(predicate)); }
public override void DeleteWorkItem(string workItemId) { RunOptimistic(() => InnerRepository.DeleteWorkItem(workItemId)); }
/// <summary> /// 通过实体Id获取对应的实体,id可以是单Id也可以是联合Id,如果是联合Id那么以数组的形式作为参数 /// </summary> /// <param name="id"></param> /// <returns></returns> public static T Get(object id) { Guard.NotNull(InnerRepository, "Repository"); return(InnerRepository.Get(id)); }
/// <inheritdoc/> public override Task Remove(T entity, CancellationToken cancellationToken) { SetDeleted(entity); return(InnerRepository.Update(entity, cancellationToken)); }