LazyList<T> vs System.Lazy<List<T>> in ASP.NET MVC 2?

Posted by FreshCode on Stack Overflow See other posts from Stack Overflow or by FreshCode
Published on 2010-04-22T10:31:39Z Indexed on 2010/04/23 9:43 UTC
Read the original article Hit count: 442

In Rob Conery's Storefront series, Rob makes extensive use of the LazyList<..> construct to pull data from IQueryables.

  • How does this differ from the System.Lazy<...> construct now available in .NET 4.0 (and perhaps earlier)?

More depth based on DoctaJones' great answer:

  1. Would you recommend one over the other if I wanted to operate on IQueryable as a List<T>?
    I'm assuming that since Lazy<T> is in the framework now, it is a safer bet for future support and maintainability?
  2. If I want to use a strong type instead of an anonymous (var) type would the following statements be functionally equivalent?
    • Lazy<List<Products>> Products = new Lazy<List<Product>>();
    • LazyList<Product> = new LazyList<Product>();

© Stack Overflow or respective owner

Related posts about asp.net-mvc-2

Related posts about lazy