IEntityField

Posts   
 
    
Ian avatar
Ian
User
Posts: 511
Joined: 01-Apr-2005
# Posted on: 11-May-2005 04:15:13   

Hi,

The manual shows using an FieldCompareRangePredicate like so...

 int[] values = new int[3] {1, 2, 5};
bucket.PredicateExpression.Add(new FieldCompareRangePredicate(
    EntityFieldFactory.Create(OrderFieldIndex.OrderDate), 
    null, values));

However, 'EntityFieldFactory.Create' returs an IEntityField2 and yet FieldCompareRangePredicate requires an IEntityField. How do I get the correct type?

Cheers,

Ian.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 11-May-2005 09:26:06   

Ian wrote:

Hi,

The manual shows using an FieldCompareRangePredicate like so...

 int[] values = new int[3] {1, 2, 5};
bucket.PredicateExpression.Add(new FieldCompareRangePredicate(
    EntityFieldFactory.Create(OrderFieldIndex.OrderDate), 
    null, values));

However, 'EntityFieldFactory.Create' returs an IEntityField2 and yet FieldCompareRangePredicate requires an IEntityField. How do I get the correct type?

As you specify a 'null' for the persistence info, you'll use the adapter constructor:


public FieldCompareRangePredicate(
   IEntityFieldCore field,
   IFieldPersistenceInfo persistenceInfo,
   params object[] values
);

Or do you get an error?

Frans Bouma | Lead developer LLBLGen Pro
Ian avatar
Ian
User
Posts: 511
Joined: 01-Apr-2005
# Posted on: 11-May-2005 16:36:32   

Just needed the right overload. Thanks.