Ejemplo n.º 1
0
        public async Task <ValueForListDto> GetByIdAsync(int id, CancellationToken cancellationToken = default(CancellationToken))
        {
            var value = await _uow.Values.GetByIdAsync(id);

            ValueForListDto valueForListDto = null;

            if (value != null)
            {
                valueForListDto      = new ValueForListDto();
                valueForListDto.Id   = value.Id;
                valueForListDto.Name = value.Name;
            }

            return(valueForListDto);
        }
Ejemplo n.º 2
0
        public async Task <IEnumerable <ValueForListDto> > GetAllAsync(CancellationToken cancellationToken = default(CancellationToken))
        {
            var values = await _uow.Values.GetAllAsync();

            List <ValueForListDto> valueForListDtos = new List <ValueForListDto>();

            foreach (var value in values)
            {
                ValueForListDto valueForListDto = new ValueForListDto();
                valueForListDto.Id   = value.Id;
                valueForListDto.Name = value.Name;
                valueForListDtos.Add(valueForListDto);
            }

            return(valueForListDtos);
        }