Ejemplo n.º 1
0
        public async Task <IActionResult> Get(CancellationToken cancellationToken)
        {
            var query  = new GetAllNetworkAddressQuery();
            var result = await Mediator.Send(query, cancellationToken);

            return(new JsonResult(result));
        }
 public async Task <IEnumerable <NetworkAddressDto> > Handle(GetAllNetworkAddressQuery query, CancellationToken cancellationToken)
 {
     return(await _context.NetworkAddresses
            .AsNoTracking()
            .Select(x => new NetworkAddressDto
     {
         Id = x.Id,
         Address = TunnelFunctions.Text(x.Address)
     })
            .ToListAsync(cancellationToken));
 }