Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Design question: mvc 3 and the data layer

Design question: mvc 3 and the data layer

Scheduled Pinned Locked Moved ASP.NET
linqcsharpasp-netdatabasearchitecture
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mike Ellison
    wrote on last edited by
    #1

    Hi all. I'm working through the architecture for an ASP.NET MVC 3 solution. I like using LINQ and will probably use the entity framework against a SQL database as the persistence repository. I've seen a lot of examples now where a controller will send lambda expressions to the repository object as a way of indicating a filter, rather than having a specific function declared in the repository interface for the filter scenario. This seems convenient, and performs well as long as you have a LINQ-to-entities or LINQ-toSql compliant repository. I started down that path, but I'm now concerned that it doesn't separate the concerns as much as it should. In the event a new repository layer was needed, one would need to build/implement something that can work with the lambda expressions (e.g construct SQL from the expression tree, or otherwise implementing IQueryable). Otherwise the use of LINQ would require loading a full set into memory from the datastore, potentially killing performance. My question is this: is this a valid concern? Or is the support for LINQ-enabled repositories strong enough among enough database systems that the convenience of LINQ outweighs the coupling concern?

    www.MishaInTheCloud.com

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups