1
vote
0answers
59 views

JObject Pattern Matching: Merging partial WEB API JSON payload

This library [GitHub] helps merging partial WEB API JSON payload with existing prepopulated DTO objects. Let's say that JSON is represented by JObject from JSON.NET package. Naïve implementation ...
1
vote
3answers
126 views

Post method exceptions with “if else” statments optimization and json object improvemnt

I would like to know how to know how can I optimize my current Post method , I initialize object where I am creating list of json items. Also how can I reduce many if and if else statments? For this ...
2
votes
2answers
280 views

Processing lots of JSON objects

I want to process a ton of JSON objects as quickly as possible. I've done my best to make the processing as concise and efficient as I can. How can I make it more efficient? ...
6
votes
2answers
132 views

Sending a Torrent magnet link using the Deluge JSON API

I have built this script that sends a magnet link to the client. As I never ever had any proper programming lessons I would want to ask you if this approach is good, if I am missing something, There ...
3
votes
0answers
65 views

Passing a complex object across cross domain

I am working with two web applications, one is webform-based Site1 and other is an MVC application Site2. TODO: Pass a complex object from Site1 to Site2. In response get View from Site2 to Site1 ...
6
votes
3answers
656 views

Simple Product Inventory software using C# and OOP

I did this small program, as part of a list of coding exercises. The list proposes the coding of a small software that's supposed to manage an inventory of products. Here's what is requested: ...
3
votes
1answer
68 views

Managing Httpcache from C# using JSON configuration

I have written an efficient way to control data to be cached/not-cached in HttpCache using JSON and C# controlling it. The reason for this implementation is to make use of existing application ...
4
votes
3answers
705 views

Generic WebRequest Method

