<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Shephertz Community - Recent questions in C#</title>
<link>http://forum.shephertz.com/?qa=questions/products/app42-cloud-api-baas/c%23</link>
<description>Powered by Question2Answer</description>
<item>
<title>How to format a collection in json and save using the storage service</title>
<link>http://forum.shephertz.com/?qa=11484/how-format-collection-json-and-save-using-the-storage-service</link>
<description>&lt;p&gt;
	Using .net to build a server and save data from the server to App42, that clients will then retreive in unity3d.&lt;br&gt;
	&lt;br&gt;
	I pull data from other API with the server ( financial data in that case ), that i put in a collection, and then try to save that on App42.&lt;br&gt;
	When i Serialize the collection via newtonsoft.json in C#, i get the followiing json :&lt;br&gt;
	&lt;br&gt;
	[{&quot;id&quot;:1,&quot;name&quot;:&quot;Bitcoin&quot;,&quot;symbol&quot;:&quot;BTC&quot;,&quot;slug&quot;:&quot;bitcoin&quot;,&quot;circulating_supply&quot;:&quot;17817825&quot;,&quot;total_supply&quot;:&quot;17817825&quot;,&quot;max_supply&quot;:&quot;21000000&quot;,&quot;date_added&quot;:&quot;2013-04-28T00:00:00Z&quot;,&quot;cmc_rank&quot;:1,&quot;price_usd&quot;:10671.0584356,&quot;price_btc&quot;:1.0,&quot;volume_24h&quot;:23185304866.5182,&quot;percent_change_1h&quot;:1.57316,&quot;percent_change_24h&quot;:-3.85315,&quot;percent_change_7d&quot;:-6.54577,&quot;market_cap&quot;:190135051770.29456,&quot;last_updated&quot;:&quot;2019-07-14T21:13:30Z&quot;},{&quot;id&quot;:1027,&quot;name&quot;:&quot;Ethereum&quot;,&quot;symbol&quot;:&quot;ETH&quot;,&quot;slug&quot;:&quot;ethereum&quot;,&quot;circulating_supply&quot;:&quot;106899675.5615&quot;,&quot;total_supply&quot;:&quot;106899675.5615&quot;,&quot;max_supply&quot;:null,&quot;date_added&quot;:&quot;2015-08-07T00:00:00Z&quot;,&quot;cmc_rank&quot;:2,&quot;price_usd&quot;:238.58230671,&quot;price_btc&quot;:0.022357885878879574,&quot;volume_24h&quot;:8582925524.28892,&quot;percent_change_1h&quot;:1.12083,&quot;percent_change_24h&quot;:-10.1693,&quot;percent_change_7d&quot;:-21.368,&quot;market_cap&quot;:25504371182.013287,&quot;last_updated&quot;:&quot;2019-07-14T21:13:19Z&quot;}]&lt;br&gt;
	&lt;br&gt;
	Which gives the following error when tryign to save that document :&lt;br&gt;
	com.shephertz.app42.paas.sdk.csharp.App42BadParameterException: {&quot;app42Fault&quot;:{&quot;httpErrorCode&quot;:400,&quot;appErrorCode&quot;:2605,&quot;message&quot;:&quot;Bad Request&quot;,&quot;details&quot;:&quot;Passed JSON string is not valid.&quot;}}&lt;br&gt;
	&amp;nbsp;&amp;nbsp; at com.shephertz.app42.paas.sdk.csharp.connection.RESTConnectorAsync.ExecutePost(String url, Dictionary`2 paramsDics, String bodyPayLoad, Dictionary`2 headerParams)&lt;br&gt;
	&amp;nbsp;&amp;nbsp; at com.shephertz.app42.paas.sdk.csharp.storage.StorageService.InsertJSONDocument(String dbName, String collectionName, String json)&lt;br&gt;
	&amp;nbsp;&amp;nbsp; at com.shephertz.app42.paas.sdk.csharp.storage.StorageService.&amp;lt;InsertJSONDocument&amp;gt;c__AnonStorey0.&amp;lt;&amp;gt;m__0()&lt;br&gt;
	&lt;br&gt;
	I am not sure how to serialize that collection in order for it to be &quot;valid&quot; ?&lt;br&gt;
	&lt;br&gt;
	This is how i convert the collection ( using newtonsoft.Json )&lt;br&gt;
	string json = JsonConvert.SerializeObject(list_coin);&lt;br&gt;
	&lt;span&gt;Storage&amp;nbsp;storage&amp;nbsp;=&amp;nbsp;storageService.InsertJSONDocument(dbName,collectionName,json);&amp;nbsp;&lt;br&gt;
	&lt;br&gt;
	Any help would be greatly appreciated, as i am planning to use jsons a lot and wish for an easy converter to be used.&lt;/span&gt;&lt;br&gt;
	&lt;br&gt;
	&amp;nbsp;&lt;/p&gt;</description>
