private static string AliasAttribute(EntityMetadata entityMetadata, string alias, EntityAttribute attribute, string context)
        {
            var contextToUse = context ?? entityMetadata.Name;
            var query        = attribute.GetQueryReplacingMarkers(contextToUse);

            query = BaseQueryUtil.EvaluateServiceQuery(query);
            return(string.Format("{0} as {1}", query, alias));
        }
Exemple #2
0
 private static string GetQuerySortBy(EntityMetadata entityMetadata, EntityAttribute attribute, string suffix)
 {
     if (entityMetadata is SlicedEntityMetadata)
     {
         var a = (SlicedEntityMetadata)entityMetadata;
         if (a.HasUnion())
         {
             //TODO: review this entirely
             return(String.Format(" order by {0} {1}", attribute.Name, suffix));
         }
     }
     return(String.Format(" order by {0} {1}", attribute.GetQueryReplacingMarkers(entityMetadata.Name), suffix));
 }