First you create a new EntityBucketType value.
public enum BlahBucketType
{
None,
SomethingMeaningfull,
}
Then you create a predicate and relationship property with the same name as your BucketType
public class BlahPredicate
{
public IPredicateExpression SomethingMeaningfull
{
PredicateExpression toReturn = new PredicateExpression();
toReturn.Add( PredicateFactory.CompareValue( BlahFieldIndex.CompanyId, ComparisonOperator.Equal, 25 ) );
return toReturn;
}
}
public class BlahRelation
{
public IRelationCollection SomethingMeaningfull
{
get
{
return null;
}
}
}
Then use the BucketFactory class to get the bucket.
RelationPredicateBucket bucket = BucketFactory.Create( BlahBucketType.SomethingMeaningfull );