Walaa wrote:
Use GetFieldPersistenceInfo() without the 's' it accepts IEntityField2
protected virtual IFieldPersistenceInfo GetFieldPersistenceInfo(IEntityField2 field)
Used as follows.
IFieldPersistenceInfo fieldInfo = adapter.GetFieldPersistenceInfo(myEntityField);
var columnName = fieldInfo.SourceColumnName;
So you can loop on the entity.Fields, and for each Entity field, you'd have the entityField.Name property and the columnName as shown from the above code.
Walaa, thanks again for your reply.
As in my first post, I already found that the columnName is a property of IFieldPersistenceInfo.
(I get the tableName and a columnName from somewhere else...)
What I try to do, is to get the associated propertyName for it.
i.e.:
DBTableName: Person
DBColumnName: personId // These two is what i have...
mapped with Designer to:
EntityName: UserEntity // This name is what I can resolve...
**EntityField: Id // This is the one I'm looking for. ** (propertyName)
Using the GetFieldPersistenceInfoS I can get the all fields for an enity.
Filtering the resulting FieldPersistenceInfo[] on the SourceColumnName, I found the corresponding fieldInfo.
But unfortunatly, FieldPersistenceInfo doesn't contain the propertyName for the entity. That's what I'm looking for.
I also found that IFieldInfo does contain the propertyName, but I didn't find a way (possibly because I use Adapter instead of SelfService) to get the IFieldInfo from an entity, IFieldPersistenceInfo or 'someFactory'.