コード例 #1
0
        public async Task <SendEmailResponseDto> SendFeed()
        {
            var request = new SendEmailRequestDto
            {
                To         = "*****@*****.**",
                From       = "*****@*****.**",
                Params     = new { Username = "******", Book = "book", Author = "Juano" },
                TemplateId = tempalteId
            };

            return(await _httpClientHandler.Send <SendEmailResponseDto>(
                       HttpMethod.Post,
                       endpoint,
                       "/V1/EmailManagment/SendEmail",
                       request,
                       "application/json"));
        }
コード例 #2
0
        private async Task <BookDto> CreateBook(BookDto newBook)
        {
            // TODO: Put the correct call
            string mediaType    = MediaType.ApplicationJson;
            string endPoint     = "Books";
            var    httpResponse = await _httpClientHandler.Send(System.Net.Http.HttpMethod.Get, endPoint,
                                                                "/books", null, mediaType, true, false, null);

            var listOfBooks = GetObjectFromHttpResponse <List <BookDto> >(in httpResponse);

            string title   = "";
            string genere  = "";
            string summary = "";

            foreach (BookDto book in listOfBooks)
            {
                title   = book._title;
                genere  = book._genere;
                summary = book._summary;
            }

            return(BookConverter.ModelToDto(await _bookRepository.Create(newBook).ConfigureAwait(false)));
        }