static BatchSchemaProvider()
        {
            string json = BatchSchemaProvider.GetEmbeddedResource(@"Batch\HybridRowBatchSchemas.json");

            BatchSchemaProvider.BatchSchemaNamespace = Namespace.Parse(json);
            BatchSchemaProvider.BatchLayoutResolver  = new LayoutResolverNamespace(BatchSchemaProvider.BatchSchemaNamespace);

            BatchSchemaProvider.BatchOperationLayout = BatchSchemaProvider.BatchLayoutResolver.Resolve(BatchSchemaProvider.BatchSchemaNamespace.Schemas.Find(x => x.Name == "BatchOperation").SchemaId);
            BatchSchemaProvider.BatchResultLayout    = BatchSchemaProvider.BatchLayoutResolver.Resolve(BatchSchemaProvider.BatchSchemaNamespace.Schemas.Find(x => x.Name == "BatchResult").SchemaId);
        }
        private static string GetEmbeddedResource(string resourceName)
        {
            Assembly assembly = Assembly.GetAssembly(typeof(BatchSchemaProvider));

            // Assumes BatchSchemaProvider is in the default namespace of the assembly.
            resourceName = BatchSchemaProvider.FormatResourceName(typeof(BatchSchemaProvider).Namespace, resourceName);

            using (Stream resourceStream = assembly.GetManifestResourceStream(resourceName))
            {
                if (resourceStream == null)
                {
                    return(null);
                }

                using (StreamReader reader = new StreamReader(resourceStream))
                {
                    return(reader.ReadToEnd());
                }
            }
        }