Пример #1
0
        public void Execute(CargoInsertDto dto)
        {
            var registro = _mapper.Map <CargoInsertDto, Cargo>(dto);

            _context.Cargos.Add(registro);
            _context.Save();
        }
Пример #2
0
        public ActionResult CreateCargo(CargoInsertDto dto)
        {
            string token    = Microsoft.AspNetCore.Authentication.AuthenticationHttpContextExtensions.GetTokenAsync(HttpContext, "access_token").Result;
            var    response = HttpRequestFactory.Post(_configuration["Endpoints:Cargos"], dto, token).Result;

            _logger.LogInformation(string.Format("CreateCargo: StatusCode:{0} , RequestMessage:{1} ", response.StatusCode, response.RequestMessage));
            return(convertMessage(response, response.ContentAsType <CargoInsertDto>()));
        }
Пример #3
0
 public ActionResult Post(CargoInsertDto dto)
 {
     _insertCargo.Execute(dto);
     return(Ok());
 }