using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web;
using System.Web.Http;
using System.Collections.Specialized;
using Microsoft.Practices.Unity;
using Mug.SPA.WebUI.Dummies;
using Mug.SPA.WebUI.Model;

namespace Mug.SPA.WebUI.Controllers.Api {
    public class ContactUsController : ApiController {

        public HttpResponseMessage Post(ContactUs contactUs) {
            if (ModelState.IsValid) {

                // Envío de e-mail;

                HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created, contactUs);
                response.Headers.Location = new Uri(Url.Link("DefaultApi", new { Success = 1 }));
                return response;
            }
            else {
                return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
            }
        }
    }
}