last works ...

This commit is contained in:
2025-12-09 17:06:15 +03:30
parent 8d0e98a81e
commit 5a76acbc67
4 changed files with 67 additions and 47 deletions
+17 -6
View File
@@ -5,6 +5,7 @@ using System.Linq.Expressions;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using MongoDB.Driver.Core.Connections;
using xCommons.Extensions;
using xExceptions.Constants;
using xFileService.Interfaces;
@@ -167,11 +168,13 @@ namespace xFileService.Providers
/// <param name="forProvidedId"></param>
/// <param name="files"></param>
/// <param name="userInfo"></param>
/// <param name="connectionId"></param>
/// <returns></returns>
public async Task<IEnumerable<XFileDto>> Upload(
TKey forProvidedId,
IFormFileCollection files,
XUserClaimsInfoDto userInfo = null
XUserClaimsInfoDto userInfo = null,
string connectionId = null
)
{
//
@@ -186,7 +189,8 @@ namespace xFileService.Providers
// Here we are Following Custom Senario ...
var dtos = await Provider.Upload(
files: files,
userInfo: userInfo
userInfo: userInfo,
connectionId: connectionId
);
//
@@ -237,11 +241,13 @@ namespace xFileService.Providers
/// <param name="forProvidedId"></param>
/// <param name="ids"></param>
/// <param name="userInfo"></param>
/// <param name="connectionId"></param>
/// <returns></returns>
public async Task<IEnumerable<Guid>> Remove(
TKey forProvidedId,
string ids = null,
XUserClaimsInfoDto userInfo = null
XUserClaimsInfoDto userInfo = null,
string connectionId = null
)
{
//
@@ -283,7 +289,7 @@ namespace xFileService.Providers
{
//
var dtoIds = new List<string> { dto.Id.ToString() }.ToListString();
var removeIds = await Provider.Remove(dtoIds, userInfo);
var removeIds = await Provider.Remove(dtoIds, userInfo, connectionId);
isValid = !removeIds.IsNull() && removeIds.HasChild() && removeIds.Contains(dto.Id);
if (isValid)
{
@@ -752,11 +758,13 @@ namespace xFileService.Providers
/// <param name="forProvidedId"></param>
/// <param name="id"></param>
/// <param name="userInfo"></param>
/// <param name="connectionId"></param>
/// <returns></returns>
private async Task AddReference(
TKey forProvidedId,
Guid id,
XUserClaimsInfoDto userInfo = null
XUserClaimsInfoDto userInfo = null,
string connectionId = null
)
{
//
@@ -764,6 +772,7 @@ namespace xFileService.Providers
id: id,
userInfo: userInfo,
providedFor: ProvidedFor,
connectionId: connectionId,
forProvidedId: forProvidedId
);
}
@@ -778,7 +787,8 @@ namespace xFileService.Providers
private async Task RemoveReference(
TKey forProvidedId,
Guid id,
XUserClaimsInfoDto userInfo = null
XUserClaimsInfoDto userInfo = null,
string connectionId = null
)
{
//
@@ -786,6 +796,7 @@ namespace xFileService.Providers
id: id,
userInfo: userInfo,
providedFor: ProvidedFor,
connectionId: connectionId,
forProvidedId: forProvidedId
);
}