public void Execute(AreaInsertDto dto) { var registro = _mapper.Map <AreaInsertDto, Area>(dto); _context.Areas.Add(registro); _context.Save(); }
public ActionResult CreateArea(AreaInsertDto dto) { string token = Microsoft.AspNetCore.Authentication.AuthenticationHttpContextExtensions.GetTokenAsync(HttpContext, "access_token").Result; var response = HttpRequestFactory.Post(_configuration["Endpoints:Areas"], dto, token).Result; _logger.LogInformation(string.Format("CreateArea: StatusCode:{0} , RequestMessage:{1} ", response.StatusCode, response.RequestMessage)); return(convertMessage(response, response.ContentAsType <AreaInsertDto>())); }
public ActionResult Post(AreaInsertDto dto) { _insertArea.Execute(dto); _logger.LogInformation(string.Format("Area Id:{0} Creada por Usuario: {1} ", dto.Id, dto.Identity)); return(Ok()); }