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