本文整理汇总了C#中Marten.Schema.DocumentMapping.CreateSchemaDiff方法的典型用法代码示例。如果您正苦于以下问题:C# DocumentMapping.CreateSchemaDiff方法的具体用法?C# DocumentMapping.CreateSchemaDiff怎么用?C# DocumentMapping.CreateSchemaDiff使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Marten.Schema.DocumentMapping
的用法示例。
在下文中一共展示了DocumentMapping.CreateSchemaDiff方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: when_doing_a_schema_diff_with_no_changes_95_style
public when_doing_a_schema_diff_with_no_changes_95_style()
{
var store1 = TestingDocumentStore.For(_ =>
{
_.UpsertType = PostgresUpsertType.Standard;
_.DatabaseSchemaName = Marten.StoreOptions.DefaultDatabaseSchemaName;
_.Schema.For<User>().Searchable(x => x.UserName).Searchable(x => x.Internal);
});
store1.Schema.EnsureStorageExists(typeof(User));
// Don't use TestingDocumentStore because it cleans everything upfront.
store2 = DocumentStore.For(_ =>
{
_.UpsertType = PostgresUpsertType.Standard;
_.Connection(ConnectionSource.ConnectionString);
_.DatabaseSchemaName = Marten.StoreOptions.DefaultDatabaseSchemaName;
_.Schema.For<User>().Searchable(x => x.UserName).Searchable(x => x.Internal);
});
mapping = store2.Schema.MappingFor(typeof(User)).As<DocumentMapping>();
diff = mapping.CreateSchemaDiff(store2.Schema);
}