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. General Programming
  3. C#
  4. Entity framework in C# MVC

Entity framework in C# MVC

Scheduled Pinned Locked Moved C#
csharpasp-netdatabasearchitecturehelp
6 Posts 4 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.
  • D Offline
    D Offline
    Dolly Nimavat
    wrote on last edited by
    #1

    Why should we use MVC framework? Will there be any problem if I don't use it and instead I use stored procedure?

    S P N 3 Replies Last reply
    0
    • D Dolly Nimavat

      Why should we use MVC framework? Will there be any problem if I don't use it and instead I use stored procedure?

      S Offline
      S Offline
      Sascha Lefevre
      wrote on last edited by
      #2

      MVC doesn't have anything to do with either Entity Framework or Stored Procedures. MVC is a design pattern (or, in case of ASP.Net MVC, a technology) for your presentation layer. Entity Framework and Stored Procedures belong to your data access layer. So, your question doesn't really make sense - instead I would say there will be a problem if you don't understand this. You should understand it before starting to design an application. Edit: If you meant to ask if you should use Entity Framework or Stored Procedures as data access solution for your MVC-project - that would make a bit more sense. But as these are still completely different parts of your application, you can choose whatever you want, or, as Pete O'Hanlon wrote, even Entity Framework with Stored Procedures (there's an article on that here on CodeProject if you want to look into that).

      P 1 Reply Last reply
      0
      • S Sascha Lefevre

        MVC doesn't have anything to do with either Entity Framework or Stored Procedures. MVC is a design pattern (or, in case of ASP.Net MVC, a technology) for your presentation layer. Entity Framework and Stored Procedures belong to your data access layer. So, your question doesn't really make sense - instead I would say there will be a problem if you don't understand this. You should understand it before starting to design an application. Edit: If you meant to ask if you should use Entity Framework or Stored Procedures as data access solution for your MVC-project - that would make a bit more sense. But as these are still completely different parts of your application, you can choose whatever you want, or, as Pete O'Hanlon wrote, even Entity Framework with Stored Procedures (there's an article on that here on CodeProject if you want to look into that).

        P Offline
        P Offline
        Pete OHanlon
        wrote on last edited by
        #3

        I rather think that the OP was asking if you have to use EF in ASP MVC applications.

        S 1 Reply Last reply
        0
        • D Dolly Nimavat

          Why should we use MVC framework? Will there be any problem if I don't use it and instead I use stored procedure?

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          You are free to use whatever approach you like to accessing your database. EF is just one approach you can adopt (you can even use stored procedures in EF if you want to).

          1 Reply Last reply
          0
          • P Pete OHanlon

            I rather think that the OP was asking if you have to use EF in ASP MVC applications.

            S Offline
            S Offline
            Sascha Lefevre
            wrote on last edited by
            #5

            That would make a bit more sense :)

            1 Reply Last reply
            0
            • D Dolly Nimavat

              Why should we use MVC framework? Will there be any problem if I don't use it and instead I use stored procedure?

              N Offline
              N Offline
              Nathan Minier
              wrote on last edited by
              #6

              You'll encounter two issues if you use Stored Procedures with MVC, but both are convenience items. 1. If you want to scaffold controllers for RAD, you will not be able to do so using a SqlConnection; MVC uses Entity Framework for this. 2. If you do not map your Stored Procedure to a model class, you will not be able to scaffold views. Again, this just affects RAD options.

              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