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

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

            _logger.LogInformation(string.Format("CreateUniverso: StatusCode:{0} , RequestMessage:{1} ", response.StatusCode, response.RequestMessage));
            return(convertMessage(response, response.ContentAsType <UniversoInsertDto>()));
        }
Пример #3
0
 public ActionResult Post(UniversoInsertDto dto)
 {
     _insertUniverso.Execute(dto);
     _logger.LogInformation(string.Format("Universo Id:{0} Creada por Usuario: {1} ", dto.Id, dto.Identity));
     return(Ok());
 }