public void WhenPropertyUsedAsComposedIdThenRegister() { var inspector = new ExplicitlyDeclaredModel(); var mapper = new ModelMapper(inspector); mapper.Class<MyClass>(map => map.ComposedId(cm=> { cm.Property(x => x.Code); cm.ManyToOne(x => x.Relation); }) ); inspector.IsMemberOfComposedId(For<MyClass>.Property(x => x.Code)).Should().Be.True(); inspector.IsMemberOfComposedId(For<MyClass>.Property(x => x.Relation)).Should().Be.True(); inspector.IsPersistentProperty(For<MyClass>.Property(x => x.Code)).Should().Be.True(); inspector.IsPersistentProperty(For<MyClass>.Property(x => x.Relation)).Should().Be.True(); inspector.IsPersistentId(For<MyClass>.Property(x => x.Code)).Should().Be.False(); inspector.IsPersistentId(For<MyClass>.Property(x => x.Relation)).Should().Be.False(); }
bool IModelInspector.IsMemberOfComposedId(MemberInfo member) { return(declaredModel.IsMemberOfComposedId(member)); }