public async Task <GetAllInstrumentQueryResult> Handle(GetAllInstrumentQuery query, CancellationToken cancellationToken) { var result = GetAllInstrumentQueryResult.Create(); result.Instruments = await _repository.GetAll(cancellationToken); return(result); }
public IEnumerable <InstrumentDto> GetAllInstruments() { return(_instrumentRepository.GetAll().Select(instrument => new InstrumentDto { IdCode = instrument.code, InstrumentNameEnglish = instrument.name_en, InstrumentNameIcelandic = instrument.name_is, DescriptionInIcelandic = instrument.description_is }).OrderBy(instrument => instrument.InstrumentNameIcelandic)); }
private IEnumerable <InstrumentDetail> GetInstrumentList() { var instrumentList = _instrumentRepository.GetAll(); var songInstrumentIds = _songRepository.GetSongInstrumentIds(); var result = instrumentList .GroupJoin(songInstrumentIds, instrument => instrument.Id, songInstrumentId => songInstrumentId, (i, si) => new InstrumentDetail { Id = i.Id, Name = i.Name, Abbreviation = i.Abbreviation, IsSongInstrument = si.Any() }).OrderBy(x => x.Name).ToArray(); return(result); }
public IEnumerable <InstrumentModel> GetAll() { var instruments = _instrumentRepository.GetAll(); return(instruments.Select(InstrumentMapper.ToInstrumentModel)); }
public IActionResult Get() { return(Ok(_instrumentRepository.GetAll())); }
// GET: InstrumentController public ActionResult Index() { List <Instrument> instruments = _instrumentRepository.GetAll(); return(View(instruments)); }
public IQueryable <Instrument> GetAll() { return(_InstrumentRepository.GetAll()); }