I'm writing a class where I have a collection of objects of class A and I'm writing a function similar to Dictionary<TKey,TValue>.TryGetValue(TKey,TValue)
It looks pretty similar to this:
public class MyCollection
{
public List<A> Collection {get; set;} = new List<A>();
public bool TryGetPropertyAByPropertyB(string pPropertyB, out string pPropertyA)
{ … }
}
I'm just wondering if I replaced List for IList, would it be more efficient (talking about memory)?
public class MyCollection
{
public IList<A> Collection {get; set;} = new List<A>();
public bool TryGetPropertyAByPropertyB(string pPropertyB, out string pPropertyA)
{ … }
}