using EFC_GO;

using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace ITVisions.Extensions
{
 public class OKActionResult : IActionResult
 {
  public Flug Daten { get; set; }
  public string Autor { get; set; }

  public OKActionResult(Flug daten, string autor)
  {
   this.Autor = autor;
   this.Daten = daten;
  }

  public Task ExecuteResultAsync(ActionContext context)
  {
   context.HttpContext.Response.StatusCode = StatusCodes.Status200OK;
   context.HttpContext.Response.Headers.Add("X-Autor", this.Autor);
   return Task.FromResult<Flug>(this.Daten);
  }
 }

}
