Example #1
0
        public async Task <bool> LoseLead(CreateLostLeadDto lead)
        {
            string sUrl     = _LocalUrlBase;
            string leadJson = JsonConvert.SerializeObject(lead);

            var client = _clientFactory.CreateClient();

            var stringContent = new StringContent(content: leadJson, encoding: Encoding.UTF8, mediaType: "application/json");
            var respons       = await client.PostAsync(sUrl, stringContent);

            Console.WriteLine(respons);
            return(true);
        }
Example #2
0
        public ActionResult <LostLeadDto> LoseLead(CreateLostLeadDto lead)
        {
            var leadModel = _mapper.Map <LostLead>(lead);

            _leadsRepo.LoseLead(leadModel);
            _leadsRepo.Save();


            var leadToReturn = _mapper.Map <LostLeadDto>(leadModel);

            return(CreatedAtRoute("GetLostLeadById",
                                  new { Id = leadModel.Id }, leadToReturn));
        }