Esempio n. 1
0
        public async Task <ICollection <TagDto> > GetAll()
        {
            var tags = await _repository.GetAll();

            var tagsDto = _mapper.Map <TagDto[]>(tags);

            return(tagsDto);
        }
        public async Task <IEnumerable <TagsDomainModel> > GetAllAsync()
        {
            var data = await _tagsRepository.GetAll();

            if (data == null)
            {
                return(null);
            }

            List <TagsDomainModel> result = new List <TagsDomainModel>();
            TagsDomainModel        model;

            foreach (var item in data)
            {
                model = new TagsDomainModel
                {
                    Id   = item.Id,
                    Name = item.Name
                };
                result.Add(model);
            }

            return(result);
        }
Esempio n. 3
0
        public ViewResult Index()
        {
            var model = tagsRepo.GetAll();

            return(View(model));
        }
Esempio n. 4
0
 private async Task InitializeAsync()
 {
     Tags = new ObservableCollection <string>(await _tagsRepository.GetAll());
     RaisePropertyChanged(() => Tags);
 }
Esempio n. 5
0
 public IEnumerable <TagsViewModel> GetAll()
 {
     return(_mapper.Map <List <TagsViewModel> >(_tagsRepository.GetAll()));
 }