Refactor Providing Mechanism ...
This commit is contained in:
@@ -1,45 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using xFileService.Models.Dtos;
|
||||
using xFileService.Models.Entities;
|
||||
using xIdentityModels.Models;
|
||||
using xModels.Dtos;
|
||||
using xIdentityService.Interfaces;
|
||||
using XFileDto = xFileService.Models.Dtos.XFileDto;
|
||||
|
||||
// using xModels.Dtos;
|
||||
using xTagService.Interfaces;
|
||||
|
||||
namespace xFileService.Interfaces
|
||||
{
|
||||
public interface IXBaseFileProvider<TKey>
|
||||
/// <summary>
|
||||
/// Implementing XBaseFileProvider ...
|
||||
/// </summary>
|
||||
/// <typeparam name="TKey"></typeparam>
|
||||
public interface IXBaseFileProvider<TKey> : IXIdentityBaseReferencedProvider<XFileDto, TKey>
|
||||
{
|
||||
//
|
||||
#region Props ...
|
||||
/// <summary>
|
||||
/// Specified Provider ...
|
||||
/// </summary>
|
||||
string ProvidedFor { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Specified Provider Repositroy ...
|
||||
/// </summary>
|
||||
IXFileProvider Provider { get; }
|
||||
IXFileProvider FileProvider { get; }
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region Helper ...
|
||||
/// <summary>
|
||||
/// Get Specified Identifier ...
|
||||
/// </summary>
|
||||
/// <param name="forProvidedId"></param>
|
||||
/// <returns></returns>
|
||||
string GetIdentifier(TKey forProvidedId);
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region Tools ...
|
||||
/// <summary>
|
||||
@@ -56,7 +40,6 @@ namespace xFileService.Interfaces
|
||||
/// <returns></returns>
|
||||
Task<FileStreamResult> Stream(string fileName);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Download Specified File ...
|
||||
/// </summary>
|
||||
@@ -76,14 +59,14 @@ namespace xFileService.Interfaces
|
||||
/// </summary>
|
||||
/// <param name="forProvidedId"></param>
|
||||
/// <param name="files"></param>
|
||||
/// <param name="userInfo"></param>
|
||||
/// <param name="connectionId"></param>
|
||||
/// <param name="userInfo"></param>
|
||||
/// <returns></returns>
|
||||
Task<IEnumerable<XFileDto>> Upload(
|
||||
TKey forProvidedId,
|
||||
IFormFileCollection files,
|
||||
XUserClaimsInfoDto userInfo = null,
|
||||
string connectionId = null
|
||||
string connectionId = null,
|
||||
XUserClaimsInfoDto userInfo = null
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
@@ -91,14 +74,14 @@ namespace xFileService.Interfaces
|
||||
/// </summary>
|
||||
/// <param name="forProvidedId"></param>
|
||||
/// <param name="ids"></param>
|
||||
/// <param name="userInfo"></param>
|
||||
/// <param name="connectionId"></param>
|
||||
/// <param name="userInfo"></param>
|
||||
/// <returns></returns>
|
||||
Task<IEnumerable<Guid>> Remove(
|
||||
Task<IEnumerable<Guid>> RemoveFile(
|
||||
TKey forProvidedId,
|
||||
string ids = null,
|
||||
XUserClaimsInfoDto userInfo = null,
|
||||
string connectionId = null
|
||||
string connectionId = null,
|
||||
XUserClaimsInfoDto userInfo = null
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
@@ -115,105 +98,5 @@ namespace xFileService.Interfaces
|
||||
/// <returns></returns>
|
||||
Task<XFileStreamDescriptorDto> GetFileDescriptor(string fileName);
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region Data Model ...
|
||||
/// <summary>
|
||||
/// Get Specified File Model ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<XFileDto> Get(
|
||||
Guid id
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Get All Exists File Models ...
|
||||
/// </summary>
|
||||
/// <param name="ignoreSoftDeleteds"></param>
|
||||
/// <returns></returns>
|
||||
Task<IEnumerable<XFileDto>> GetAll();
|
||||
|
||||
/// <summary>
|
||||
/// Get All Exists File Models ...
|
||||
/// </summary>
|
||||
/// <param name="forProvidedId"></param>
|
||||
/// <returns></returns>
|
||||
Task<IEnumerable<XFileDto>> GetAllFor(TKey forProvidedId);
|
||||
|
||||
/// <summary>
|
||||
/// find an Entity by providing a Conditional Expression ...
|
||||
/// </summary>
|
||||
/// <param name="whereClause"></param>
|
||||
Task<XFileDto> FindOne(Expression<Func<XFile, bool>> whereClause);
|
||||
|
||||
/// <summary>
|
||||
/// find a collection of Entities by proving a Conditional Expression ...
|
||||
/// </summary>
|
||||
/// <param name="whereClause"></param>
|
||||
/// <returns></returns>
|
||||
Task<IEnumerable<XFileDto>> FindMany(
|
||||
Expression<Func<XFile, bool>> whereClause
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// retrieve Entities based on XQuery Pagination structure ...
|
||||
/// </summary>
|
||||
/// <param name="query"></param>
|
||||
/// <returns></returns>
|
||||
Task<XQueryResult<XFileDto>> Query(
|
||||
XQuery query
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// retrieve Entities based on XQuery Pagination structure by providing a Conditional Expression ...
|
||||
/// </summary>
|
||||
/// <param name="whereClause"></param>
|
||||
/// <param name="query"></param>
|
||||
/// <returns></returns>
|
||||
Task<XQueryResult<XFileDto>> ConditionalQuery(
|
||||
Expression<Func<XFile, bool>> whereClause,
|
||||
XQuery query
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Update an Entity values ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="item"></param>
|
||||
/// <param name="userInfo"></param>
|
||||
/// <returns></returns>
|
||||
Task<XFileDto> Update(
|
||||
Guid id,
|
||||
XFileDto item,
|
||||
XUserClaimsInfoDto userInfo = null
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// remove an Entity ...
|
||||
/// </summary>
|
||||
/// <param name="item"></param>
|
||||
/// <param name="userInfo"></param>
|
||||
/// <returns></returns>
|
||||
Task<XFileDto> Remove(
|
||||
Guid id,
|
||||
XUserClaimsInfoDto userInfo = null
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// count all exists Entities ...
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<int> Count();
|
||||
|
||||
/// <summary>
|
||||
/// Check an Entity exists or not ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<bool> IsExists(
|
||||
Guid id
|
||||
);
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -240,6 +240,7 @@ namespace xFileService.Interfaces
|
||||
/// <param name="providedFor"></param>
|
||||
/// <param name="forProvidedId"></param>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="forIndex"></param>
|
||||
/// <param name="userInfo"></param>
|
||||
/// <param name="connectionId"></param>
|
||||
/// <returns></returns>
|
||||
@@ -247,6 +248,7 @@ namespace xFileService.Interfaces
|
||||
string providedFor,
|
||||
TKey forProvidedId,
|
||||
Guid id,
|
||||
int forIndex = 0,
|
||||
XUserClaimsInfoDto userInfo = null,
|
||||
string connectionId = null
|
||||
);
|
||||
@@ -257,6 +259,7 @@ namespace xFileService.Interfaces
|
||||
/// <param name="providedFor"></param>
|
||||
/// <param name="forProvidedId"></param>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="forIndex"></param>
|
||||
/// <param name="userInfo"></param>
|
||||
/// <param name="connectionId"></param>
|
||||
/// <returns></returns>
|
||||
@@ -264,6 +267,7 @@ namespace xFileService.Interfaces
|
||||
string providedFor,
|
||||
TKey forProvidedId,
|
||||
Guid id,
|
||||
int forIndex = 0,
|
||||
XUserClaimsInfoDto userInfo = null,
|
||||
string connectionId = null
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user