roadie/RoadieLibrary/FileOperationResult.cs

35 lines
944 B
C#
Raw Normal View History

2018-11-11 01:11:58 +00:00
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; }
2018-11-11 14:46:09 +00:00
public FileOperationResult()
{
}
2018-11-11 01:11:58 +00:00
public FileOperationResult(string message)
{
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));
}
}
}
}