using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Threading; using System.Threading.Tasks; using xCategoryService.Models.Dtos; using xIdentityModels.Models; using xModels.Dtos; namespace xCategoryService.Interfaces { /// /// Completely Exported Service ... /// public interface IXCategoryService { // #region Category Provider ... /// /// Check Has Specified Locale or not ... /// /// /// /// /// Task CategoryHasLocale( int id, string language, CancellationToken cancellationToken = default ); /// /// Load an Item by all of it's Related Translations ... /// /// /// /// Task GetCategoryResource( int id, CancellationToken cancellationToken = default ); /// /// Add Item for Specified Language ... /// /// /// /// /// /// /// Task AddCategory( XCategoryDto item, string language = null, string connectionId = null, XUserClaimsInfoDto userInfo = null, CancellationToken cancellationToken = default ); /// /// Add Item by It's Locales ... /// /// /// /// /// /// Task AddCategoryResource( XCategoryResourceDto item, string connectionId = null, XUserClaimsInfoDto userInfo = null, CancellationToken cancellationToken = default ); /// /// Remove Item for Specified Language ... /// /// /// if null, Remove All /// /// /// /// Task RemoveCategory( int id, string language = null, string connectionId = null, XUserClaimsInfoDto userInfo = null, CancellationToken cancellationToken = default ); /// /// Update an Item for Specified Language ... /// /// /// /// /// /// /// /// Task UpdateCategory( int id, XCategoryDto item, string language = null, string connectionId = null, XUserClaimsInfoDto userInfo = null, CancellationToken cancellationToken = default ); /// /// Refresh a Resource ... /// /// /// /// /// /// Task RefreshCategory( XCategoryResourceDto resource, string connectionId = null, XUserClaimsInfoDto userInfo = null, CancellationToken cancellationToken = default ); /// /// Get All Resources ... /// /// /// Task> GetAllCategoryResources( CancellationToken cancellationToken = default ); /// /// Find One Resource ... /// /// /// /// Task FindOneCategoryResource( Expression> predicate = null, CancellationToken cancellationToken = default ); /// /// Find Many Resource ... /// /// /// /// /// Task> FindManyCategoryResource( Expression> predicate = null, Func, IOrderedQueryable> orderBuilder = null, CancellationToken cancellationToken = default ); /// /// Retrieve Resources by Query Pattern ... /// /// /// /// /// /// Task> QueryCategoryResources( XQuery query = null, Expression> predicate = null, Func, IOrderedQueryable> orderBuilder = null, CancellationToken cancellationToken = default ); /// /// Get All Resources as Async Enumerable ... /// /// /// IAsyncEnumerable GetAllCategoryResourcesAsAsyncEnumerable( CancellationToken cancellationToken = default ); #endregion // #region SubCategory Provider ... /// /// Check Has Specified Locale or not ... /// /// /// /// /// Task SubCategoryHasLocale( int id, string language, CancellationToken cancellationToken = default ); /// /// Load an Item by all of it's Related Translations ... /// /// /// /// Task GetSubCategoryResource( int id, CancellationToken cancellationToken = default ); /// /// Add Item for Specified Language ... /// /// /// /// /// /// /// Task AddSubCategory( XSubCategoryDto item, string language = null, string connectionId = null, XUserClaimsInfoDto userInfo = null, CancellationToken cancellationToken = default ); /// /// Add Item by it's Locales and Reference ... /// /// /// /// /// /// Task AddSubCategoryResource( XSubCategoryResourceDto item, string connectionId = null, XUserClaimsInfoDto userInfo = null, CancellationToken cancellationToken = default ); /// /// Remove Item for Specified Language ... /// /// /// if null, Remove All /// /// /// /// Task RemoveSubCategory( int id, string language = null, string connectionId = null, XUserClaimsInfoDto userInfo = null, CancellationToken cancellationToken = default ); /// /// Update an Item for Specified Language ... /// /// /// /// /// /// /// /// Task UpdateSubCategory( int id, XSubCategoryDto item, string language = null, string connectionId = null, XUserClaimsInfoDto userInfo = null, CancellationToken cancellationToken = default ); /// /// Refresh a Resource ... /// /// /// /// /// /// Task RefreshSubCategory( XSubCategoryResourceDto resource, string connectionId = null, XUserClaimsInfoDto userInfo = null, CancellationToken cancellationToken = default ); /// /// Get All Resources ... /// /// /// Task> GetAllSubCategoryResources( CancellationToken cancellationToken = default ); /// /// Find One Resource ... /// /// /// /// Task FindOneSubCategoryResource( Expression> predicate = null, CancellationToken cancellationToken = default ); /// /// Find Many Resource ... /// /// /// /// /// Task> FindManySubCategoryResource( Expression> predicate = null, Func, IOrderedQueryable> orderBuilder = null, CancellationToken cancellationToken = default ); /// /// Retrieve Resources by Query Pattern ... /// /// /// /// /// /// Task> QuerySubCategoryResources( XQuery query = null, Expression> predicate = null, Func, IOrderedQueryable> orderBuilder = null, CancellationToken cancellationToken = default ); /// /// Get All Resources as Async Enumerable ... /// /// /// IAsyncEnumerable GetAllSubCategoryResourcesAsAsyncEnumerable( CancellationToken cancellationToken = default ); #endregion } }