public ActionResult <HealthcareBC.Fabric.ContractTransaction> DeployProfile([FromBody] HealthcareBC.Fabric.Profile citizenProfile) { // TODO (Once functional) declare these in UI or in service citizenProfile.Description = @"Description for citizen profile " + citizenProfile.CitizenIdentifier; citizenProfile.StateApprover = " "; var transaction = _appService.CreateCitizenProfile(citizenProfile).Result; return(transaction); }
async public Task <HealthcareBC.Fabric.ContractTransaction> CreateCitizenProfile(HealthcareBC.Fabric.Profile citizenProfile) { var FabricEndpoint = ServiceEndPointResolver.GetServiceEndPoint(ServiceEndpoints.fabricEndPoint, null); FabricProxy FabricProxy = new FabricProxy(FabricEndpoint, new HttpClient() { Timeout = new TimeSpan(0, 30, 0) }); //TODO : Add the Encryption after the Demo / Decrypting the results / Add the decryption to Lists //Encrypt basicProfile information //var encrypter = new Cryptolib(""); //citizenProfile.BasicProfile.Name = encrypter.EncryptString(citizenProfile.BasicProfile.Name).Result; //citizenProfile.BasicProfile.Address.Street = encrypter.EncryptString(citizenProfile.BasicProfile.Address.Street).Result; //citizenProfile.BasicProfile.Address.City = encrypter.EncryptString(citizenProfile.BasicProfile.Address.City).Result; var transaction = await FabricProxy.CreateProfileAsync(citizenProfile); //Indexing Service await LogTransaction(transaction, "Citizen Profile was created"); return(transaction); }