Files
monorepo/LCU.API.Internal.FileOperations/LCU.Library.Internal.FileOperationsModels/Models/ParsePdfRequest.cs
T
2026-04-27 10:50:07 -05:00

47 lines
981 B
C#

using System.ComponentModel.DataAnnotations;
namespace LCU.Library.Internal.FileOperationsModels.Models
{
public class ParsePdfRequest
{
private string rootPath;
private string parsedPdfname;
[Required(AllowEmptyStrings = false)]
public string RootPath
{
get
{
return rootPath;
}
set
{
rootPath = string.IsNullOrWhiteSpace(value) || value.EndsWith("\\") ? value : $"{value}\\";
}
}
[Required(AllowEmptyStrings = false)]
public string PdfName { get; set; }
[Required]
[Range(1, int.MaxValue, ErrorMessage = "PageStart must be larger then 0.")]
public int PageStart { get; set; }
[Required]
[Range(1, int.MaxValue, ErrorMessage = "PageStop must be larger then 0.")]
public int PageStop { get; set; }
public string ParsedPdfname
{
get
{
return parsedPdfname;
}
set
{
parsedPdfname = value.ToLower().EndsWith(".pdf") || string.IsNullOrWhiteSpace(value) ? value : $"{value}.pdf";
}
}
}
}