LINQ and MVC

Last post 06-04-2009 5:20 PM by CoderX. 3 replies.

Sort Posts:

  • LINQ and MVC

    06-04-2009, 9:56 AM
    • Participant
      781 point Participant
    • Cheese Slayer
    • Member since 03-01-2004, 11:03 PM
    • Posts 265

    I started learning MVC and the book I have suggests using LINQ.

    I've been looking around the web and kept seeing outdated posts with unclear respones saying that Microsoft is going to kill LINQ and that it dosent' support many-to-many relations. 

    The application I'm developing has multiple many-to-many relations and I would like to take advantage of relational syntax so I don't need to write extra code.

     Whats the best approach for this? Should I stick to LINQ, and if so, how can I manipulte many-to-many relationships.

  • Re: LINQ and MVC

    06-04-2009, 10:12 AM
    Answer
    • Contributor
      6,355 point Contributor
    • Augi
    • Member since 10-18-2008, 9:46 AM
    • Czech Republic
    • Posts 1,101

    Consider using of Entity Framework.

    Don't forget to click "Mark as Answer" on the post that helped you.
  • Re: LINQ and MVC

    06-04-2009, 12:00 PM
    Answer
    • Participant
      938 point Participant
    • CW2
    • Member since 05-28-2007, 5:38 PM
    • Czech Republic
    • Posts 207

    Please have a look at Iain Galloway's article to see how many-to-many relationships can be implemented in LINQ, and some interesting details.

  • Re: LINQ and MVC

    06-04-2009, 5:20 PM
    Answer
    • Member
      12 point Member
    • CoderX
    • Member since 04-09-2008, 3:17 PM
    • Posts 1

    Don't confuse LINQ with LINQ-to-SQL. LINQ is a language feature and can be used with objects, xml, and any number of other LINQ providers. Most definitely DO learn and use LINQ, it's awesome!

    LINQ-to-SQL is one of many LINQ providers, and what you're probably thinking of. LINQ-to-SQL can be very useful, despite MS's statements about it's continued development. LINQ-to-Entities is receiving all the attention as far as MS development goes. It is in most people's opinion not 100% yet, but does support many-many relationships better than LINQ-to-SQL. Either one can be used to connect you to your SQLServer database. Since you have lots of many-many relationships you're probably better off with LINQ-to-Entities.

    In any case go learn LINQ... it'll change the way you program. Start here: www.linqpad.net

Page 1 of 1 (4 items)