using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Net.Http.Headers;
namespace Roadie.Library
{
///
/// A OperationResult specific to a File type request.
///
public class FileOperationResult : OperationResult
{
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 messages = null)
{
if (messages != null && messages.Any())
{
this.AdditionalData = new Dictionary();
messages.ToList().ForEach(x => this.AddMessage(x));
}
}
public FileOperationResult(bool isNotFoundResult, IEnumerable messages = null)
{
this.IsNotFoundResult = isNotFoundResult;
if (messages != null && messages.Any())
{
this.AdditionalData = new Dictionary();
messages.ToList().ForEach(x => this.AddMessage(x));
}
}
}
}