public async Task <ClientDto> ById(int id) { using (var db = new ApplicationDbContext()) { var result = await db.Clients.FindAsync(id); if (result == null) { throw new InternalExceptions.NotFoundException(id.ToString()); } return(_mapper.ToDto(result)); } }