kreta/Kreta.Client/FileService/Request/FileUploadRequest.cs
2024-03-13 00:33:46 +01:00

34 lines
975 B
C#

using System;
namespace Kreta.Client.FileService.Request
{
public class FileUploadRequest : IFileUploadRequest
{
public FileUploadRequest(string fileName, byte[] content, string contentType, string path)
{
if (string.IsNullOrWhiteSpace(fileName))
{
throw new ArgumentNullException(nameof(fileName));
}
if (content?.Length == 0)
{
throw new ArgumentNullException(nameof(content));
}
if (string.IsNullOrWhiteSpace(contentType))
{
throw new ArgumentNullException(nameof(contentType));
}
Path = path;
FileName = fileName;
Content = content;
ContentType = contentType;
}
public string Path { get; }
public string FileName { get; }
public byte[] Content { get; }
public string ContentType { get; }
}
}