private static IEdmModel BuildValidModel(BoundedContextElementBuilder config) { var model = BuildModel(config); Assert.That(model, Is.Not.Null.And.Matches(ModelConstraints.IsValid)); return(model); }
public void Setup() { _config = NewContext("Library") .ConceptualModel(NewModel( NewEntity("Book") .Property(NewProperty("Title", ElementaryTypeKind.String)) .Property(NewProperty("Publisher", ElementaryTypeKind.String).Nullable()), NewEntity("Author") .Property(NewProperty("Name", ElementaryTypeKind.String)) .Relation(NewRelation("Books").DirectTo(NewEntity("Book")).AsMany()))) .StoreModel(NewModel( NewEntity("Catalog.Author") .Property(NewProperty("Name", ElementaryTypeKind.String)), NewEntity("Catalog.Book") .Property(NewProperty("Title", ElementaryTypeKind.String)) .Property(NewProperty("Publisher", ElementaryTypeKind.String).Nullable()) .Relation(NewRelation("AuthorId").DirectTo(NewEntity("Catalog.Author")).AsOne()))) .Map("Author", "Catalog.Author") .Map("Book", "Catalog.Book"); }
private static IEdmModel BuildValidModel(BoundedContextElementBuilder config) { var model = BuildModel(config); Assert.That(model, Is.Not.Null.And.Matches(ModelConstraints.IsValid)); return model; }