41 lines
1.1 KiB
C#
41 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.Text;
|
|
using LCU.Library.Internal.ApiResponse.Models;
|
|
|
|
namespace LCU.Library.Internal.FileOperationsModels.Models
|
|
{
|
|
public class AppendFileRequest : ReturnResponse
|
|
{
|
|
[Required(ErrorMessage = "Destination path is required.")]
|
|
public string DestinationPath { get; set; }
|
|
[Required(ErrorMessage = "FileName is required.")]
|
|
public string FileName { get; set; }
|
|
[Required(ErrorMessage = "Extension is required.")]
|
|
public string Extension { get; set; }
|
|
[Required(ErrorMessage = "FileData is required.")]
|
|
public string FileData { get; set; }
|
|
|
|
[NotMapped]
|
|
public string FullFilePath
|
|
{
|
|
get
|
|
{
|
|
return DestinationPath.EndsWith("\\") ? $"{DestinationPath}{FileNameWithExtension}" : $"{DestinationPath}\\{FileNameWithExtension}";
|
|
}
|
|
}
|
|
|
|
[NotMapped]
|
|
public string FileNameWithExtension
|
|
{
|
|
get
|
|
{
|
|
return Extension.StartsWith(".") ? $"{FileName}{Extension}" : $"{FileName}.{Extension}";
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|