public ActionResult Post(PerfilInserDto dto)
        {
            _insertPerfil.Execute(ref dto);
            _logger.LogInformation(string.Format("Perfil Codigo:{0} Creado por Usuario:{1} ", dto.Codigo, dto.Identity));

            return(Ok(dto));
        }
        public ActionResult CreatePerfil(PerfilInserDto dto)
        {
            string token    = Microsoft.AspNetCore.Authentication.AuthenticationHttpContextExtensions.GetTokenAsync(HttpContext, "access_token").Result;
            var    response = HttpRequestFactory.Post(_configuration["Endpoints:Perfiles"], dto, token).Result;

            _logger.LogInformation(string.Format("CreatePerfil: StatusCode:{0} , RequestMessage:{1} ", response.StatusCode, response.RequestMessage));
            return(convertMessage(response, response.ContentAsType <PerfilDto>()));
        }
Beispiel #3
0
        public void Execute(ref PerfilInserDto dto)
        {
            var registro = _mapper.Map <PerfilInserDto, Perfil>(dto);

            _context.Perfiles.Add(registro);
            _context.Save();

            dto.Id = registro.Id;
        }