Written by Irmak Tevfik on 29 - Oct - 2014

Quick written Dummy JSON/SQL Data Generator

Ok, I have written this project maximum in and hour time so if you find any glitches go ahead and fix it :) But DataGenerator should be better structured. Idea is simple, I decided to go through different Application Patterns on Azure ​so will be needing dummy data for ​Azure Table Storage, Documentdb etc...​ I could have used VS Data Generators or any online data generator ​but thought it will be more fun to create one quickly.
Anyway, to work with project, simply add a small portion of dummy Json Data ​under JsonData ​folder (I already included Forename, gender, surname etc..).  Included property will be parsed and displayed on ​CheckedListBox ​ to be selected. As an example, I got a Json file having GivenName as 


[ { "GivenName": "Aaron" }, { "GivenName": "Abby" }, { "GivenName": "Adam" }, ...

Which will be parsed and listed on Listbox as:


So does the rest of the Json Files. So, you have two different options for generating the data:
1- SQL Export with table name and option to include DROP/CREATE TABLE script and KEY of your choice (Guid,Int)
2- A simple JSON export

Just to let you guys know, all of the parse logic is under a class named DataGenerator ​which only has two static methods as 

public static IExportType GenerateSQLData(List<Dictionary<string, string>> selectedData, int amount, string tableName, bool includeDropCreate, bool includeGuid, bool includeInt)
{
    return new SQLDataGenerator(selectedData, tableName, amount, includeDropCreate, includeGuid, includeInt) as IExportType;
}
 
public static IExportType GenerateJsonData(List<Dictionary<string, string>> selectedData, int amount)
{
    return new JSONDataGenerator(selectedData, amount) as IExportType;
}

which will always return Interface. Anyway feel free to download and inspect the project from the Github link below. Meanwhile next topics will be about Azure Application Patterns ​on different scenarios.

DummyDataGenerator LINK

Enjoy Coding:) comments powered by Disqus