I created this method to do all my WebRequests. Generally my question is if it can be improved in any way. As a side question, would it be better to create requests for each type (PUT, POST, GET, ...
3
votes
1answer
733 views

Wrapper for a transfer transaction API

I'm looking for any kind of advice, like when or where to do exception handling, the overall library structure/layout, usage of classes/partial classes, code efficiency, naming conventions, and so on ...
2
votes
2answers
74 views

Generated serialization code

CGbR project I am currently working on a project that generates code from classes. The idea is to achieve maximum performance by replacing reflection use cases with fast, generated code. Current ...
1
vote
1answer
259 views

Telegram - GetUpdates Process

My code fetches telegrams from a server periodically in the background. The server API is documented here. What do you think of the way I do multithreading by handling my ...
5
votes
1answer
325 views

Serializing (and deserializing) basic mesh using JSON.net

In order to improve my c# (which is fairly basic at best) I decided to try to serialize a simple mesh to a file using the JSON.net library. Simple mesh in this case means an array of vertices and a ...
3
votes
1answer
87 views

Excel-to-JSON parser 2

After first code review I have fixed the found issues. Could you please review my new refactored application? Main class (entry point) ...
1
vote
1answer
1k views

Excel-to-JSON parser

I just wanted to build a simple converter from an XLS Excel file to JSON. I have predefined JSON format. All fields except of two - are just simple mapping from Excel to JSON. The two fields have a ...
3
votes
1answer
325 views

Newtonsoft Json helper class

I've written the following helper class to help serializing objects to and from Json. I would appreciate some feed back on the style of the class. ...
6
votes
1answer
248 views

C# Regex to extract bug ID from Bugzilla JSON response

I have written a series of Regex.Replace() lines to take an input like {"id":36} and convert it to ...
1
vote
0answers
387 views

Create JSON object from self-nested LINQ query

I created this function to created nested JSON object using a Linq query. How can I optimize this and make it more readable? ...
9
votes
2answers
657 views

JSON parser in C#

I've writen a C# JSON parser, but its performance is not as good as JSON.NET. Running the same test, my parser takes 278 ms and JSON.NET takes 24 ms. What should I do to optimize it? It seems that ...
2
votes
1answer
421 views

JSON serialization helper class

I wrote this class to one-line all my JSON serialization, and I'm curious of any input on it. It's only responsible for serializing/deserializing any type to/from JSON. The comments and code are ...
1
vote
1answer
3k views

Converting table data into nested JSON

I'm new to C# (coming from a JavaScript background) and it seems like this code could be greatly improved. This SQL query: ...
4
votes
1answer
369 views

Daily Desktop Background

I've created a simple command-line program that downloads the Bing Image of the Day, then sets it as my desktop background. It is a console application, and closes immediately after setting my ...
7
votes
1answer
1k views

JSON serializer using generics rather than System.Object

I recently created a custom static class in C# to encode, hopefully, any object it is given (or collection of objects), because I was, at the time, unaware of a native C# library that did the same ...
1
vote
2answers
3k views

Reading data from database, saving to new list and adding list to grid

I made some changes to how I was saving the data in order for it to show up on a kendo grid. Right now my giant method is getting data from the database (using ...
4
votes
2answers
123 views

Return existing values inside database

Here's a method inside my controller that reads the values of angle and point data from my database. Then it grabs the data and adds it to a new list and sends the JSON to the view. I can't simplify ...
2
votes
1answer
484 views

Web API controller to get details of a travel plan or a leave request

My web API has 3 controllers for get, post and users CRUD. I named it as DetailsControllor, FormControllor and ...
8
votes
2answers
2k views

Reference implementation of HTML-to-JSON converter for PCG

I have opened a puzzle at Programming Puzzles and Code Golf. The question is not perceived well (yet) and one of the reasons is that no reference implementation is provided. To mitigate this ...
3
votes
3answers
1k views

WorkGroup Data Service with JSON / Web based API

I'm wondering if this code can be made more clear and fluent: ...
2
votes
2answers
3k views

Interacting with database in MVC

When using MVC 4 Razor (I am new to web development), I get concerned about my understanding of interactions between the database and the client. Much like all appilications these days, there is a lot ...
3
votes
2answers
1k views

HttpRequest.Json collection - like HttpRequest.Form

I'm looking for a code correctness and best practices review on the following. I created the following in order to prevent using the same code to convert serialized JSON to something more accessible ...
4
votes
2answers
174 views

IsoStorageManager

A manager for a speedy async saving objects to isolated storage, using serialization from Newtonsoft.Json. A project to play with is here. ...
2
votes
2answers
877 views

Is there a proper way to query ExpandoObject?

I am receiving the JSON from WebService and populating ExpandoObject from this one: ...
3
votes
3answers
455 views

Simplifying a web service method

I have the following method in a web service class. I'm a little unhappy about the big block of new JProperty(...) calls in the for loop. Is there a way to ...
6
votes
1answer
10k views

Concerned with Enums, JSON, and ASP.NET MVC

I am writing an application that uses ASP.NET MVC for its front end, and for the back end, it uses RavenDB to store data. This ...
12
votes
2answers
289 views

Setting up keyboard bindings using JSON (no reflection!)

I got a lot of good feedback on my other question. So I will take another swing at it, post my revisions, and hopefully get some more. First, the configuration hasn't changed. Here's the JSON file: <...
5
votes
1answer
137 views

Setting up keyboard bindings using JSON and reflection

My game uses configuration files in JSON format. One of them is used for setting up control bindings, and it looks like this: ...
8
votes
1answer
1k views

Loop through JSON and create prefab in Unity3D

I am creating an app in Unity3D and it is my first time coding in C#. I use the following code to parse a JSON file hosted on my server and use the information to render prefabs within my scene: <...
8
votes
1answer
149 views

“Game” Engine Requirements System

I am/have been building a game for a long time now. The game is a web browser based system, and data is stored using JSON stored in ...
15
votes
2answers
891 views

Gotta catch 'em all!

This week's challenge is essentially about fetching Json data from the Web, and deserializing it into objects. I don't have much time to devote to this one, so what I have is very basic: it displays ...
2
votes
1answer
144 views

A C# class to check if one JSON tree (de-serialised as ExpandoObject / Array etc) contains another

I wrote this partly as a learning exercise in TDD. Could I please have feedback on both how to improve the quality of the code and the completeness of the tests? I used LinqPad as my IDE for this, ...
1
vote
3answers
5k views

Converting a c# enum into a list to be sent to the client

I want to use the enum on the client for a dropdown list. Does this make sense, or is there a smarter way of doing this? ...
10
votes
2answers
1k views

NewtonSoft Json.Net serialiser

I'm just starting to develop more in C# after being mainly a VB.NET developer and was looking for someone to critique my implementation of a NewtonSoft Json.Net serialiser. Can you provide some ...
4
votes
1answer
3k views

Convert XSD to JSONSchema

This code is still very naive. I am trying to convert an existing XSD to JSONSchema. Firstly, pardon the variable names (I know some are really just stupid but I will fix them once I get all the ...
3
votes
2answers
2k views

Passing HTML back inside a JSON object

I'm working on a piece of code in my MVC3 application and I'm struggling to decide if what I plan to do is a bad idea or not. I have a snippet of JavaScript that calls an MVC action that in turn ...
12
votes
1answer
64k views

Making a simple call to a server

Earlier this year, before I learnt about Code Review Stack Exchange, I gave this answer in response to a question about how to combine ASP.NET, jQuery, and JSON: I keep thinking that there must be a ...
3
votes
3answers
508 views

Getting contact information

How can I improve this code? ...