English 中文(简体)
搜查具有任何价值的页
原标题:Searching for pages with any value in property

页: 1

我如何寻找在特定财产中具有任何价值的网页? 我可以搜索具有特定价值的网页,但我可以说明如何寻找“不是空的”。

例如,这项工作:

var criterias = newPropertyCriteriaCollection
{
  new PropertyCriteria()
  { 
    Condition = CompareCondition.NotEqual, 
    Name = "MyProperty", 
    IsNull = false, 
    Type = PropertyDataType.String, 
    Value = "" 
  }
};

var pages = DataFactory.Instance.FindPagesWithCriteria(PageReference.StartPage, criterias);

一种例外是,“老人的价值不能被否定或空洞。 3. 规定IsNull财产用于寻找“无效”

任何想法?

问题回答

Yeah的情况令人困惑。 如果有其他人对此 st倒,那么,这里如何用一定页的文字来查找页数。

new PropertyCriteria()
{
    createdCriteria.Name = "MyProperty";
    createdCriteria.Type = PropertyDataType.PageReference;
    createdCriteria.Condition = EPiServer.Filters.CompareCondition.NotEqual;
    createdCriteria.Value = "0";
    createdCriteria.IsNull = false;
}

除非Im没有trick,否则,这似乎有可能使用EPAiServer PropertyCriteriaCollection。

我的头脑 around,这里是我的调查结果。 FPWC方法最终称为EPAiServer.DataAccess.PropertySearchDB.FastFindPagesWithCriteria().

这种方法如下:

    foreach (PropertyCriteria criteria in criterias)
    {
      if (criteria.IsNull)
      {
        criteria.Value = null;
      }
      else if (string.IsNullOrEmpty(criteria.Value))
      {
        throw new EPiServerException("The crieria value cannot be null or empty. Set the IsNull property to search for null.");
      }
      ...
    }

因此,它不可能在没有确定IsNul的情况下寻找空洞的扼杀价值。 之后,这一方法被投入到EPAiServer.DataAccess.PropertySearchDB.ExecuteCriteria方法,该方法构造了亚洲开发银行的指挥和格式。 由于IsNull是真实的,因此使用储存的代用品。 寻求一种扼杀性需求,以使用储存的图纸。

  if (criteria.IsNull && !PageDB.IsMetaData(criteria.Name))
  {
    cmd.CommandText = "netPropertySearchNull";
  }

我的建议是用林克装上所有页数和过滤器。 或者,你可以研究绕过APIC并采用非行的直接查询,或使用一些低水平的EPAiServer数据获取方法(未建议)

我第一次回答的征象——我确实应在张贴之前测试代码:

我看到,该网页有一个隐蔽的“财产X含有一种价值”的包裹,这是在“拯救”活动中确定的。

之后,羊毛财产被用作一种财产标准,而不是你感兴趣的财产。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签