HangfireIO/Hangfire — pull request #161 by gius (2014-07-10 22:45:07+00:00)
Title: Store and display value returned from job

This pull request started from this question: http://discuss.hangfire.io/t/return-value-of-jobs/89

I wanted to store any value returned from job, make it available for custom filters, and also display it on the job history page on dashboard.

The first commit (3126e27) is responsible for getting return value from job and adding it to PerformedContext (this is not essential but could be useful for custom filters).

The second commit (986a053) is responsible for persisting Result property of SucceededState to database and displaying it on the dashboard.

The last commit (77d8fa9) connects the other two as it makes the result value get from JobPerformanceProcess to the SucceededState. I see this one as the most disputable as you might not like how the result value gets returned from JobPerformanceProcess.PerformJobWithFilters.
If this was the case, I can think of another way: 1. Create a custom filter that would store Result from PerformedContext and make it available via property. 2. Use the filter in Worker.ProcessJob, add it to the list of filters that are about to be applied on the job, and when the job is done, get the result from the filter.

I've tried to include unit tests as well. Unfortunately, I am not able to test the behavior with Redis. However, SQL seems to work fine.

Screenshot of the result is attached.
![hangfire](https://cloud.githubusercontent.com/assets/534639/3546423/86a595ea-0883-11e4-8292-b854a8faf0fa.png)