40 lines
1.0 KiB
C#
40 lines
1.0 KiB
C#
using LCU.Library.Internal.ApiResponse.Models;
|
|
using LCU.Library.Internal.FileOperationsModels.Models.NameSettings;
|
|
using LCU.Library.Internal.FileOperationsModels.Shared;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace LCU.Library.Internal.FileOperationsModels.Models
|
|
{
|
|
public class DeleteFileRequest : ReturnResponse
|
|
{
|
|
[Required(ErrorMessage = "Source path is required")]
|
|
public string SourcePath { get; set; }
|
|
|
|
[Required(ErrorMessage = "Source file is required")]
|
|
public string SourceFile { get; set; }
|
|
|
|
public DynamicNameSetting FileNameSetting { get; set; }
|
|
|
|
public bool SucceedOnError { get; set; }
|
|
|
|
[NotMapped]
|
|
public string FinalSourceFile
|
|
{
|
|
get
|
|
{
|
|
return DynamicNameBuilder.BuildDynamicName(SourceFile, FileNameSetting);
|
|
}
|
|
}
|
|
[NotMapped]
|
|
public string Source
|
|
{
|
|
get
|
|
{
|
|
var finalSourcePath = SourcePath.EndsWith("\\") ? SourcePath : $"{SourcePath}\\";
|
|
return finalSourcePath + FinalSourceFile;
|
|
}
|
|
}
|
|
}
|
|
}
|