public async Task <MerchantAddressDetail_MerchantAddressDTO> Get([FromBody] MerchantAddressDetail_MerchantAddressDTO MerchantAddressDetail_MerchantAddressDTO)
        {
            if (!ModelState.IsValid)
            {
                throw new MessageException(ModelState);
            }

            MerchantAddress MerchantAddress = await MerchantAddressService.Get(MerchantAddressDetail_MerchantAddressDTO.Id);

            return(new MerchantAddressDetail_MerchantAddressDTO(MerchantAddress));
        }
        public MerchantAddress ConvertDTOToEntity(MerchantAddressDetail_MerchantAddressDTO MerchantAddressDetail_MerchantAddressDTO)
        {
            MerchantAddress MerchantAddress = new MerchantAddress();

            MerchantAddress.Id         = MerchantAddressDetail_MerchantAddressDTO.Id;
            MerchantAddress.MerchantId = MerchantAddressDetail_MerchantAddressDTO.MerchantId;
            MerchantAddress.Code       = MerchantAddressDetail_MerchantAddressDTO.Code;
            MerchantAddress.Address    = MerchantAddressDetail_MerchantAddressDTO.Address;
            MerchantAddress.Contact    = MerchantAddressDetail_MerchantAddressDTO.Contact;
            MerchantAddress.Phone      = MerchantAddressDetail_MerchantAddressDTO.Phone;
            return(MerchantAddress);
        }
        public async Task <ActionResult <MerchantAddressDetail_MerchantAddressDTO> > Update([FromBody] MerchantAddressDetail_MerchantAddressDTO MerchantAddressDetail_MerchantAddressDTO)
        {
            if (!ModelState.IsValid)
            {
                throw new MessageException(ModelState);
            }

            MerchantAddress MerchantAddress = ConvertDTOToEntity(MerchantAddressDetail_MerchantAddressDTO);

            MerchantAddress = await MerchantAddressService.Update(MerchantAddress);

            MerchantAddressDetail_MerchantAddressDTO = new MerchantAddressDetail_MerchantAddressDTO(MerchantAddress);
            if (MerchantAddress.IsValidated)
            {
                return(MerchantAddressDetail_MerchantAddressDTO);
            }
            else
            {
                return(BadRequest(MerchantAddressDetail_MerchantAddressDTO));
            }
        }