[ProducesResponseType(StatusCodes.Status400BadRequest)] // validation errors public async Task <ActionResult <LaborDto> > PostNirLabor(LaborCreateDto nirLaborDto) { var nirLabor = ConvertToSource(nirLaborDto); _labors.Add(nirLabor); await _labors.SaveChangesAsync(); return(CreatedAtAction("GetNirLabor", new { id = nirLabor.ID }, ConvertToDto(nirLabor))); }
[ProducesResponseType(StatusCodes.Status400BadRequest)] // validation errors public async Task <ActionResult <LaborDto> > PostOntdLabor(LaborCreateDto ontdLaborDto) { var ontdLabor = ConvertToSource(ontdLaborDto); _ontdLabors.Add(ontdLabor); await _ontdLabors.SaveChangesAsync(); ontdLabor = await _ontdLabors.FirstOrDefaultAsync(m => m.ID == ontdLabor.ID); return(CreatedAtAction("GetOntdLabor", new { id = ontdLabor.ID }, ConvertToDto(ontdLabor))); }