public async Task <IActionResult> Create([FromBody] HardwareDto dto) { if (dto == null || !ModelState.IsValid || !string.IsNullOrEmpty(dto.Id)) { return(BadRequest(new { message = "The request is invalid", request = dto })); } var insertedDto = await service.AddAsync(dto); return(Created("/", insertedDto)); }