Hi,
i'm newbe in the Entity-World ;-)
how i can get a entity from a collection according to spectial atributes and values ( like TDataSet.Locate () ).
Currently i'm do ot with an loop:
for ASetting in ASettings do
begin
if ASetting.ArticleNumber =5 then
begin
// i found the entity in the collection
Break;
end;
end;
But this is very primitive solution.
Can somebody help me with better solution?
Greetings Andy
How to get specified Entity from TMappedCollection
Re: How to get specified Entity from TMappedCollection
EntityDAC doesn't have a method similar to TDataSet.Locate. You can implement a similar behavior by retrieving every item from a collection, as shown in the EntityDAC demo ("Get Entities by Collections"). Another way is to find the needed element using a LINQ expression.