mirror of
https://github.com/sphildreth/roadie
synced 2024-11-26 22:20:21 +00:00
46 lines
No EOL
1.3 KiB
C#
46 lines
No EOL
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using Microsoft.Net.Http.Headers;
|
|
|
|
namespace Roadie.Library
|
|
{
|
|
/// <summary>
|
|
/// A OperationResult specific to a File type request.
|
|
/// </summary>
|
|
public class FileOperationResult<T> : OperationResult<T>
|
|
{
|
|
public EntityTagHeaderValue ETag { get; set; }
|
|
public DateTimeOffset? LastModified { get; set; }
|
|
public string ContentType { get; set; }
|
|
|
|
public FileOperationResult()
|
|
{
|
|
}
|
|
|
|
public FileOperationResult(string message)
|
|
{
|
|
this.AddMessage(message);
|
|
}
|
|
|
|
public FileOperationResult(bool isNotFoundResult, string message)
|
|
{
|
|
this.IsNotFoundResult = isNotFoundResult;
|
|
this.AddMessage(message);
|
|
}
|
|
|
|
public FileOperationResult(IEnumerable<string> messages = null)
|
|
{
|
|
if (messages != null && messages.Any())
|
|
{
|
|
this.AdditionalData = new Dictionary<string, object>();
|
|
messages.ToList().ForEach(x => this.AddMessage(x));
|
|
}
|
|
}
|
|
|
|
public FileOperationResult(bool isNotFoundResult, IEnumerable<string> messages = null)
|
|
{
|
|
this.IsNotFoundResult = isNotFoundResult;
|
|
}
|
|
}
|
|
} |