I work with EF / AutoMapping. And I want after an Insert immediately the Id (PK) of the record. How do you do that? Is it possible refreshing the data immediately after an insert?
public int InsertArtist(ArtistDto artistDto)
{
Artist entity = _mapper.Map<ArtistDto, Artist>(artistDto);
_artistRepository.Insert(entity);
_artistRepository.Save();
return entity.Id;
}