I have Store List (storeList) object. (Consists of list of Stores) Each Store has list of Addresses. Each address have AddressType property that can be PHYSICAL, ALTERNATIVE or MAILING.
I am trying to return PHYSICAL Address object so I can modify its properties:
This is my first attempt:
StoreAddressList result =
(from str in storeList
where
str.AssetAddresses.Any(p => p.AddressType.Name == "PHYSICAL")
select str.AssetAddresses).FirstOrDefault();
As a result I expect to get list with only one item (where address type is PHYSICAL), but I get list with 3 items (with all three types). What's wrong here?
Thanks