private string GetFirstColumnName(IStoragePropertyDefinition storagePropertyDefinition) { if (storagePropertyDefinition is FakeStoragePropertyDefinition) { return(((FakeStoragePropertyDefinition)storagePropertyDefinition).Name); } else if (storagePropertyDefinition is SimpleStoragePropertyDefinition) { return(((SimpleStoragePropertyDefinition)storagePropertyDefinition).ColumnDefinition.Name); } else if (storagePropertyDefinition is ObjectIDStoragePropertyDefinition) { return(GetFirstColumnName(((ObjectIDStoragePropertyDefinition)storagePropertyDefinition).ValueProperty)); } else if (storagePropertyDefinition is ObjectIDWithoutClassIDStoragePropertyDefinition) { return(GetFirstColumnName(((ObjectIDWithoutClassIDStoragePropertyDefinition)storagePropertyDefinition).ValueProperty)); } else if (storagePropertyDefinition is SerializedObjectIDStoragePropertyDefinition) { return(GetFirstColumnName(((SerializedObjectIDStoragePropertyDefinition)storagePropertyDefinition).SerializedIDProperty)); } else { throw new NotSupportedException(storagePropertyDefinition.GetType().Name + " is not supported."); } }
private SortedPropertySpecification CreateSortedPropertySpecification( ClassDefinition classDefinition, IStoragePropertyDefinition columnDefinition, SortOrder sortOrder) { var sortedPropertyDefinition = PropertyDefinitionObjectMother.CreateForFakePropertyInfo(classDefinition); sortedPropertyDefinition.SetStorageProperty(columnDefinition); return(new SortedPropertySpecification(sortedPropertyDefinition, sortOrder)); }
private PropertyDefinition CreatePersistentPropertyDefinition( ClassDefinition classDefinition, IStoragePropertyDefinition storagePropertyDefinition, IPropertyInformation propertyInformation) { var propertyDefinition = PropertyDefinitionObjectMother.CreateForPropertyInformation(classDefinition, StorageClass.Persistent, propertyInformation); propertyDefinition.SetStorageProperty(storagePropertyDefinition); return(propertyDefinition); }
private PropertyDefinition CreateNonPersistentPropertyDefinition(ClassDefinition classDefinition, string propertyName, IStoragePropertyDefinition storagePropertyDefinition) { var propertyDefinition = PropertyDefinitionObjectMother.CreateForFakePropertyInfo(classDefinition, propertyName, StorageClass.None); propertyDefinition.SetStorageProperty(storagePropertyDefinition); return(propertyDefinition); }
public void SetStorageProperty(IStoragePropertyDefinition storagePropertyDefinition) { ArgumentUtility.CheckNotNull("storagePropertyDefinition", storagePropertyDefinition); _storagePropertyDefinition = storagePropertyDefinition; }