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