public async Task <IResponse <IEnumerable <Domain.TamagochiType> > > Handle(GetListTamagochiTypesQuery request, CancellationToken cancellationToken) { IEnumerable <Domain.TamagochiType> list; if (request.Filter == null) { list = _tamagochiTypeRepository.GetAll(); } else { list = _tamagochiTypeRepository.GetAll().Where(request.Filter); } return(this.RespondWith().Ok(list)); }
public async Task <IResponse <int> > Handle(UpdateStatusCommand request, CancellationToken cancellationToken) { var types = _tamagochiTypeRepository.GetAll(); int value = await _tamagochiRepository.UpdateTamagochisStatus(types.ToList()); return(this.RespondWith().Ok(value)); }