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