var orderEventItems = new Lazy<OrderEventItem[]>(() => ...);
If you really want to get rid of the new Lazy<OrderEventItem[]>
, you can create a generic static helper method:
static Lazy<T> CreateLazy<T>(Func<T> f)
{
return new Lazy<T>(f);
}
and then your line becomes:
var orderEventItems = CreateLazy(() => ...);
Though, I find that less readable than the first approach.