This is a console application written in .NET Core 2.1 that recieves a .json file containing entities and links between them. The app also recieves the ID of the entity that needs to be cloned. Cloning process also clones all the entities that are related to that node whether they are direct descdenents or indirect descdendents. The links are updated with new nodes and all the nodes that were pointing to original node also point to cloned node. All nodes are connected with other nodes in Parents and Children relation.
First step is to install .NET core, this is pretty easy to do, just follow the instructions. You'll know that the install worked if you can type this in your terminal and see a result:
dotnet --version
git clone https://github.com/brankosimic/WorkspanCloner.git
cd WorkspanCloner
Once you have cloned the repository, run the following command to "restore" the .NET dependencies listed in project.json
file in both projects:
dotnet restore
Once that is complete, run the tests which will also build the project:
dotnet test
To use the application with your .json file, run:
dotnet run --project WorkspanCloner /Users/branko/Desktop/2levelexample.json 5
Example of .json file:
{
"entities": [
{
"entity_id": 3,
"name": "EntityA"
},
{
"entity_id": 5,
"name": "EntityB"
},
{
"entity_id": 7,
"name": "EntityC",
"description": "More details about entity C"
},
{
"entity_id": 11,
"name": "EntityD"
}
],
"links": [
{
"from": 3,
"to": 5
},
{
"from": 3,
"to": 7
},
{
"from": 5,
"to": 7
},
{
"from": 7,
"to": 11
}
]
}