using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore.Query;
using xIdentityModels.Models;
using xModels.Base;
using xModels.Dtos;
using xPushService.Base;
namespace xPushService.Interfaces
{
///
/// a Provided Service Used for Providing Data Based on Validations of Users ...
///
///
///
///
///
public interface IXBaseProvided
where TEntity : XBaseEntity
where TDto : XBaseEntityDto
where THub : XBaseDtoHub
{
///
/// Get Specified Item by ID ...
///
///
///
///
///
Task Get(
TKey id,
Func, IIncludableQueryable> includeBuilder = null,
CancellationToken cancellationToken = default
);
///
/// Get All Exists Items ...
///
///
///
///
///
Task> GetAll(
Func, IOrderedQueryable> orderBuilder = null,
Func, IIncludableQueryable> includeBuilder = null,
CancellationToken cancellationToken = default
);
///
/// Find an item by providing a Conditional Expression ...
///
///
///
///
///
Task FindOne(
Expression> predicate,
Func, IIncludableQueryable> includeBuilder = null,
CancellationToken cancellationToken = default
);
///
/// Find a collection of Items by proving a Conditional Expression ...
///
///
///
///
///
///
Task> FindMany(
Expression> predicate,
Func, IOrderedQueryable> orderBuilder = null,
Func, IIncludableQueryable> includeBuilder = null,
CancellationToken cancellationToken = default
);
///
/// Retrieve Items based on XQuery Pagination structure ...
///
///
///
///
///
///
///
Task> Query(
XQuery query,
Expression> predicate = null,
Func, IOrderedQueryable> orderBuilder = null,
Func, IIncludableQueryable> includeBuilder = null,
CancellationToken cancellationToken = default
);
///
/// Retrieve Owned Items based on XQuery Pagination structure ...
/// if supported ...
///
///
///
///
///
///
///
///
Task> QueryOwned(
XQuery query,
XUserClaimsInfoDto userInfo = null,
Expression> predicate = null,
Func, IOrderedQueryable> orderBuilder = null,
Func, IIncludableQueryable> includeBuilder = null,
CancellationToken cancellationToken = default
);
///
/// Add an item values ...
///
///
///
///
///
///
Task Add(
TDto item,
XUserClaimsInfoDto userInfo = null,
string connectionId = null,
CancellationToken cancellationToken = default
);
///
/// Update an item values ...
///
///
///
///
///
///
///
Task Update(
TKey id,
TDto item,
XUserClaimsInfoDto userInfo = null,
string connectionId = null,
CancellationToken cancellationToken = default
);
///
/// remove an Item ...
///
///
///
///
///
///
Task Remove(
TKey id,
XUserClaimsInfoDto userInfo = null,
string connectionId = null,
CancellationToken cancellationToken = default
);
///
/// count all exists Items ...
///
///
///
Task Count(
CancellationToken cancellationToken = default
);
///
/// Check an Item exists or not ...
///
///
///
///
Task IsExists(
TKey id,
CancellationToken cancellationToken = default
);
}
}