resolve file referencing on webinar creation time ...

This commit is contained in:
2025-12-18 19:08:35 +03:30
parent 7b8055fa05
commit f2f7265f8a
2 changed files with 19 additions and 24 deletions
+2 -15
View File
@@ -192,7 +192,7 @@ namespace xFileService.Providers
//
// Preparing Index ...
int index = GetLastIndex(providedForId);
if (index > 0)
if (index >= 0)
{
index++;
}
@@ -627,7 +627,7 @@ namespace xFileService.Providers
//
var lastIndex = GetLastIndex(providedForId);
if (lastIndex == 0)
if (lastIndex == -1)
{
//
// This Means there isnot any Reference ...
@@ -642,16 +642,7 @@ namespace xFileService.Providers
else
{
//
// Check Provided Index Exists or not ...
var isExists = model.References.Any(r => r.Index == forIndex);
if (!isExists)
{
//
// Normalize For Index ...
if (forIndex > lastIndex + 1)
{
forIndex = lastIndex + 1;
}
//
// Add New Reference ...
@@ -662,10 +653,6 @@ namespace xFileService.Providers
ReferencedTo = $"{providedForId}"
});
}
else
{
}
}
//
// Update Data Base ...
+9 -1
View File
@@ -1545,6 +1545,7 @@ namespace xFileService.Providers
//
// Fill Data for Update ...
var itemEntity = item.FromDto();
entity = entity.UpdateData(
updateWith: item,
propertyBlackList: new List<string>
@@ -1555,7 +1556,14 @@ namespace xFileService.Providers
nameof(XFile.References),
}
);
entity.References = item.References.ToListString();
//
if (!itemEntity.IsNullOrDefault())
{
entity.References = itemEntity.References;
}
//
if (entity.IsNullOrDefault())
{
XException.InvalidData.Throw();