using System; using System.Collections.Generic; using System.Linq.Expressions; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.SignalR; using xDataService.Configuration; using xFileService.Hubs; using xFileService.Interfaces.Entities; using xFileService.Models.Dtos; using xFileService.Models.Entities; using xIdentityModels.Models; using xIdentityService.Interfaces; using xModels.Dtos; using xStorageService.Interfaces; using XFileDto = xFileService.Models.Dtos.XFileDto; namespace xFileService.Interfaces { public interface IXFileProvider { // #region Props ... IHubContext Hub { get; } IXFileRepository FileRepository { get; } IXStorageProvider StorageProvider { get; } IXIdentityProvider IdentityProvider { get; } XDataServiceConfiguration DataSercviceConfiguration { get; } #endregion // #region Tools ... /// /// Stream Specified File ... /// /// /// Task Stream(Guid id); /// /// Stream Specified File ... /// /// /// Task Stream(string fileName); /// /// Download Specified File ... /// /// /// Task Download(Guid id); /// /// Download Specified File ... /// /// /// Task Download(string fileName); /// /// Upload Files ... /// /// /// /// Task> Upload( IFormFileCollection files, XUserClaimsInfoDto userInfo = null ); /// /// Remove Specified Files ... /// /// /// /// Task> Remove( string ids, XUserClaimsInfoDto userInfo = null ); /// /// Retrieve Specified File Streaming Info ... /// /// /// Task GetFileDescriptor(Guid id); /// /// Retrieve Specified File Streaming Info ... /// /// /// Task GetFileDescriptor(string fileName); #endregion // #region Data Model ... /// /// Get Specified File Model ... /// /// /// /// Task Get( Guid id ); /// /// Get All Exists File Models ... /// /// /// Task> GetAll(); /// /// find an Entity by providing a Conditional Expression ... /// /// Task FindOne(Expression> whereClause); /// /// find a collection of Entities by proving a Conditional Expression ... /// /// /// Task> FindMany( Expression> whereClause ); /// /// retrieve Entities based on XQuery Pagination structure ... /// /// /// Task> Query( XQuery query ); /// /// retrieve Entities based on XQuery Pagination structure by providing a Conditional Expression ... /// /// /// /// Task> ConditionalQuery( Expression> whereClause, XQuery query ); /// /// Update an Entity values ... /// /// /// /// /// Task Update( Guid id, XFileDto item, XUserClaimsInfoDto userInfo = null ); /// /// remove an Entity ... /// /// /// /// Task Remove( Guid id, XUserClaimsInfoDto userInfo = null ); /// /// count all exists Entities ... /// /// Task Count(); /// /// Check an Entity exists or not ... /// /// /// Task IsExists( Guid id ); #endregion // #region Helpers ... /// /// Converts an Entity to Dto ... /// /// /// Task ToXFileDto(XFile model); /// /// Convert a List of Entities to Dto ... /// /// /// Task> ToXDtoList(IEnumerable list); /// /// Converts an Entity Query Result to Dto ... /// /// /// Task> ToXDtoQueryResult(XQueryResult queryResult); #endregion } }