public async Task <ActionResult <IEnumerable <GastoResource> > > GetAllGastos()
        {
            var userId = this.User.FindFirstValue(ClaimTypes.NameIdentifier);
            var gastos = await _gastoService.GetAllGastos(userId);

            var gastosResources = _mapper.Map <IEnumerable <Gasto>, IEnumerable <GastoResource> >(gastos);

            return(Ok(gastosResources));
        }
Beispiel #2
0
        public async Task <IActionResult> GetAllGastos()
        {
            int userId = int.Parse(User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.NameIdentifier).Value);

            return(Ok(await _gastoService.GetAllGastos(userId)));
        }