Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,116 changes: 558 additions & 558 deletions csharp/runner/SnippetRunner/Program.cs

Large diffs are not rendered by default.

488 changes: 244 additions & 244 deletions csharp/snippets/deleting/DeleteViaFutures/Program.cs

Large diffs are not rendered by default.

106 changes: 53 additions & 53 deletions csharp/snippets/loading/LoadRecords/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
// get the senzing repository settings
string? settings = Environment.GetEnvironmentVariable("SENZING_ENGINE_CONFIGURATION_JSON");
if (settings == null)
{
Console.Error.WriteLine("Unable to get settings.");
{
Console.Error.WriteLine("Unable to get settings.");
throw new ArgumentException("Unable to get settings");
}

Expand All @@ -27,44 +27,44 @@
.Build();

try
{
// get the engine from the environment
SzEngine engine = env.GetEngine();

// loop through the example records and add them to the repository
foreach (KeyValuePair<(string, string), string> pair in GetRecords())
{
(string dataSourceCode, string recordID) = pair.Key;
string recordDefinition = pair.Value;

// call the addRecord() function with no flags
engine.AddRecord(dataSourceCode, recordID, recordDefinition, SzNoFlags);

Console.WriteLine("Record " + recordID + " added");
Console.Out.Flush();
{
// get the engine from the environment
SzEngine engine = env.GetEngine();
// loop through the example records and add them to the repository
foreach (KeyValuePair<(string, string), string> pair in GetRecords())
{
(string dataSourceCode, string recordID) = pair.Key;
string recordDefinition = pair.Value;
// call the addRecord() function with no flags
engine.AddRecord(dataSourceCode, recordID, recordDefinition, SzNoFlags);
Console.WriteLine("Record " + recordID + " added");
Console.Out.Flush();
}

}
catch (SzException e)
{
// handle any exception that may have occurred
Console.Error.WriteLine("Senzing Error Message : " + e.Message);
Console.Error.WriteLine("Senzing Error Code : " + e.ErrorCode);
Console.Error.WriteLine(e);
{
// handle any exception that may have occurred
Console.Error.WriteLine("Senzing Error Message : " + e.Message);
Console.Error.WriteLine("Senzing Error Code : " + e.ErrorCode);
Console.Error.WriteLine(e);
throw;

}
catch (Exception e)
{
Console.Error.WriteLine();
Console.Error.WriteLine("*** Terminated due to critical error ***");
Console.Error.WriteLine(e);
Console.Error.Flush();
{
Console.Error.WriteLine();
Console.Error.WriteLine("*** Terminated due to critical error ***");
Console.Error.WriteLine(e);
Console.Error.Flush();
throw;
}
finally
{
// IMPORTANT: make sure to destroy the environment
{
// IMPORTANT: make sure to destroy the environment
env.Destroy();
}

Expand All @@ -77,12 +77,12 @@
/// to <c>string</c> JSON text values describing the records to be added.
/// </returns>
static IDictionary<(string, string), string> GetRecords()
{
IDictionary<(string, string), string> records
= new SortedDictionary<(string, string), string>();

records.Add(
("TEST", "1001"),
{
IDictionary<(string, string), string> records
= new SortedDictionary<(string, string), string>();
records.Add(
("TEST", "1001"),
"""
{
"DATA_SOURCE": "TEST",
Expand All @@ -97,10 +97,10 @@
"PHONE_NUMBER": "702-919-1300",
"EMAIL_ADDRESS": "[email protected]"
}
""");

records.Add(
("TEST", "1002"),
""");
records.Add(
("TEST", "1002"),
"""
{
"DATA_SOURCE": "TEST",
Expand All @@ -118,10 +118,10 @@
"PHONE_TYPE": "MOBILE",
"PHONE_NUMBER": "702-919-1300"
}
""");

records.Add(
("TEST", "1003"),
""");
records.Add(
("TEST", "1003"),
"""
{
"DATA_SOURCE": "TEST",
Expand All @@ -133,10 +133,10 @@
"DATE_OF_BIRTH": "12/11/1978",
"EMAIL_ADDRESS": "[email protected]"
}
""");

records.Add(
("TEST", "1004"),
""");
records.Add(
("TEST", "1004"),
"""
{
"DATA_SOURCE": "TEST",
Expand All @@ -151,10 +151,10 @@
"ADDR_POSTAL_CODE": "89132",
"EMAIL_ADDRESS": "[email protected]"
}
""");

records.Add(
("TEST", "1005"),
""");
records.Add(
("TEST", "1005"),
"""
{
"DATA_SOURCE": "TEST",
Expand All @@ -171,7 +171,7 @@
"ADDR_STATE": "NV",
"ADDR_POSTAL_CODE": "89132"
}
""");

""");
return records;
}
Loading
Loading