public async Task <IActionResult> PutOrderRow(Guid id, V1DTO.OrderRow orderRow) { if (id != orderRow.Id) { return(BadRequest(new V1DTO.MessageDTO("Id and OrderRow.Id do not match"))); } await _bll.OrderRows.UpdateAsync(_mapper.Map(orderRow)); await _bll.SaveChangesAsync(); return(NoContent()); }
public async Task <ActionResult <V1DTO.OrderRow> > PostOrderRow(V1DTO.OrderRow orderRow) { var bllEntity = _mapper.Map(orderRow); _bll.OrderRows.Add(bllEntity); await _bll.SaveChangesAsync(); orderRow.Id = bllEntity.Id; return(CreatedAtAction("GetOrderRow", new { id = orderRow.Id, version = HttpContext.GetRequestedApiVersion()?.ToString() ?? "0" }, orderRow)); }