Beispiel #1
0
 private static string GetPropertyNameFromEpmInfo(EntityPropertyMappingInfo epmInfo)
 {
     if (epmInfo.Attribute.TargetSyndicationItem == SyndicationItemProperty.CustomProperty)
     {
         return(epmInfo.Attribute.TargetPath);
     }
     if (!epmInfo.IsEFProvider)
     {
         return(epmInfo.Attribute.TargetSyndicationItem.ToString());
     }
     return(EpmTranslate.MapSyndicationPropertyToEpmTargetPath(epmInfo.Attribute.TargetSyndicationItem));
 }
Beispiel #2
0
        /// <summary>
        /// Given an <see cref="EntityPropertyMappingInfo"/> gives the correct target path for it
        /// </summary>
        /// <param name="epmInfo">Given <see cref="EntityPropertyMappingInfo"/></param>
        /// <returns>string with the correct value for the target path</returns>
        private static string GetPropertyNameFromEpmInfo(EntityPropertyMappingInfo epmInfo)
        {
            if (epmInfo.Attribute.TargetSyndicationItem == SyndicationItemProperty.CustomProperty)
            {
                return(epmInfo.Attribute.TargetPath);
            }

            // for EF provider we want to return a name that corresponds to attribute in the edmx file while for CLR provider
            // and the client we want to return a name that corresponds to the enum value used in EntityPropertyMapping attribute.
            return
                (#if ASTORIA_SERVER
                 epmInfo.IsEFProvider ? EpmTranslate.MapSyndicationPropertyToEpmTargetPath(epmInfo.Attribute.TargetSyndicationItem) :
#endif
                 epmInfo.Attribute.TargetSyndicationItem.ToString());
        }