public HttpResponseMessage SaveAddress(HttpRequestMessage request, UserAddressViewModel address) { var newAddress = address.ReverseMap(); _studentApi.SaveAddress(newAddress); var response = request.CreateResponse(HttpStatusCode.Created); return(response); }
public HttpResponseMessage SaveSponsor(HttpRequestMessage request, SponsorViewModel sponsor) { if (!ModelState.IsValid) { } _sponsorApi.SaveSponsor(sponsor.ReverseMap()); int userId = sponsor.ID; string[] location = sponsor.Location.Split(','); var address = new UserAddressViewModel(); address.BursifyUserId = userId; address.City = location[1]; address.Province = location[0]; address.AddressType = "Company"; _studentApi.SaveAddress(address.ReverseMap()); var response = request.CreateResponse(HttpStatusCode.Created); return(response); }