How to find out how many records

I have a UniqueResult in my Criteria that is eventually raising an error, since its found 2 record.


result := OManager.Find<TEntityICMS>.Where(TLinq.Eq('link', AParam) and TLinq.Eq('dominio', Context.Dominio)).UniqueResult;

I want one of the 2 things:

- or get to know how many records will be considered for take a decision
- or if raising the error get a way to return the first of the set 

I was not looking to retrieve a TList only to get the first always, mostly will be one record.

thanks

Would this work for you?

result := OManager.Find<TEntityICMS>.Where(TLinq.Eq('link',
AParam) and TLinq.Eq('dominio', Context.Dominio)).Take(1).UniqueResult;

that is smart... i liked that!... and it is working, i will test more and see if fits all cases...