Page view counter

repository question

Last post 08-14-2008 6:09 PM by robconery. 3 replies.

Sort Posts:

  • repository question

    07-08-2008, 11:03 AM
    • Loading...
    • jwscuba
    • Joined on 09-28-2004, 7:23 PM
    • Posts 90

    I know that this is most likley a stupid question.  But in the sense of having the repository only return what is needed, why not return IEnumerable rather tan IQueryable.  I am sure it is actually because we need IQueryable for something, but unless I am wrong can't the pipes and filters and everything else be done if the repository was returning an IEnumerable.

  • Re: repository question

    07-10-2008, 8:47 PM
    • Loading...
    • robconery
    • Joined on 02-23-2005, 10:16 PM
    • Posts 183
    • AspNetTeam

    Will delayed execution work with IEnumerable? If so - what's the gain here?

  • Re: repository question

    07-11-2008, 12:02 AM
    • Loading...
    • jwscuba
    • Joined on 09-28-2004, 7:23 PM
    • Posts 90

    i am not sure in the gains one way or the other.  I guess that I thought I read somwhere that IEnumerable was somhow lighter or better for performance.  I am just trying to get a handle on why one would be picked over the other.  Why choose one over the other, etc. 

    I was just thinking id the goal of the repository was to return the simplist collection wouldn't that be IEnumerable.  As far as deleyed execution,  I would have to say I don't know how the 2 differ.

  • Re: repository question

    08-14-2008, 6:09 PM
    • Loading...
    • robconery
    • Joined on 02-23-2005, 10:16 PM
    • Posts 183
    • AspNetTeam

     This is something I've thought about a lot and ultimately went with IQueryable. The main reason is to be sure I provide a rich query surface to the logic classes for people who want to customize. That said I should probably look into this more :).


    Thanks...

Page 1 of 1 (4 items)
Microsoft Communities