resolve file referencing on webinar creation time ...
This commit is contained in:
@@ -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 ...
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user