public static void CompareSchema(CremaDataType type1, CremaDataType type2) { try { Assert.AreEqual(type1.GetXmlSchema(), type2.GetXmlSchema(), "Schema"); } catch { File.WriteAllText(Path.Combine(Directory.GetCurrentDirectory(), type1.TypeName + "1" + CremaSchema.SchemaExtension), type1.GetXmlSchema()); File.WriteAllText(Path.Combine(Directory.GetCurrentDirectory(), type2.TypeName + "2" + CremaSchema.SchemaExtension), type2.GetXmlSchema()); throw; } }
public void InvokeTypeCreate(Authentication authentication, string typeName, string categoryPath, CremaDataType dataType) { this.CremaHost.DebugMethod(authentication, this, nameof(InvokeTypeCreate), typeName, categoryPath); var schemaPath = this.Context.GenerateTypePath(categoryPath, typeName); try { this.Repository.Add(schemaPath, dataType.GetXmlSchema()); this.Context.InvokeTypeItemCreate(authentication, categoryPath + typeName); } catch (Exception e) { this.CremaHost.Error(e); this.Repository.Revert(); throw e; } }