<category>C#</category>
<guid isPermaLink="true">http://forum.shephertz.com/?qa=11484/how-format-collection-json-and-save-using-the-storage-service</guid>
<pubDate>Sun, 14 Jul 2019 21:20:09 +0000</pubDate>
</item>
<item>
<title>Effective way to edit all user's scores</title>
<link>http://forum.shephertz.com/?qa=10439/effective-way-to-edit-all-users-scores</link>
<description>&lt;p&gt;
	&lt;span style=&quot;color: rgb(51, 51, 51); font-family: Helvetica, Arial, Sens-serif; background-color: rgb(250, 250, 250);&quot;&gt;You mentioned that the scoreBoardService.EditScoreValueById() can be used to reset user's score on leaderboard.&lt;/span&gt;&lt;br style=&quot;color: rgb(51, 51, 51); font-family: Helvetica, Arial, Sens-serif; background-color: rgb(250, 250, 250);&quot;&gt;
	&lt;br style=&quot;color: rgb(51, 51, 51); font-family: Helvetica, Arial, Sens-serif; background-color: rgb(250, 250, 250);&quot;&gt;
	&lt;span style=&quot;color: rgb(51, 51, 51); font-family: Helvetica, Arial, Sens-serif; background-color: rgb(250, 250, 250);&quot;&gt;But this method can only update one user's score, not all users. I think it's impossible to call this method 10000 times if there are 10000 user scores in the score board.&lt;/span&gt;&lt;br style=&quot;color: rgb(51, 51, 51); font-family: Helvetica, Arial, Sens-serif; background-color: rgb(250, 250, 250);&quot;&gt;
	&lt;span style=&quot;color: rgb(51, 51, 51); font-family: Helvetica, Arial, Sens-serif; background-color: rgb(250, 250, 250);&quot;&gt;Is there an API that can edit users' score all at once?&lt;/span&gt;&lt;/p&gt;</description>
<category>C#</category>
<guid isPermaLink="true">http://forum.shephertz.com/?qa=10439/effective-way-to-edit-all-users-scores</guid>
<pubDate>Sun, 23 Apr 2017 23:34:54 +0000</pubDate>
</item>
<item>
<title>Best approach for resetting daily leaderboard</title>
<link>http://forum.shephertz.com/?qa=10426/best-approach-for-resetting-daily-leaderboard</link>
<description>Hi,

I have a daily leaderboard in my game and it needs to be reset every day. So what's the best approch for doing it?

1. Delete all user scores or set all user scores to -1. I couldn't find API for deleting all scores or setting all scores to a specific number.

2. Delete the entire game and recreate a new game. I can do it in the dashboard but I couldn't find the API for doing it programmtically.</description>
<category>C#</category>
<guid isPermaLink="true">http://forum.shephertz.com/?qa=10426/best-approach-for-resetting-daily-leaderboard</guid>
<pubDate>Wed, 19 Apr 2017 12:48:01 +0000</pubDate>
</item>
<item>
<title>Error while calling the &quot;Store Device Token&quot; in Push Notification Service</title>
<link>http://forum.shephertz.com/?qa=10228/error-while-calling-store-device-token-notification-service</link>
<description>&lt;p&gt;
	&lt;img alt=&quot;&quot; src=&quot;http://forum.shephertz.com/?qa=blob&amp;amp;qa_blobid=5227564235972780190&quot; style=&quot;width: 1000px; height: 140px;&quot;&gt;&lt;/p&gt;
&lt;p&gt;
	We got an Error like :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	An exception of type 'System.FormatException' occurred in mscorlib.dll but was not handled in user code&lt;/p&gt;
&lt;div&gt;
	Additional information: String was not recognized as a valid Boolean.&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	Please help.&lt;/div&gt;</description>
<category>C#</category>
<guid isPermaLink="true">http://forum.shephertz.com/?qa=10228/error-while-calling-store-device-token-notification-service</guid>
<pubDate>Wed, 22 Feb 2017 06:59:20 +0000</pubDate>
</item>
</channel>
</rss>