# Why hangfire convert each parameter to json?

**URL:** <https://discuss.hangfire.io/t/why-hangfire-convert-each-parameter-to-json/3308>\
**Category:** bug?\
**Created:** [May 14, 2017, 3:08pm UTC](https://discuss.hangfire.io/t/why-hangfire-convert-each-parameter-to-json/3308 "2017-05-14T15:08:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![key\_one](https://avatars.discourse-cdn.com/v4/letter/k/6bbea6/32.png) [@key\_one](https://discuss.hangfire.io/u/key_one)\
**Post date:** [May 14, 2017, 3:08pm UTC](https://discuss.hangfire.io/t/why-hangfire-convert-each-parameter-to-json/3308/1 "2017-05-14T15:08:44Z")

</div>

in my job I call the method with to2 parameter (int, instaapi)  
that instaapi is instants of a class that contains some HTTP client,string,…  
why hangfire converts each parameter to Jason ???

---

<div class="post-metadata">

**Author:** ![key\_one](https://avatars.discourse-cdn.com/v4/letter/k/6bbea6/32.png) [@key\_one](https://discuss.hangfire.io/u/key_one)\
**Post date:** [May 14, 2017, 3:09pm UTC](https://discuss.hangfire.io/t/why-hangfire-convert-each-parameter-to-json/3308/2 "2017-05-14T15:09:45Z")

</div>

I don’t want to convert to JSON I want to send that parameter as it is.

---

<div class="post-metadata">

**Author:** ![minuz](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/minuz/32/990_2.png) [@minuz](https://discuss.hangfire.io/u/minuz)\
**Post date:** [May 22, 2017, 5:04am UTC](https://discuss.hangfire.io/t/why-hangfire-convert-each-parameter-to-json/3308/3 "2017-05-22T05:04:20Z")

</div>

I’m just starting with HangFire, however my understanding is the following:  
You don’t need to send the parameters as Json.  
Under the hood, HangFire will convert the parameters to a JSON so it can be stored on the database or on the implemented Queue.

If you are reading the parameters for querying purpose, then you can use [Json.net](http://Json.net) to convert the JSON object to a dto based on your parameters to allow easier data manipulation.

Does this answer your question?

---

<div class="post-metadata">

**Author:** ![key\_one](https://avatars.discourse-cdn.com/v4/letter/k/6bbea6/32.png) [@key\_one](https://discuss.hangfire.io/u/key_one)\
**Post date:** [May 23, 2017, 6:04am UTC](https://discuss.hangfire.io/t/why-hangfire-convert-each-parameter-to-json/3308/4 "2017-05-23T06:04:30Z")

</div>

thanks for your answer, but my parameters is not serializable  
so I just save it in cache and just for now problem solved 🙂

---

<div class="post-metadata">

**Author:** ![dmartensson](https://avatars.discourse-cdn.com/v4/letter/d/e99b99/32.png) [@dmartensson](https://discuss.hangfire.io/u/dmartensson)\
**Post date:** [May 26, 2017, 10:18am UTC](https://discuss.hangfire.io/t/why-hangfire-convert-each-parameter-to-json/3308/5 "2017-05-26T10:18:16Z")

</div>

They have tobe serializable

Hangfire saves all jobs to the database and then jobservers retrieve the jobs.

So there is no possibility to use non serializable parameters.
