0

Hi im really new to llblgen and was wondering how to do this simple task.. sigh

currently I'm grabbing this row by row field.id = 1, but rows can be moved and deleted and i will always want the first row so how do i grab the first row always in llblgen ?

InternalSystemDefaultsEntity systemDefaultsEntity = new InternalSystemDefaultsEntity();

            //___________________________
            // create required filters
            RelationPredicateBucket predBkt = new RelationPredicateBucket();

            IPredicateExpression predExp = new PredicateExpression();

            //get collection then get first row ** needs changed !!
            predExp.Add(InternalSystemDefaultsFields.InternalSystemDefaultId == 1);

            // predExp.Add
            predBkt.PredicateExpression.Add(predExp);

            return systemDefaultsEntity;
Ryan86
  • 77
  • 1
  • 7
  • Can you elaborate a bit more? Are you using the self-servicing or adapter templates? Which version of LLBLGen are you using? Is the ID you're using the primary key? – Wiebe Tijsma Nov 15 '11 at 12:41

1 Answers1

0

Can you elaborate more?

Is there a specific reason you're not using the LLBLGen LINQ syntax?

if you're using adapter, you can retrieve it like this:

var e = new InternalSystemDefaultsEntity();
adapter.FetchEntityUsingUniqueConstraint(e, new PredicateExpression(InternalSystemDefaultsFields.InternalSystemDefaultId == 1);

however, if the ID your're filtering on is a primary key, you can retrieve it like this:

var e = new InternalSystemDefaultsEntity(1);
adapter.FetchEntity(e);

and you're using self servicing templates, you can just retrieve the entity like this:

  var e = new InternalSystemDefaultsEntity(1);
Wiebe Tijsma
  • 10,173
  • 5
  • 52
  • 68
  • I dont care about the Id really i just dont want to hard code the id at all, i just want the first row of the table. – Ryan86 Nov 16 '11 at 17:13
  • Still the other questions I asked are relevant, please answer them to get a more simple answer (why not use linq, using adapter or self servicing templates). – Wiebe Tijsma Nov 17 '11 at 13:30