public CompletionAction Handle(Message <int, long> message) { var newDto = new Dto { I = message.Need }; _mongoStore.Put(newDto); message.Solution = new [] { _mongoStore.Count <Dto>() }; return(CompletionAction.Republish); }
public void Handle(Message <Widget[], string[]> message) { Widget[] widgetsToProcess = message.Need; message.Solution = new string[widgetsToProcess.Length]; for (int n = 0; n < widgetsToProcess.Length; n++) { Widget widget = widgetsToProcess[n]; message.Solution[n] = widget.Process(); datastore.Put(widget); } queueWrapper.PublishMessage(message); }
public Guid Put <T>(T entity) where T : DataEntity { _mongoStore.Put(entity, dataEntity => (Guid)dataEntity.Id == (Guid)entity.Id); return((Guid)entity.Id); }