Skip to content

Instantly share code, notes, and snippets.

@AbhinavPradeep
Created December 20, 2019 05:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AbhinavPradeep/ddfc9ec015ea2d753985a6daaa13f708 to your computer and use it in GitHub Desktop.
Save AbhinavPradeep/ddfc9ec015ea2d753985a6daaa13f708 to your computer and use it in GitHub Desktop.
static void Main(string[] args)
{
IMongoCollection<Person> collection = InitializeDatabase();
if (args[0] == "Add")
{
AddCustomer(collection);
}
else if (args[0] == "List")
{
string customerid = args[1];
Int32.TryParse(customerid, out int id);
FindCustomer(collection, id);
}
else if (args[0] == "Delete")
{
string customerid = args[1];
Int32.TryParse(customerid, out int id);
DeleteCustomer(collection, id);
}
else if (args[0] == "Update")
{
string customerid = args[1];
Int32.TryParse(customerid, out int id);
string field = args[2];
string renamed = args[3];
UpdateRename(collection,id,field,renamed);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment