Beispiel #1
0
        public async void PostIndicatePassage(IndicatePassageDto indicatePassageDto)
        {
            Models.Entities.IndicatePassage indicatePassage = new Models.Entities.IndicatePassage()
            {
                IdFacebookConversation = indicatePassageDto.IdFacebookConversation,
                Firtsname = indicatePassageDto.Firtsname,
                IsSend    = indicatePassageDto.IsSend,
                ToId      = indicatePassageDto.To
            };

            _unit.IndicatePassageRepository.Insert(indicatePassage);
            await _unit.SaveAsync();
        }
Beispiel #2
0
        public async Task PutIndicatePassage(IndicatePassageDto indicatePassage)
        {
            try
            {
                var json = JsonConvert.SerializeObject(indicatePassage);

                var buffer      = Encoding.UTF8.GetBytes(json);
                var byteContent = new ByteArrayContent(buffer);
                byteContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");

                var result = await HttpClient.PutAsync(new Uri(WebAppUrl + "/Api/IndicatePassageController/PutIndicatePassage/" + indicatePassage.Id), byteContent);

                result.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
            }
            catch (Exception e)
            {
                // TODO : Propagate exception to caller
                throw;
            }
        }