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); }
private PropertyDefinition CreatePersistentPropertyDefinition( ClassDefinition classDefinition, IStoragePropertyDefinition storagePropertyDefinition, IPropertyInformation propertyInformation) { var propertyDefinition = PropertyDefinitionObjectMother.CreateForPropertyInformation(classDefinition, StorageClass.Persistent, propertyInformation); propertyDefinition.SetStorageProperty(storagePropertyDefinition); return(propertyDefinition); }
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); }