public async Task <IActionResult> Post([FromBody] DtoResumeNegotiation dto) { var entity = Mapper.Map <ResumeNegotiation>(dto); _context.ResumeNegotiations.Add(entity); await _context .SaveChangesAsync() .ConfigureAwait(false); return(Ok(entity.Id)); }
public async Task <IActionResult> Update([FromBody] DtoResumeNegotiation dto, [FromRoute] long id) { var template = Mapper.Map <ResumeNegotiation>(dto); template.Id = id; await _context.ResumeNegotiations .Where(x => x.Id == id) .UpdateFromQueryAsync(_ => template) .ConfigureAwait(false); return(Ok(id)); }