public HttpResponseMessage Put([FromBody] BrokerBO brokerBO) { Data.broker _broker = new Data.broker(); _broker.brokername = brokerBO.BrokerName; _broker.brokerid = brokerBO.BrokerId; _broker.brokerkey = brokerBO.BrokerKey; if (brokerBO.Address != null) { var custaddress = new Data.address() { addrkey = brokerBO.Address.AddrKey, address1 = brokerBO.Address.Address1, address2 = brokerBO.Address.Address2, city = brokerBO.Address.City, state = brokerBO.Address.State, country = brokerBO.Address.Country, zipcode = brokerBO.Address.Zip, email = brokerBO.Address.Email, fax = brokerBO.Address.Fax, phone = brokerBO.Address.Phone, website = brokerBO.Address.Website, addrname = _broker.brokerid }; bool updated = new AddressRepository().Update(custaddress); } bool result = repo.Update(_broker); if (result) { return(Request.CreateResponse(HttpStatusCode.OK)); } else { return(Request.CreateResponse(HttpStatusCode.InternalServerError)); } }
public void Update(BrokerModel entity) { _repository.Update(entity); }