public HttpResponseMessage Login(CustomerView view)
        {
            var original = this._context.customers.FirstOrDefault(p => p.emailAddress == view.emailAddress);

            if (original == null)
            {
                return Request.CreateResponse(HttpStatusCode.NotFound);
            }
            else if (view.password == original.password)
            {
                if (original.GetType().BaseType == typeof(CustomerPrivate))
                {
                    var temp = (CustomerPrivate)original;
                    var data = new CustomerPrivateView(temp);
                    return Request.CreateResponse(HttpStatusCode.OK, data);
                }
                else
                {
                    var temp = (CustomerCompany)original;
                    var data = new CustomerCompanyView(temp);
                    return Request.CreateResponse(HttpStatusCode.OK, data);
                }
            }
            else
            {
                return Request.CreateResponse(HttpStatusCode.NotFound);
            }
        }
        public HttpResponseMessage Create(CustomerPrivateView view)
        {
            if (ModelState.IsValid)
            {
                var customer = this._context.privateCustomers.FirstOrDefault(c => c.personalNumber == view.personalNumber);

                if (customer == null)
                {
                    try
                    {
                        view.created = DateTime.UtcNow.ToString();
                        view.updated = DateTime.UtcNow.ToString();
                        view.enabled = true;

                        var original = view.convert(this._context);
                        this._context.privateCustomers.Add(original);
                        this._context.SaveChanges();

                        view.id = original.id;

                        HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, view);
                        //response.Headers.Location = new Uri(Url.Link("Default", new { id = performer.performerID }));
                        return response;
                    }
                    catch (Exception ex)
                    {
                        return Request.CreateErrorResponse(HttpStatusCode.NotFound, ex);
                    }
                }
                else if (customer.emailAddress == view.emailAddress)
                {
                    // update customer

                    HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, view);
                    return response;
                }
                else
                {
                    return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
                }
            }
            else
            {
                return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
            }
        }