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));
        }
Example #2
0
        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));
        }