move interfaces ...
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
|
||||
namespace xIdentityModels.Interfaces
|
||||
{
|
||||
public interface IXAuthorizationCache
|
||||
{
|
||||
void Clear();
|
||||
void RemovePolicy(string name);
|
||||
void SetPolicy(string name, AuthorizationPolicy policy);
|
||||
bool TryGetPolicy(string name, out AuthorizationPolicy policy);
|
||||
}
|
||||
}
|
||||
@@ -1,247 +0,0 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using xModels.Dtos;
|
||||
using System.Threading;
|
||||
using xIdentityModels.Dtos;
|
||||
using System.Threading.Tasks;
|
||||
using xIdentityModels.Models;
|
||||
using System.Linq.Expressions;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace xIdentityModels.Interfaces
|
||||
{
|
||||
public interface IXPolicyProvider
|
||||
{
|
||||
//
|
||||
#region Readers ...
|
||||
/// <summary>
|
||||
/// retrieve whole items as queryable ...
|
||||
/// </summary>
|
||||
/// <param name="asNoTracking">a flag for Tracking behaviour</param>
|
||||
/// <param name="predicate">an Expression for Filter Items ...</param>
|
||||
/// <param name="orderBuilder">an Order Builder expression for Ordering Query ...</param>
|
||||
/// <returns></returns>
|
||||
IQueryable<XPolicyDefinition> AsQueryable(
|
||||
bool asNoTracking = true,
|
||||
Expression<Func<XPolicyDefinition, bool>> predicate = null,
|
||||
Func<IQueryable<XPolicyDefinition>, IOrderedQueryable<XPolicyDefinition>> orderBuilder = null
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// retrieve an Entity by it's Id ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="ignoreSoftDeleteds"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XPolicyDefinitionDto> GetAsync(
|
||||
int id,
|
||||
bool ignoreSoftDeleteds = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// retrieve all exists Entities ...
|
||||
/// </summary>
|
||||
/// <param name="ignoreSoftDeleteds"></param>
|
||||
/// <param name="orderBuilder"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<IEnumerable<XPolicyDefinitionDto>> GetAllAsync(
|
||||
bool ignoreSoftDeleteds = true,
|
||||
Func<IQueryable<XPolicyDefinition>, IOrderedQueryable<XPolicyDefinition>> orderBuilder = null,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// find an Entity by providing a Conditional Expression ...
|
||||
/// </summary>
|
||||
/// <param name="predicate"></param>
|
||||
/// <param name="ignoreSoftDeleteds"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XPolicyDefinitionDto> FindOneAsync(
|
||||
Expression<Func<XPolicyDefinition, bool>> predicate,
|
||||
bool ignoreSoftDeleteds = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// find a collection of Entities by proving a Conditional Expression ...
|
||||
/// </summary>
|
||||
/// <param name="predicate"></param>
|
||||
/// <param name="ignoreSoftDeleteds"></param>
|
||||
/// <param name="orderBuilder"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<IEnumerable<XPolicyDefinitionDto>> FindManyAsync(
|
||||
Expression<Func<XPolicyDefinition, bool>> predicate,
|
||||
bool ignoreSoftDeleteds = true,
|
||||
Func<IQueryable<XPolicyDefinition>, IOrderedQueryable<XPolicyDefinition>> orderBuilder = null,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// count all exists Entities ...
|
||||
/// </summary>
|
||||
/// <param name="ignoreSoftDeleteds"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<int> CountAsync(
|
||||
bool ignoreSoftDeleteds = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// count all exists Entities Pages by providing page size ...
|
||||
/// </summary>
|
||||
/// <param name="pageSize"></param>
|
||||
/// <param name="totalItems"></param>
|
||||
/// <param name="ignoreSoftDeleteds"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<int> PagesCountAsync(
|
||||
int pageSize,
|
||||
int? totalItems = null,
|
||||
bool ignoreSoftDeleteds = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Check an Entity exists or not ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="ignoreSoftDeleteds"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<bool> IsExistsAsync(
|
||||
int id,
|
||||
bool ignoreSoftDeleteds = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region Query ...
|
||||
/// <summary>
|
||||
/// retrieve Entities based on XQuery Pagination structure ...
|
||||
/// </summary>
|
||||
/// <param name="query"></param>
|
||||
/// <param name="ignoreSoftDeleteds"></param>
|
||||
/// <param name="predicate"></param>
|
||||
/// <param name="orderBuilder"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XQueryResult<XPolicyDefinitionDto>> QueryAsync(
|
||||
XQuery query,
|
||||
bool ignoreSoftDeleteds = true,
|
||||
Expression<Func<XPolicyDefinition, bool>> predicate = null,
|
||||
Func<IQueryable<XPolicyDefinition>, IOrderedQueryable<XPolicyDefinition>> orderBuilder = null,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region Add/Update/Remove ...
|
||||
/// <summary>
|
||||
/// add a new Entity ...
|
||||
/// </summary>
|
||||
/// <param name="item"></param>
|
||||
/// <param name="saveChanges"></param>
|
||||
/// <param name="userInfo"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XPolicyDefinitionDto> AddAsync(
|
||||
XPolicyDefinitionDto item,
|
||||
bool saveChanges = true,
|
||||
XUserClaimsInfoDto userInfo = null,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Update an Entity values ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="item"></param>
|
||||
/// <param name="saveChanges"></param>
|
||||
/// <param name="userInfo"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XPolicyDefinitionDto> UpdateAsync(
|
||||
int id,
|
||||
XPolicyDefinitionDto item,
|
||||
bool saveChanges = true,
|
||||
XUserClaimsInfoDto userInfo = null,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// remove an Entity by it's Id ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="softDelete"></param>
|
||||
/// <param name="saveChanges"></param>
|
||||
/// <param name="userInfo"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XPolicyDefinitionDto> RemoveAsync(
|
||||
int id,
|
||||
bool softDelete = true,
|
||||
bool saveChanges = true,
|
||||
XUserClaimsInfoDto userInfo = null,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region Custom ...
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region Enrichers ...
|
||||
/// <summary>
|
||||
/// Enrich Item ...
|
||||
/// </summary>
|
||||
/// <param name="source"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XPolicyDefinitionDto> EnrichAsync(
|
||||
XPolicyDefinition source,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Enrich Item ...
|
||||
/// </summary>
|
||||
/// <param name="source"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XPolicyDefinitionDto> EnrichAsync(
|
||||
XPolicyDefinitionDto source,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Enrich a Collection of Items(s) ...
|
||||
/// </summary>
|
||||
/// <param name="sources"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<IEnumerable<XPolicyDefinitionDto>> EnrichRangeAsync(
|
||||
IEnumerable<XPolicyDefinition> sources,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Enrich a Collection of Items(s) ...
|
||||
/// </summary>
|
||||
/// <param name="sources"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<IEnumerable<XPolicyDefinitionDto>> EnrichRangeAsync(
|
||||
IEnumerable<XPolicyDefinitionDto> sources,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,247 +0,0 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using xModels.Dtos;
|
||||
using System.Threading;
|
||||
using xIdentityModels.Dtos;
|
||||
using System.Threading.Tasks;
|
||||
using xIdentityModels.Models;
|
||||
using System.Linq.Expressions;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace xIdentityModels.Interfaces
|
||||
{
|
||||
public interface IXRoleProvider
|
||||
{
|
||||
//
|
||||
#region Readers ...
|
||||
/// <summary>
|
||||
/// retrieve whole items as queryable ...
|
||||
/// </summary>
|
||||
/// <param name="asNoTracking">a flag for Tracking behaviour</param>
|
||||
/// <param name="predicate">an Expression for Filter Items ...</param>
|
||||
/// <param name="orderBuilder">an Order Builder expression for Ordering Query ...</param>
|
||||
/// <returns></returns>
|
||||
IQueryable<XRoleDefinition> AsQueryable(
|
||||
bool asNoTracking = true,
|
||||
Expression<Func<XRoleDefinition, bool>> predicate = null,
|
||||
Func<IQueryable<XRoleDefinition>, IOrderedQueryable<XRoleDefinition>> orderBuilder = null
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// retrieve an Entity by it's Id ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="ignoreSoftDeleteds"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XRoleDefinitionDto> GetAsync(
|
||||
int id,
|
||||
bool ignoreSoftDeleteds = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// retrieve all exists Entities ...
|
||||
/// </summary>
|
||||
/// <param name="ignoreSoftDeleteds"></param>
|
||||
/// <param name="orderBuilder"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<IEnumerable<XRoleDefinitionDto>> GetAllAsync(
|
||||
bool ignoreSoftDeleteds = true,
|
||||
Func<IQueryable<XRoleDefinition>, IOrderedQueryable<XRoleDefinition>> orderBuilder = null,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// find an Entity by providing a Conditional Expression ...
|
||||
/// </summary>
|
||||
/// <param name="predicate"></param>
|
||||
/// <param name="ignoreSoftDeleteds"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XRoleDefinitionDto> FindOneAsync(
|
||||
Expression<Func<XRoleDefinition, bool>> predicate,
|
||||
bool ignoreSoftDeleteds = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// find a collection of Entities by proving a Conditional Expression ...
|
||||
/// </summary>
|
||||
/// <param name="predicate"></param>
|
||||
/// <param name="ignoreSoftDeleteds"></param>
|
||||
/// <param name="orderBuilder"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<IEnumerable<XRoleDefinitionDto>> FindManyAsync(
|
||||
Expression<Func<XRoleDefinition, bool>> predicate,
|
||||
bool ignoreSoftDeleteds = true,
|
||||
Func<IQueryable<XRoleDefinition>, IOrderedQueryable<XRoleDefinition>> orderBuilder = null,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// count all exists Entities ...
|
||||
/// </summary>
|
||||
/// <param name="ignoreSoftDeleteds"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<int> CountAsync(
|
||||
bool ignoreSoftDeleteds = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// count all exists Entities Pages by providing page size ...
|
||||
/// </summary>
|
||||
/// <param name="pageSize"></param>
|
||||
/// <param name="totalItems"></param>
|
||||
/// <param name="ignoreSoftDeleteds"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<int> PagesCountAsync(
|
||||
int pageSize,
|
||||
int? totalItems = null,
|
||||
bool ignoreSoftDeleteds = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Check an Entity exists or not ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="ignoreSoftDeleteds"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<bool> IsExistsAsync(
|
||||
int id,
|
||||
bool ignoreSoftDeleteds = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region Query ...
|
||||
/// <summary>
|
||||
/// retrieve Entities based on XQuery Pagination structure ...
|
||||
/// </summary>
|
||||
/// <param name="query"></param>
|
||||
/// <param name="ignoreSoftDeleteds"></param>
|
||||
/// <param name="predicate"></param>
|
||||
/// <param name="orderBuilder"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XQueryResult<XRoleDefinitionDto>> QueryAsync(
|
||||
XQuery query,
|
||||
bool ignoreSoftDeleteds = true,
|
||||
Expression<Func<XRoleDefinition, bool>> predicate = null,
|
||||
Func<IQueryable<XRoleDefinition>, IOrderedQueryable<XRoleDefinition>> orderBuilder = null,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region Add/Update/Remove ...
|
||||
/// <summary>
|
||||
/// add a new Entity ...
|
||||
/// </summary>
|
||||
/// <param name="item"></param>
|
||||
/// <param name="saveChanges"></param>
|
||||
/// <param name="userInfo"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XRoleDefinitionDto> AddAsync(
|
||||
XRoleDefinitionDto item,
|
||||
bool saveChanges = true,
|
||||
XUserClaimsInfoDto userInfo = null,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Update an Entity values ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="item"></param>
|
||||
/// <param name="saveChanges"></param>
|
||||
/// <param name="userInfo"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XRoleDefinitionDto> UpdateAsync(
|
||||
int id,
|
||||
XRoleDefinitionDto item,
|
||||
bool saveChanges = true,
|
||||
XUserClaimsInfoDto userInfo = null,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// remove an Entity by it's Id ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="softDelete"></param>
|
||||
/// <param name="saveChanges"></param>
|
||||
/// <param name="userInfo"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XRoleDefinitionDto> RemoveAsync(
|
||||
int id,
|
||||
bool softDelete = true,
|
||||
bool saveChanges = true,
|
||||
XUserClaimsInfoDto userInfo = null,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region Custom ...
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region Enrichers ...
|
||||
/// <summary>
|
||||
/// Enrich Item ...
|
||||
/// </summary>
|
||||
/// <param name="source"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XRoleDefinitionDto> EnrichAsync(
|
||||
XRoleDefinition source,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Enrich Item ...
|
||||
/// </summary>
|
||||
/// <param name="source"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XRoleDefinitionDto> EnrichAsync(
|
||||
XRoleDefinitionDto source,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Enrich a Collection of Items(s) ...
|
||||
/// </summary>
|
||||
/// <param name="sources"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<IEnumerable<XRoleDefinitionDto>> EnrichRangeAsync(
|
||||
IEnumerable<XRoleDefinition> sources,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Enrich a Collection of Items(s) ...
|
||||
/// </summary>
|
||||
/// <param name="sources"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<IEnumerable<XRoleDefinitionDto>> EnrichRangeAsync(
|
||||
IEnumerable<XRoleDefinitionDto> sources,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,247 +0,0 @@
|
||||
using System;
|
||||
using xModels.Dtos;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using xIdentityModels.Dtos;
|
||||
using System.Threading.Tasks;
|
||||
using xIdentityModels.Models;
|
||||
using System.Linq.Expressions;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace xIdentityModels.Interfaces
|
||||
{
|
||||
public interface IXScopeProvider
|
||||
{
|
||||
//
|
||||
#region Readers ...
|
||||
/// <summary>
|
||||
/// retrieve whole items as queryable ...
|
||||
/// </summary>
|
||||
/// <param name="asNoTracking">a flag for Tracking behaviour</param>
|
||||
/// <param name="predicate">an Expression for Filter Items ...</param>
|
||||
/// <param name="orderBuilder">an Order Builder expression for Ordering Query ...</param>
|
||||
/// <returns></returns>
|
||||
IQueryable<XScopeDefinition> AsQueryable(
|
||||
bool asNoTracking = true,
|
||||
Expression<Func<XScopeDefinition, bool>> predicate = null,
|
||||
Func<IQueryable<XScopeDefinition>, IOrderedQueryable<XScopeDefinition>> orderBuilder = null
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// retrieve an Entity by it's Id ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="ignoreSoftDeleteds"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XScopeDefinitionDto> GetAsync(
|
||||
int id,
|
||||
bool ignoreSoftDeleteds = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// retrieve all exists Entities ...
|
||||
/// </summary>
|
||||
/// <param name="ignoreSoftDeleteds"></param>
|
||||
/// <param name="orderBuilder"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<IEnumerable<XScopeDefinitionDto>> GetAllAsync(
|
||||
bool ignoreSoftDeleteds = true,
|
||||
Func<IQueryable<XScopeDefinition>, IOrderedQueryable<XScopeDefinition>> orderBuilder = null,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// find an Entity by providing a Conditional Expression ...
|
||||
/// </summary>
|
||||
/// <param name="predicate"></param>
|
||||
/// <param name="ignoreSoftDeleteds"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XScopeDefinitionDto> FindOneAsync(
|
||||
Expression<Func<XScopeDefinition, bool>> predicate,
|
||||
bool ignoreSoftDeleteds = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// find a collection of Entities by proving a Conditional Expression ...
|
||||
/// </summary>
|
||||
/// <param name="predicate"></param>
|
||||
/// <param name="ignoreSoftDeleteds"></param>
|
||||
/// <param name="orderBuilder"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<IEnumerable<XScopeDefinitionDto>> FindManyAsync(
|
||||
Expression<Func<XScopeDefinition, bool>> predicate,
|
||||
bool ignoreSoftDeleteds = true,
|
||||
Func<IQueryable<XScopeDefinition>, IOrderedQueryable<XScopeDefinition>> orderBuilder = null,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// count all exists Entities ...
|
||||
/// </summary>
|
||||
/// <param name="ignoreSoftDeleteds"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<int> CountAsync(
|
||||
bool ignoreSoftDeleteds = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// count all exists Entities Pages by providing page size ...
|
||||
/// </summary>
|
||||
/// <param name="pageSize"></param>
|
||||
/// <param name="totalItems"></param>
|
||||
/// <param name="ignoreSoftDeleteds"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<int> PagesCountAsync(
|
||||
int pageSize,
|
||||
int? totalItems = null,
|
||||
bool ignoreSoftDeleteds = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Check an Entity exists or not ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="ignoreSoftDeleteds"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<bool> IsExistsAsync(
|
||||
int id,
|
||||
bool ignoreSoftDeleteds = true,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region Query ...
|
||||
/// <summary>
|
||||
/// retrieve Entities based on XQuery Pagination structure ...
|
||||
/// </summary>
|
||||
/// <param name="query"></param>
|
||||
/// <param name="ignoreSoftDeleteds"></param>
|
||||
/// <param name="predicate"></param>
|
||||
/// <param name="orderBuilder"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XQueryResult<XScopeDefinitionDto>> QueryAsync(
|
||||
XQuery query,
|
||||
bool ignoreSoftDeleteds = true,
|
||||
Expression<Func<XScopeDefinition, bool>> predicate = null,
|
||||
Func<IQueryable<XScopeDefinition>, IOrderedQueryable<XScopeDefinition>> orderBuilder = null,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region Add/Update/Remove ...
|
||||
/// <summary>
|
||||
/// add a new Entity ...
|
||||
/// </summary>
|
||||
/// <param name="item"></param>
|
||||
/// <param name="saveChanges"></param>
|
||||
/// <param name="userInfo"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XScopeDefinitionDto> AddAsync(
|
||||
XScopeDefinitionDto item,
|
||||
bool saveChanges = true,
|
||||
XUserClaimsInfoDto userInfo = null,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Update an Entity values ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="item"></param>
|
||||
/// <param name="saveChanges"></param>
|
||||
/// <param name="userInfo"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XScopeDefinitionDto> UpdateAsync(
|
||||
int id,
|
||||
XScopeDefinitionDto item,
|
||||
bool saveChanges = true,
|
||||
XUserClaimsInfoDto userInfo = null,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// remove an Entity by it's Id ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="softDelete"></param>
|
||||
/// <param name="saveChanges"></param>
|
||||
/// <param name="userInfo"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XScopeDefinitionDto> RemoveAsync(
|
||||
int id,
|
||||
bool softDelete = true,
|
||||
bool saveChanges = true,
|
||||
XUserClaimsInfoDto userInfo = null,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region Custom ...
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region Enrichers ...
|
||||
/// <summary>
|
||||
/// Enrich Item ...
|
||||
/// </summary>
|
||||
/// <param name="source"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XScopeDefinitionDto> EnrichAsync(
|
||||
XScopeDefinition source,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Enrich Item ...
|
||||
/// </summary>
|
||||
/// <param name="source"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<XScopeDefinitionDto> EnrichAsync(
|
||||
XScopeDefinitionDto source,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Enrich a Collection of Items(s) ...
|
||||
/// </summary>
|
||||
/// <param name="sources"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<IEnumerable<XScopeDefinitionDto>> EnrichRangeAsync(
|
||||
IEnumerable<XScopeDefinition> sources,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Enrich a Collection of Items(s) ...
|
||||
/// </summary>
|
||||
/// <param name="sources"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
Task<IEnumerable<XScopeDefinitionDto>> EnrichRangeAsync(
|
||||
IEnumerable<XScopeDefinitionDto> sources,
|
||||
CancellationToken cancellationToken = default
|
||||
);
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user