in dotnet/linux/App/Program.cs [83:114]
public record Product(
string id,
string categoryId,
string categoryName,
string name,
int quantity,
bool sale
);
private static CosmosClient CreateClient(string endpoint, string key)
{
return new CosmosClient(endpoint, key, new CosmosClientOptions
{
SerializerOptions = new CosmosSerializationOptions
{
PropertyNamingPolicy = CosmosPropertyNamingPolicy.CamelCase
},
HttpClientFactory = () =>
{
/* *** WARNING ***
* This code is for demo purposes only. In production, you should use the default behavior,
* which relies on the operating system's certificate store to validate the certificates.
*/
HttpMessageHandler httpMessageHandler = new HttpClientHandler
{
ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator
};
return new HttpClient(httpMessageHandler);
},
ConnectionMode = ConnectionMode.Direct
});
}