private static async Task WriteResultsWithClasses(Dataset dataset) { Console.WriteLine(); Console.WriteLine("Anonimized documents (joined with equlivalence classes)"); var anonimizationApi = RestService.For <IAnonimizationApi>("http://localhost:9137/v1"); var service = new AnonimizationService(anonimizationApi); var result = await service.GetAnonimDocumentsWithClasses(dataset); foreach (var(equlivalenceClass, document) in result) { Console.WriteLine(equlivalenceClass + " " + document.ToMyString()); } }
private static async Task WriteResults(Dataset dataset) { Console.WriteLine(); Console.WriteLine("Anonimized documents (as stored in DB)"); var anonimizationApi = RestService.For <IAnonimizationApi>("http://localhost:9137/v1"); var service = new AnonimizationService(anonimizationApi); var result = await service.GetAnonimDocumentsWithClassIds(dataset); foreach (var document in result) { Console.WriteLine(document.ToMyString()); } }
private static async Task AnonimizeDocument(Dataset dataset, int i) { var anonimizationApi = RestService.For <IAnonimizationApi>("http://localhost:9137/v1"); var service = new AnonimizationService(anonimizationApi); var document = new Document { Id = i.ToString(), PublicFields = new Dictionary <string, object> { { "city", "Budapest" }, { "age", 20.0 }, }, PrivateFields = new Dictionary <string, object> { { "private", "secret" + i } } }; await service.AnonimizeDocument(dataset.Name, document); }