private static EdmModelCsdlSchemaWriter CreateEdmModelCsdlSchemaWriter(out XmlWriter xmlWriter, out MemoryStream memoryStream)
 {
     memoryStream = new MemoryStream();
     IEdmModel model = new EdmModel();
     model.SetEdmxVersion(new Version(4, 0));
     var namespaceAliasMappings = model.GetNamespaceAliases();
     Version edmxVersion = model.GetEdmxVersion();
     xmlWriter = XmlWriter.Create(memoryStream);
     return new EdmModelCsdlSchemaWriter(model, namespaceAliasMappings, xmlWriter, edmxVersion);
 }