public static PropertyDefinition CreateAndAddPropertyDefinition(ClassDefinition classDefinition, string propertyName, IPropertyInformation propertyInformation)
        {
            var propertyDefinition = PropertyDefinitionObjectMother.CreateForPropertyInformation(classDefinition, propertyName, propertyInformation);

            classDefinition.SetPropertyDefinitions(new PropertyDefinitionCollection(new[] { propertyDefinition }, true));
            return(propertyDefinition);
        }
Exemplo n.º 2
0
        private PropertyDefinition CreatePersistentPropertyDefinition(
            ClassDefinition classDefinition, IStoragePropertyDefinition storagePropertyDefinition, IPropertyInformation propertyInformation)
        {
            var propertyDefinition = PropertyDefinitionObjectMother.CreateForPropertyInformation(classDefinition, StorageClass.Persistent, propertyInformation);

            propertyDefinition.SetStorageProperty(storagePropertyDefinition);
            return(propertyDefinition);
        }
Exemplo n.º 3
0
        private PropertyDefinition CreatePropertyWithStubbedStorageProperty(
            ClassDefinition classDefinition, IRdbmsStoragePropertyDefinition storagePropertyDefinition, string propertyName, IPropertyInformation propertyInfo)
        {
            PropertyDefinition propertyDefinition = PropertyDefinitionObjectMother.CreateForPropertyInformation(classDefinition, propertyName, propertyInfo);

            _persistenceModelProviderStub
            .Stub(stub => stub.GetStoragePropertyDefinition(propertyDefinition))
            .Return(storagePropertyDefinition);
            return(propertyDefinition);
        }