Suoranta.EnterpriseLib.Web - Developer API

EntityResolverUtils..::..GetTargetEntityIdPropInDTO Method

Gets the DTO property that contains id of the secondary (resolved) entity.

Namespace:  Suoranta.EnterpriseLib.Util.AutoMapper
Assembly:  Suoranta.EnterpriseLib.Web (in Suoranta.EnterpriseLib.Web.dll)

Syntax


public static PropertyInfo GetTargetEntityIdPropInDTO(
	Type entityDtoType,
	PropertyInfo destinationPropInfo
)

Parameters

entityDtoType
Type: Type
Type of the DTO.
destinationPropInfo
Type: PropertyInfo
PropertyInfo of entity type's property whose value will be resolved.

Return Value

DTO property that contains id of the secondary entity that resolver will return.

Remarks


It is assumed that entityDtoType has property of entity id type whose name matches property of the resolved entity type of primary entity. I.e. primary entity type could be "Address" and resolved entity type could be "City". In this scenario:
    The type Address should have property City of type City.The type AddressDTO should have property CityId or City of type int.The resolver will resolve AddressDTO.City to Address.City by id comparison.