public IHttpActionResult CreateCustomer(CustomerModel newCustomer) { var entity = new Customer() { Address = newCustomer.Address, City = newCustomer.City, CompanyName = newCustomer.CompanyName, ContactName = newCustomer.ContactName, ContactTitle = newCustomer.ContactTitle, Country = newCustomer.Country, Fax = newCustomer.Fax, Phone = newCustomer.Phone, PostalCode = newCustomer.PostalCode, Region = newCustomer.Region }; _repository.CreateCustomer(entity); var loc = Url.Link("api/customers/{customerID}", new { customerID = newCustomer.CustomerID }); return(Created <CustomerModel>(loc, newCustomer)); }