public async Task <ThingDetailViewModel> Handle( ThingQuery.GetById message) { var entity = await _thingRepository.GetByIdAsync(message.Id); #pragma warning disable 618 return(Mapper.Map <ThingDetailViewModel>(entity)); #pragma warning restore 618 }
public async Task <Unit> Handle(ThingCommand.Delete message) { var entity = await _thingRepository.GetByIdAsync(message.Id); if (_securityPoint.CanDoWork(entity)) { await _thingRepository.Delete(message.Id); } return(Unit.Value); }