public IHttpActionResult PutAddress(int id, Address address)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != address.Id)
            {
                return(BadRequest());
            }



            if (!AddressExists(id))
            {
                return(NotFound());
            }
            else
            {
                _addressService.AddOrUpdate(address);
            }


            return(StatusCode(HttpStatusCode.NoContent));
        }
        public ActionResult Create([Bind(Include = "Id,PersonId,StreetAddress,City,State,Country,ZipCode,AddressTypeId")] Address address)
        {
            if (ModelState.IsValid)
            {
                _addressService.AddOrUpdate(address);
                string url = Url.Action("ListAddresses", "Addresses", new { Id = address.PersonId });
                return(Json(new { success = true, url = url, target = "#idAddress" }));
            }

            ViewBag.AddressTypeId = new SelectList(_genericService.GetAll <AddressType>(), "Id", "Label", address.AddressTypeId);
            return(PartialView("_Create", address));
        }