public static string GetEntityKeyValue(EntityInstanceContext entityContext, EntityTypeConfiguration entityTypeConfiguration) { // TODO: BUG 453795: reflection cleanup if (entityTypeConfiguration.Keys().Count() == 1) { return(GetUriRepresentationForKeyValue(entityTypeConfiguration.Keys().First().PropertyInfo, entityContext.EntityInstance, entityTypeConfiguration)); } else { return(String.Join( ",", entityTypeConfiguration .Keys() .Select( key => String.Format(CultureInfo.InvariantCulture, "{0}={1}", key.Name, GetUriRepresentationForKeyValue(key.PropertyInfo, entityContext.EntityInstance, entityTypeConfiguration))))); } }