So I'm having this class with its public property:
public static class DataStore
{
public static readonly List<Item> Items;
static DataStore
{
Items = new List<Item>
{
new Item {Name = "A"},
new Item {Name = "B"},
new Item {Name = "C"},
...//many more
};
}
}
To be memory-efficient, I'm adding a List<Lazy<Item>>
to the DataStore:
List<Lazy<Item>> LazyItems = new List<Lazy<Item>>
{
new Lazy<Item>(() => new Item {Name="A"}),
new Lazy<Item>(() => new Item {Name="B"}),
};
However List<Item>
is a public property and being referenced in plenty places. How can I keep the existing List<Item>
and make use of the new property ?